[FFmpeg-trac] #10804(undetermined:new): Wrong packet/frame duration in some H264 video

FFmpeg trac at avcodec.org
Tue Jan 16 10:02:32 EET 2024


#10804: Wrong packet/frame duration in some H264 video
-------------------------------------+-------------------------------------
             Reporter:  Laura Crema  |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  6.1
  undetermined                       |
             Keywords:  h264         |               Blocked By:
  pkt_duration                       |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 Respect v. 4.3, in version 6.1 I got a wrong packet duration in some H264
 video. It happens only on some files,
 How to reproduce:
 {{{
 % ffprobe.exe -show_frames -select_streams 0 test.mp4
 ffprobe version N-112960-g96f646cdc2-20231212 Copyright (c) 2007-2023 the
 FFmpeg developers
   built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-
 config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64
 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug
 --enable-shared --disable-static --disable-w32threads --enable-pthreads
 --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype
 --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig
 --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse
 --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-
 libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint
 --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-
 ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-
 libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray
 --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist
 --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp
 --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb
 --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg
 --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-
 schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1
 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi
 --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-
 libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-
 libxvid --enable-libzimg --enable-libzvbi --extra-
 cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread
 --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20231212
   libavutil      58. 32.100 / 58. 32.100
   libavcodec     60. 35.100 / 60. 35.100
   libavformat    60. 18.100 / 60. 18.100
   libavdevice    60.  4.100 / 60.  4.100
   libavfilter     9. 14.100 /  9. 14.100
   libswscale      7.  6.100 /  7.  6.100
   libswresample   4. 13.100 /  4. 13.100
   libpostproc    57.  4.100 / 57.  4.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
 'Z:\VIDEO\PAL\ONLINE\JanaTolqyn_BG_Koktem_2_03.03.2023.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42mp41
     creation_time   : 2023-03-03T05:46:03.000000Z
   Duration: 00:00:10.00, start: 0.000000, bitrate: 15900 kb/s
   Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661),
 yuv420p(tv, bt709), 1920x1080, 15532 kb/s, 25 fps, 25 tbr, 25k tbn
 (default)
     Metadata:
       creation_time   : 2023-03-03T05:46:03.000000Z
       handler_name    : ?Mainconcept Video Media Handler
       vendor_id       : [0][0][0][0]
       encoder         : AVC Coding
   Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
 stereo, fltp, 317 kb/s (default)
     Metadata:
       creation_time   : 2023-03-03T05:46:03.000000Z
       handler_name    : #Mainconcept MP4 Sound Media Handler
       vendor_id       : [0][0][0][0]
 }}}

 This is the result:
 {{{
 [FRAME]
 media_type=video
 stream_index=0
 key_frame=1
 pts=0
 pts_time=0.000000
 pkt_dts=0
 pkt_dts_time=0.000000
 best_effort_timestamp=0
 best_effort_timestamp_time=0.000000
 pkt_duration=500
 pkt_duration_time=0.020000
 duration=500
 duration_time=0.020000
 pkt_pos=61496
 pkt_size=259128
 width=1920
 height=1080
 ...
 [/FRAME]
 [FRAME]
 media_type=video
 stream_index=0
 key_frame=0
 pts=1000
 pts_time=0.040000
 pkt_dts=1000
 pkt_dts_time=0.040000
 best_effort_timestamp=1000
 best_effort_timestamp_time=0.040000
 pkt_duration=500
 pkt_duration_time=0.020000
 duration=500
 duration_time=0.020000
 pkt_pos=493193
 pkt_size=39086
 width=1920
 height=1080
 ...
 [/FRAME]
 [FRAME]
 media_type=video
 stream_index=0
 key_frame=0
 pts=2000
 pts_time=0.080000
 pkt_dts=2000
 pkt_dts_time=0.080000
 best_effort_timestamp=2000
 best_effort_timestamp_time=0.080000
 pkt_duration=500
 pkt_duration_time=0.020000
 duration=500
 duration_time=0.020000
 pkt_pos=532279
 pkt_size=41132
 width=1920
 height=1080
 ...
 [/FRAME]
 ....
 }}}

 pkt_duration and duration should be 1000 (as with version 4.3), instead I
 got 500
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10804>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list