Set codec_type in ffmpeg_camera instead of in monitor

This commit is contained in:
Isaac Connor
2020-12-27 11:56:44 -05:00
parent 0521d05295
commit d6bbc9bbbb

View File

@@ -237,6 +237,13 @@ int FfmpegCamera::Capture(ZMPacket &zm_packet) {
}
dumpPacket(mFormatContext->streams[packet.stream_index], &packet, "ffmpeg_camera in");
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
//audio_packet->codec_type = camera->get_AudioStream()->codecpar->codec_type;
zm_packet.codec_type = mFormatContext->streams[packet.stream_index]->codecpar->codec_type;
#else
zm_packet.codec_type = mFormatContext->streams[packet.stream_index]->codec->codec_type;
//audio_packet->codec_type = camera->get_AudioStream()->codec->codec_type;
#endif
bytes += packet.size;
zm_packet.set_packet(&packet);
zm_av_packet_unref(&packet);