[FFmpeg-trac] #3553(undetermined:new): Fix Non-monotonous DTS for flv live stream output

FFmpeg trac at avcodec.org
Sun Apr 13 06:03:41 CEST 2014


#3553: Fix Non-monotonous DTS for flv live stream output
-------------------------------------+-------------------------------------
             Reporter:  FishB8       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  dts rtmp     |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by FishB8):

 Ok, I'm going attach an example file. The following is the result of
 trying to do the exact same as was shown previously, just using files
 instead of network rtmp IO.

 {{{
 ffmpeg -fflags +genpts+igndts -i DTS_Discontinuity.flv -c:a libfdk_aac
 -vbr 3 -ac 2 -ar 48000 -c:v libx264 -g 31 -crf 22 -profile:v high
 -preset:v medium -trellis 2 -f flv DTS_Test.flv
 ffmpeg version N-62374-ge89f3d0 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Apr 12 2014 11:08:18 with gcc 4.8.2 (Gentoo 4.8.2 p1.3r1,
 pie-0.5.8r1)
   configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc
 --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2
 -march=native -mfpmath=sse -ftree-vectorize -fomit-frame-pointer -pipe
 -fprefetch-loop-arrays -floop-block -floop-strip-mine -floop-interchange'
 --extra-cflags='-O2 -march=native -mfpmath=sse -ftree-vectorize -fomit-
 frame-pointer -pipe -fprefetch-loop-arrays -floop-block -floop-strip-mine
 -floop-interchange' --extra-cxxflags='-O2 -march=native -mfpmath=sse
 -ftree-vectorize -fomit-frame-pointer -pipe -fprefetch-loop-arrays -floop-
 block -floop-strip-mine -floop-interchange -fvisibility-inlines-hidden
 -DNDEBUG' --disable-static --enable-gpl --enable-postproc --enable-
 avfilter --enable-avresample --disable-stripping --enable-nonfree
 --enable-version3 --enable-nonfree --disable-indev=v4l2 --disable-
 outdev=v4l2 --disable-indev=oss --disable-outdev=oss --enable-version3
 --enable-nonfree --enable-bzlib --disable-runtime-cpudetect --disable-
 debug --disable-doc --enable-gnutls --enable-hardcoded-tables --enable-
 iconv --enable-network --enable-openssl --enable-ffplay --enable-vaapi
 --enable-vdpau --enable-xlib --enable-zlib --enable-libvo-aacenc --enable-
 libvo-amrwbenc --enable-libmp3lame --enable-libaacplus --enable-libfaac
 --enable-libtheora --enable-libtwolame --disable-libwavpack --enable-
 libwebp --enable-libx264 --disable-libx265 --enable-libxvid --enable-
 libcdio --enable-libiec61883 --enable-libdc1394 --disable-libcaca
 --disable-openal --enable-opengl --disable-libv4l2 --enable-libpulse
 --enable-x11grab --disable-libflite --enable-frei0r --enable-fontconfig
 --enable-ladspa --disable-libass --enable-libfreetype --disable-libsoxr
 --enable-pthreads --enable-libopencore-amrwb --enable-libopencore-amrnb
 --enable-libfdk-aac --enable-libopenjpeg --enable-libbluray --disable-
 libcelt --disable-libgme --enable-libgsm --enable-libmodplug --enable-
 libopus --disable-libquvi --disable-librtmp --disable-libssh --enable-
 libschroedinger --enable-libspeex --enable-libvorbis --enable-libvpx
 --disable-libzvbi --disable-armv5te --disable-armv6 --disable-armv6t2
 --disable-neon --disable-vfp --disable-mips32r2 --disable-mipsdspr1
 --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-avx
 --disable-avx2 --disable-fma3 --disable-fma4 --disable-sse42 --cpu=host
   libavutil      52. 75.100 / 52. 75.100
   libavcodec     55. 58.103 / 55. 58.103
   libavformat    55. 37.100 / 55. 37.100
   libavdevice    55. 13.100 / 55. 13.100
   libavfilter     4.  4.100 /  4.  4.100
   libavresample   1.  2.  0 /  1.  2.  0
   libswscale      2.  6.100 /  2.  6.100
   libswresample   0. 18.100 /  0. 18.100
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, flv, from 'DTS_Discontinuity.flv':
   Metadata:
     Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
     displayWidth    : 1280
     displayHeight   : 720
     fps             : 29
     profile         :
     level           :
   Duration: 00:00:06.28, start: 8.854000, bitrate: 4266 kb/s
     Stream #0:0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9],
 30.33 fps, 29.97 tbr, 1k tbn, 59.94 tbc
     Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp
 File 'DTS_Test.flv' already exists. Overwrite ? [y/N] y
 [libx264 @ 0x1c5b1f0] using SAR=1/1
 [libx264 @ 0x1c5b1f0] using cpu capabilities: MMX2 SSE2Fast LZCNT
 [libx264 @ 0x1c5b1f0] profile High, level 3.1
 [libx264 @ 0x1c5b1f0] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0
 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=9
 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=31 keyint_min=3
 scenecut=40 intra_refresh=0 rc_lookahead=31 rc=crf mbtree=1 crf=22.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 [libfdk_aac @ 0x1c5c200] Note, the VBR setting is unsupported and only
 works with some parameter combinations
 Output #0, flv, to 'DTS_Test.flv':
   Metadata:
     Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
     displayWidth    : 1280
     displayHeight   : 720
     fps             : 29
     profile         :
     level           :
     encoder         : Lavf55.37.100
     Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p,
 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 1k tbn, 29.97 tbc
     Stream #0:1: Audio: aac (libfdk_aac) ([10][0][0][0] / 0x000A), 48000
 Hz, stereo, s16
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
   Stream #0:1 -> #0:1 (aac -> libfdk_aac)
 Press [q] to stop, [?] for help
 [h264 @ 0x15697a0] AVC: nal size 23330847B time=00:00:04.69 bitrate=
 247.0kbits/s
 [h264 @ 0x15697a0] missing picture in access unit with size 35
 [flv @ 0x15613d0] DTS 0 < 15225 out of order
 [libfdk_aac @ 0x1c5c200] Queue input is backward in time
 [flv @ 0x1c5a960] Non-monotonous DTS in output stream 0:1; previous: 6357,
 current: -8811; changing to 6357. This may result in incorrect timestamps
 in the output file.

 [...]

 [flv @ 0x1c5a960] Non-monotonous DTS in output stream 0:1; previous: 6357,
 current: -2582; changing to 6357. This may result in incorrect timestamps
 in the output file.
 frame=  191 fps= 99 q=-1.0 Lsize=     323kB time=00:00:06.37 bitrate=
 415.1kbits/s dup=0 drop=188
 video:271kB audio:38kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 4.572499%
 [libx264 @ 0x1c5b1f0] frame I:7     Avg QP:12.04  size:  7908
 [libx264 @ 0x1c5b1f0] frame P:184   Avg QP:16.58  size:  1205
 [libx264 @ 0x1c5b1f0] mb I  I16..4: 70.8% 26.9%  2.3%
 [libx264 @ 0x1c5b1f0] mb P  I16..4:  5.9%  0.6%  0.0%  P16..4:  7.4%  0.4%
 0.1%  0.0%  0.0%    skip:85.5%
 [libx264 @ 0x1c5b1f0] 8x8 transform intra:15.9% inter:70.5%
 [libx264 @ 0x1c5b1f0] coded y,uvDC,uvAC intra: 1.9% 25.7% 6.1% inter: 0.3%
 5.2% 0.4%
 [libx264 @ 0x1c5b1f0] i16 v,h,dc,p: 83% 10%  1%  6%
 [libx264 @ 0x1c5b1f0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 47% 15% 33%  1%  0%
 1%  0%  2%  0%
 [libx264 @ 0x1c5b1f0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 36% 29%  2%  1%
 2%  0%  2%  1%
 [libx264 @ 0x1c5b1f0] i8c dc,h,v,p: 30% 11% 49% 10%
 [libx264 @ 0x1c5b1f0] Weighted P-Frames: Y:0.0% UV:0.0%
 [libx264 @ 0x1c5b1f0] ref P L0: 58.9%  2.5% 31.3%  7.3%
 [libx264 @ 0x1c5b1f0] kb/s:347.72

 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3553#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list