Skip to content

Commit 6476f93

Browse files
committed
Simplify fix for RAWVIDEO handling for ffmpeg 4+
1 parent ddd5246 commit 6476f93

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/FFmpegWriter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,8 +1995,7 @@ bool FFmpegWriter::write_video_packet(std::shared_ptr<Frame> frame, AVFrame *fra
19951995
#if (LIBAVFORMAT_VERSION_MAJOR >= 58)
19961996
ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet", "frame->number", frame->number, "oc->oformat->flags", oc->oformat->flags);
19971997

1998-
if (video_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
1999-
video_st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
1998+
if (AV_GET_CODEC_TYPE(video_st) == AVMEDIA_TYPE_VIDEO && AV_FIND_DECODER_CODEC_ID(video_st) == AV_CODEC_ID_RAWVIDEO) {
20001999
#else
20012000
ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet", "frame->number", frame->number, "oc->oformat->flags & AVFMT_RAWPICTURE", oc->oformat->flags & AVFMT_RAWPICTURE);
20022001

0 commit comments

Comments
 (0)