[FFmpeg-trac] #10018(undetermined:new): Duration estimation regression for h264 in mov
FFmpeg
trac at avcodec.org
Wed Nov 9 17:44:26 EET 2022
#10018: Duration estimation regression for h264 in mov
--------------------------------------+----------------------------------
Reporter: Peter Z | Type: defect
Status: new | Priority: normal
Component: undetermined | Version: 5.0.2
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
--------------------------------------+----------------------------------
Summary of the bug:
There appears to be a regression with guesstimation of packet durations in
ffmpeg v5 compared to v4.4.1. Last tested on ffmpeg master:
86157f5a25615491c94b0498bf76040b268bad6b
How to reproduce:
Create a test file with a frame rate of 30fps with a timescale double
that.
{{{
% ffmpeg -f lavfi -i testsrc=duration=10:size=1728x720:rate=30 -c:v
libx264 -b:v 1000000 -video_track_timescale 60 -movie_timescale 60
repro.mp4
}}}
Check the duration of the packets with ffprobe:
{{{
% ffprobe -show_packets repro.mp4
}}}
With ffmpeg 4.4.1 this would show packet duration as 2 (2/60) but with
ffmpeg 5.x all the packets get duration 1 (1/60).
The consequences of this can also be observed by remuxing the file:
{{{
% ffmpeg -i repro.mp4 -c copy remux.mp4
}}}
Now the probed duration is no longer 10s but 1/60 less 9.983333.
I think this problem might have appeared after H264 parsing was introduced
with this commit:
8a3f8afa4e46011e9c5849f8e0d57ec9b53deef7
At least I have observed that during the execution of the
compute_frame_duration function there is now a valid pointer to a
AVCodecParserContext set but not in the previous version of ffmpeg I ran.
https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/demux.c#L668
Thus the heuristic for guessing the frame duration is now taking the
second branch and going purely on timebase.
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10018>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list