[FFmpeg-devel] H264 video and AVPacket::duration

Alex Sukhanov alx.sukhanov at gmail.com
Tue Nov 19 23:27:55 CET 2013


Hi Michael and ffmpeg-devel,

I recently found that for H264 video ffmpeg demuxers and ffprobe doesn't
set AVPacket::duration field.
This is typical ffprobe output for H264 video packed into FLV container:

packet|codec_type=audio|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=9|pos=103|flags=K_
*packet|codec_type=video|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|convergence_duration=N/A|convergence_duration_time=N/A|size=4188|pos=132|flags=K_*
packet|codec_type=audio|stream_index=1|pts=23|pts_time=0.023000|dts=23|dts_time=0.023000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=9|pos=4337|flags=K_
*packet|codec_type=video|stream_index=0|pts=37|pts_time=0.037000|dts=37|dts_time=0.037000|duration=N/A|duration_time=N/A|convergence_duration=N/A|convergence_duration_time=N/A|size=43|pos=4366|flags=__*
packet|codec_type=audio|stream_index=1|pts=46|pts_time=0.046000|dts=46|dts_time=0.046000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=9|pos=4426|flags=K_
packet|codec_type=audio|stream_index=1|pts=70|pts_time=0.070000|dts=70|dts_time=0.070000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=56|pos=4452|flags=K_
*packet|codec_type=video|stream_index=0|pts=73|pts_time=0.073000|dts=73|dts_time=0.073000|duration=N/A|duration_time=N/A|convergence_duration=N/A|convergence_duration_time=N/A|size=26|pos=4528|flags=__*
packet|codec_type=audio|stream_index=1|pts=93|pts_time=0.093000|dts=93|dts_time=0.093000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=607|pos=4571|flags=K_
*packet|codec_type=video|stream_index=0|pts=110|pts_time=0.110000|dts=110|dts_time=0.110000|duration=N/A|duration_time=N/A|convergence_duration=N/A|convergence_duration_time=N/A|size=31|pos=5198|flags=__*
packet|codec_type=audio|stream_index=1|pts=116|pts_time=0.116000|dts=116|dts_time=0.116000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=599|pos=5246|flags=K_
packet|codec_type=audio|stream_index=1|pts=139|pts_time=0.139000|dts=139|dts_time=0.139000|duration=23|duration_time=0.023000|convergence_duration=N/A|convergence_duration_time=N/A|size=611|pos=5862|flags=K_


I found following patch, which may be related:
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=497431a5b645ffc39cf3acbd333c9ff0f3031adb
I understand the problem with interlaced video  which you fixed in this
patch, but I wanted to ask you If it's possible to move back calculation of
AVPacket::duration for codecs which support Interlace?

I would like to solve my problem and rollback aforementioned patch, but
before that I wanted to check with you and probably encourage some
discussion.
What do you think? Should I elaborate a fix in different way?


Thanks for you help in advance


More information about the ffmpeg-devel mailing list