[FFmpeg-devel] [PATCH 0/3] Detect field_order when probing MP4/H264

Nicolas Gaullier nicolas.gaullier at cji.paris
Fri Sep 10 12:34:07 EEST 2021


My use case is a typical ffprobe+ffmpeg scenario where there are many MP4/H264 progressive materials.
I just want to avoid inserting a deinterlacing filter if it is not required.

NOTE: many MP4 files don't have a 'fiel' box. I may be missing sth, but in my information,
this is actually a quicktime atom, not an iso box...
And looking at movenc.c, the writing of 'fiel' is conditionnal on the codec_id and disabled for H264.
At the end, H264 extradata are not very rich, so parsing is required to get field_order.

Patch 1/3 and 2/3 are improvements required to avoid regressions when applying patch 3/3.

Seems to close definitely ticket #7157 whose current status is 'closed defect (needs_more_info)'

Nicolas Gaullier (3):
  avcodec/h264_parser: Set AVCodecContext.framerate
  avformat/utils: Use r_frame_rate in compute_frame_duration if codec_framerate is unknown
  avformat/mov: Set AVSTREAM_PARSE_HEADERS flag for H264

 libavcodec/h264_parser.c                   |  11 +
 libavformat/mov.c                          |   2 +
 libavformat/utils.c                        |   2 +-
 tests/ref/fate/h264-lossless               |  18 +-
 tests/ref/fate/h264_mp4toannexb_ticket2991 | 238 ++++++++++-----------
 tests/ref/fate/mov-zombie                  |   2 +-
 6 files changed, 143 insertions(+), 130 deletions(-)

-- 
2.27.0.windows.1



More information about the ffmpeg-devel mailing list