mbox

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

Message ID 20210910093410.47858-1-nicolas.gaullier@cji.paris
Headers show

Message

Nicolas Gaullier Sept. 10, 2021, 9:34 a.m. UTC
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(-)