[FFmpeg-trac] #8460(undetermined:new): H.264 VFR timestamp hazards (which means frame duration... or playback experience hazards)
FFmpeg
trac at avcodec.org
Mon Jan 6 04:35:58 EET 2020
#8460: H.264 VFR timestamp hazards (which means frame duration... or playback
experience hazards)
-------------------------------------+-------------------------------------
Reporter: gdgsdg123 | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
[http://trac.ffmpeg.org/ticket/8063#comment:2 123.avi]
[[BR]]
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v h264_nvenc -r 1 -g 1 -vsync vfr "temp.avi"
}}}
The timestamp of the 1st frame is delayed according to `-r` (by 1/r
exactly), while the rest of the timestamps remain unchanged (have verified
this with more complex input source).
Which negatively affects the 1st frame's duration. (and the impact
persists in further re-encodings)
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v h264_nvenc -r 1 -g 2 -vsync vfr "temp.avi"
}}}
The duration of the 2nd frame is influenced by `-r`.
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v h264_nvenc -r 1 -g 3 -vsync vfr "temp.avi"
}}}
Appeared normal. (all timestamps are delayed accordingly)
[[BR]]
[[BR]]
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v libx264 -r 1 -g 1 -vsync vfr "temp.avi"
}}}
Normal.
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v libx264 -r 1 -g 2 -vsync vfr "temp.avi"
}}}
The duration of P-frames (the 2nd frame in this case) become 1/r. (absent
timestamp information in the packet?..)
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v libx264 -r 10 -g 3 -vsync vfr "temp.avi"
}}}
Better demonstration of the above problem.
[[BR]]
{{{
ffmpeg -y -i "123.avi" -c:v libx264 -r 10 -qp 0 -g 3 -vsync vfr "temp.avi"
}}}
Normal. (no P-frame in the output, due to the scenecut decision of x264)
[[BR]]
----
Unsure if it's the encoder's fault or FFmpeg's.
[[BR]]
[[BR]]
[[BR]]
**Off-Topic**
[[BR]]
{{{
ffprobe -hide_banner -show_entries "frame" -select_streams v:0 -of "xml"
"temp.avi"
}}}
{{{
ffprobe -hide_banner -show_entries "frame=best_effort_timestamp_time"
-select_streams v:0 -of "compact=nk=1:p=0" "temp.avi"
}}}
...In case you don't know how to use FFprobe.
[[BR]]
[[BR]]
And in the world of CFR... the duration doesn't have to really exist.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8460>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list