Opened 4 years ago

Closed 4 years ago

#3980 closed defect (fixed)

Video frame rate is detected too low on sample file

Reported by: 11rcombs Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mkv regression
Cc: rodger.combs@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

File uploaded here: https://www.dropbox.com/s/piyedtb7jqg60mu/Shawn%20Plex%20Trailer.mkv

How to reproduce:

$ ffmpeg -i Shawn\ Plex\ Trailer.mkv -vcodec libx264 -acodec aac -strict -2 -loglevel debug -t 5 Shawn2.ts
ffmpeg version N-66464-g1ea7a3e Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 26 2014 00:06:00 with Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
  configuration: --extra-cflags='-march=native' --enable-optimizations --disable-stripping --enable-debug --enable-libx265 --enable-gpl --enable-libopus --enable-version3 --enable-nonfree --enable-postproc --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-gnutls --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local --enable-static --enable-shared --enable-avresample --enable-vda --enable-opencl --enable-libzvbi --cc=clang --disable-indev=avfoundation
  libavutil      54.  7.101 / 54.  7.101
  libavcodec     56.  1.101 / 56.  1.101
  libavformat    56.  6.100 / 56.  6.100
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.102 /  5.  1.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'Shawn Plex Trailer.mkv'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-strict' ...Routing option strict to both codec and muxer layer
 matched as AVOption 'strict' with argument '-2'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '5'.
Reading option 'Shawn2.ts' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file Shawn Plex Trailer.mkv.
Successfully parsed a group of options.
Opening an input file: Shawn Plex Trailer.mkv.
[matroska,webm @ 0x7fb51a80da00] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
[matroska,webm @ 0x7fb51a80da00] Before avformat_find_stream_info() pos: 4659 bytes read:32768 seeks:0
[h264 @ 0x7fb51a80f000] no picture 
[matroska,webm @ 0x7fb51a80da00] All info found
[matroska,webm @ 0x7fb51a80da00] After avformat_find_stream_info() pos: 112930 bytes read:131072 seeks:0 frames:6
Input #0, matroska,webm, from 'Shawn Plex Trailer.mkv':
  Metadata:
    encoder         : libmkv 0.6.5
  Duration: 00:01:01.08, start: 0.000000, bitrate: 12808 kb/s
    Stream #0:0(eng), 5, 1/1000: Video: h264 (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1/180000, 4.17 fps, 4.17 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1(eng), 1, 1/1000: Audio: aac, 48000 Hz, stereo, fltp (default)
Successfully opened the file.
Parsing a group of options: output file Shawn2.ts.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument aac.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 5.
Successfully parsed a group of options.
Opening an output file: Shawn2.ts.
Successfully opened the file.
detected 8 logical cores
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'time_base' to value '1/1000'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] Setting 'frame_rate' to value '26444/6341'
[graph 0 input from stream 0:0 @ 0x7fb51a422960] w:1920 h:1080 pixfmt:yuv420p tb:1/1000 fr:26444/6341 sar:1/1 sws_param:flags=2
[format @ 0x7fb51a422f80] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16]
[format @ 0x7fb51a422f80] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16'
[AVFilterGraph @ 0x7fb51a423140] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[graph 1 input from stream 0:1 @ 0x7fb51a5008a0] Setting 'time_base' to value '1/48000'
[graph 1 input from stream 0:1 @ 0x7fb51a5008a0] Setting 'sample_rate' to value '48000'
[graph 1 input from stream 0:1 @ 0x7fb51a5008a0] Setting 'sample_fmt' to value 'fltp'
[graph 1 input from stream 0:1 @ 0x7fb51a5008a0] Setting 'channel_layout' to value '0x3'
[graph 1 input from stream 0:1 @ 0x7fb51a5008a0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[audio format for output stream 0:1 @ 0x7fb51a500e00] Setting 'sample_fmts' to value 'fltp'
[audio format for output stream 0:1 @ 0x7fb51a500e00] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x7fb51a500340] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
[libx264 @ 0x7fb51a911200] using mv_range_thread = 40
[libx264 @ 0x7fb51a911200] using SAR=1/1
[libx264 @ 0x7fb51a911200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x7fb51a911200] profile High, level 4.0
[adts @ 0x7fb51a813800] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
[mpegts @ 0x7fb51a910600] muxrate VBR, pcr every 1 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'Shawn2.ts':
  Metadata:
    encoder         : Lavf56.6.100
    Stream #0:0(eng), 0, 1/90000: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 6341/26444, q=-1--1, 4.17 fps, 90k tbn, 4.17 tbc (default)
    Metadata:
      encoder         : Lavc56.1.101 libx264
    Stream #0:1(eng), 0, 1/90000: Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      encoder         : Lavc56.1.101 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0x7fb51b637200] no picture 
[h264 @ 0x7fb51b637e00] no picture 
*** dropping frame 4 from stream 0 at ts 1
    Last message repeated 4 times
*** dropping frame 5 from stream 0 at ts 2
    Last message repeated 4 times
*** dropping frame 6 from stream 0 at ts 3
    Last message repeated 4 times
*** dropping frame 7 from stream 0 at ts 4
    Last message repeated 4 times
*** dropping frame 8 from stream 0 at ts 5
    Last message repeated 4 times
*** dropping frame 9 from stream 0 at ts 6
    Last message repeated 4 times
*** dropping frame 10 from stream 0 at ts 7
    Last message repeated 4 times
*** dropping frame 11 from stream 0 at ts 8
    Last message repeated 4 times
*** dropping frame 12 from stream 0 at ts 9
    Last message repeated 4 times
*** dropping frame 13 from stream 0 at ts 10
    Last message repeated 4 times
*** dropping frame 14 from stream 0 at ts 11
    Last message repeated 4 times
*** dropping frame 15 from stream 0 at ts 12
    Last message repeated 4 times
*** dropping frame 16 from stream 0 at ts 13
    Last message repeated 4 times
*** dropping frame 17 from stream 0 at ts 14
    Last message repeated 4 times
*** dropping frame 18 from stream 0 at ts 15
    Last message repeated 3 times
*** dropping frame 18 from stream 0 at ts 15me=00:00:04.03 bitrate=   0.0kbits/s dup=0 drop=74    
*** dropping frame 19 from stream 0 at ts 16
    Last message repeated 4 times
*** dropping frame 20 from stream 0 at ts 17
    Last message repeated 4 times
*** dropping frame 21 from stream 0 at ts 18
    Last message repeated 4 times
[output stream 0:1 @ 0x7fb51a500be0] EOF on sink link output stream 0:1:default.
No more output streams to write to, finishing.
[libx264 @ 0x7fb51a911200] scene cut at 12 Icost:3357670 Pcost:3029611 ratio:0.0977 bias:0.1098 gop:12 (imb:5602 pmb:2186)
[libx264 @ 0x7fb51a911200] frame=   0 QP=14.57 NAL=3 Slice:I Poc:0   I:8160 P:0    SKIP:0    size=21950 bytes
[libx264 @ 0x7fb51a911200] frame=   1 QP=14.58 NAL=2 Slice:P Poc:2   I:6403 P:821  SKIP:936  size=22858 bytes
[libx264 @ 0x7fb51a911200] frame=   2 QP=14.22 NAL=2 Slice:P Poc:4   I:6010 P:1173 SKIP:977  size=20945 bytes
[libx264 @ 0x7fb51a911200] frame=   3 QP=15.13 NAL=2 Slice:P Poc:6   I:5736 P:1092 SKIP:1332 size=25945 bytes
[libx264 @ 0x7fb51a911200] frame=   4 QP=19.05 NAL=2 Slice:P Poc:8   I:8121 P:39   SKIP:0    size=83768 bytes
[libx264 @ 0x7fb51a911200] frame=   5 QP=20.78 NAL=2 Slice:P Poc:10  I:7886 P:273  SKIP:1    size=116729 bytes
[libx264 @ 0x7fb51a911200] frame=   6 QP=21.02 NAL=2 Slice:P Poc:12  I:7580 P:580  SKIP:0    size=122894 bytes
[libx264 @ 0x7fb51a911200] frame=   7 QP=20.78 NAL=2 Slice:P Poc:14  I:7566 P:593  SKIP:1    size=127714 bytes
[libx264 @ 0x7fb51a911200] frame=   8 QP=20.78 NAL=2 Slice:P Poc:16  I:7373 P:787  SKIP:0    size=130656 bytes
[libx264 @ 0x7fb51a911200] frame=   9 QP=21.05 NAL=2 Slice:P Poc:18  I:7763 P:396  SKIP:1    size=130279 bytes
[libx264 @ 0x7fb51a911200] frame=  10 QP=20.79 NAL=2 Slice:P Poc:20  I:6790 P:1366 SKIP:4    size=134628 bytes
[libx264 @ 0x7fb51a911200] frame=  11 QP=20.33 NAL=2 Slice:P Poc:22  I:6459 P:1699 SKIP:2    size=128772 bytes
[libx264 @ 0x7fb51a911200] frame=  12 QP=17.15 NAL=3 Slice:I Poc:0   I:8160 P:0    SKIP:0    size=168608 bytes
[libx264 @ 0x7fb51a911200] frame=  13 QP=19.52 NAL=2 Slice:P Poc:2   I:5846 P:2293 SKIP:21   size=111950 bytes
[libx264 @ 0x7fb51a911200] frame=  14 QP=19.38 NAL=2 Slice:P Poc:4   I:5153 P:2982 SKIP:25   size=105524 bytes
[libx264 @ 0x7fb51a911200] frame=  15 QP=19.24 NAL=2 Slice:P Poc:6   I:5348 P:2806 SKIP:6    size=107429 bytes
[libx264 @ 0x7fb51a911200] frame=  16 QP=19.05 NAL=2 Slice:P Poc:8   I:5039 P:3097 SKIP:24   size=99340 bytes
[libx264 @ 0x7fb51a911200] frame=  17 QP=18.96 NAL=2 Slice:P Poc:10  I:4275 P:3840 SKIP:45   size=93390 bytes
[libx264 @ 0x7fb51a911200] frame=  18 QP=19.15 NAL=2 Slice:P Poc:12  I:4221 P:3874 SKIP:65   size=88879 bytes
[libx264 @ 0x7fb51a911200] frame=  19 QP=18.94 NAL=2 Slice:P Poc:14  I:5122 P:3019 SKIP:19   size=87332 bytes
[libx264 @ 0x7fb51a911200] frame=  20 QP=19.32 NAL=2 Slice:P Poc:16  I:4325 P:3741 SKIP:94   size=77397 bytes
[aac @ 0x7fb51a810200] Trying to remove 632 more samples than there are in the queue
frame=   21 fps=9.3 q=-1.0 Lsize=    2210kB time=00:00:05.01 bitrate=3610.9kbits/s dup=0 drop=90    
video:1960kB audio:81kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.275477%
Input file #0 (Shawn Plex Trailer.mkv):
  Input stream #0:0 (video): 124 packets read (7992604 bytes); 115 frames decoded; 
  Input stream #0:1 (audio): 236 packets read (74251 bytes); 236 frames decoded (241664 samples); 
  Total: 360 packets (8066855 bytes) demuxed
Output file #0 (Shawn2.ts):
  Output stream #0:0 (video): 21 frames encoded; 21 packets muxed (2006987 bytes); 
  Output stream #0:1 (audio): 235 frames encoded (240008 samples); 236 packets muxed (82838 bytes); 
  Total: 257 packets (2089825 bytes) muxed
361 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fb51a426600] Statistics: 0 seeks, 107 writeouts
[libx264 @ 0x7fb51a911200] frame I:2     Avg QP:15.86  size: 95279
[libx264 @ 0x7fb51a911200] frame P:19    Avg QP:19.06  size: 95602
[libx264 @ 0x7fb51a911200] mb I  I16..4: 24.9% 61.5% 13.6%
[libx264 @ 0x7fb51a911200] mb P  I16..4: 13.4% 50.5% 11.5%  P16..4: 13.3%  7.2%  1.7%  0.0%  0.0%    skip: 2.3%
[libx264 @ 0x7fb51a911200] 8x8 transform intra:66.3% inter:75.0%
[libx264 @ 0x7fb51a911200] coded y,uvDC,uvAC intra: 60.9% 83.5% 51.3% inter: 48.3% 77.6% 6.2%
[libx264 @ 0x7fb51a911200] i16 v,h,dc,p: 13% 35%  8% 44%
[libx264 @ 0x7fb51a911200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 28% 13%  5%  6%  6%  8%  5%  7%
[libx264 @ 0x7fb51a911200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 25%  9%  5%  9%  8%  9%  6%  5%
[libx264 @ 0x7fb51a911200] i8c dc,h,v,p: 40% 31% 15% 14%
[libx264 @ 0x7fb51a911200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fb51a911200] ref P L0: 69.8% 10.1% 14.6%  5.5%
[libx264 @ 0x7fb51a911200] kb/s:3188.49
[AVIOContext @ 0x7fb51a423500] Statistics: 8104874 bytes read, 0 seeks

Note Stream #0:0(eng), 5, 1/1000: Video: h264 (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1/180000, 4.17 fps, 4.17 tbr, 1k tbn, 180k tbc (default); the file is actually 25fps and plays normally in VLC and mpv. The resulting output file is 4.17fps; the output looks fine if I specify -r 25 on the command line.

Change History (4)

comment:1 Changed 4 years ago by gjdfgh

This is because the mkv contains the framerate as header:

|  + Default duration: 239.790ms (4.170 frames/fields per second for a video track)

That's pretty annoying, but there are files like this around. It would be nice if the API could distinguish possibly incorrect hints from the header, and actual framerate.

comment:2 follow-up: Changed 4 years ago by 11rcombs

(Out of curiosity, what did you use to parse the file and return that information?)

comment:3 in reply to: ↑ 2 Changed 4 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords mkv regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

Replying to 11rcombs:

(Out of curiosity, what did you use to parse the file and return that information?)

mkvinfo

If there is an issue, it is a regression since e366e6bf

For future tickets: Please do not use external libraries like libx264 to show issues, this makes reproducing them much easier. Please use -vcodec mpeg4 instead, the output files are supported by all players afaict.

comment:4 Changed 4 years ago by michael

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.