From a799eb3ad97e9b56687e83cf2181cad44ae128db Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 3 Nov 2021 17:01:11 -0400 Subject: [PATCH] add function get_codec to return the codec used in the output mp4 --- src/zm_videostore.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/zm_videostore.h b/src/zm_videostore.h index 682fc147b..c73ed19db 100644 --- a/src/zm_videostore.h +++ b/src/zm_videostore.h @@ -111,6 +111,13 @@ class VideoStore { int writePacket(const std::shared_ptr &pkt); int write_packets(PacketQueue &queue); void flush_codecs(); + const char *get_codec() { + if (chosen_codec_data) + return chosen_codec_data->codec_codec; + if (video_out_stream) + return avcodec_get_name(video_out_stream->codecpar->codec_id); + return ""; + } }; #endif // ZM_VIDEOSTORE_H