Opened 6 years ago

Last modified 5 years ago

#7051 new defect

ffmpeg (libx264) skip frames

Reported by: fireman10 Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: rtsp
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I use ffmpeg with nginx-rtmp-module.
ffmpeg (libx264) skip frames when transcode video from rtsp to (h.264) flv. In VLC rtsp plays coorrect. Tried a lot of parameters. With this -use_wallclock_as_timestamps 1 works better. But a lot of skips stayed.

How to reproduce:

% ffmpeg started on 2018-03-01 at 14:25:52
Report written to "ffmpeg-20180301-142552.log"
Command line:
/opt/bg/adapters/bg-integration-dssl/ffmpeg0228/ffmpeg -timeout -1 -max_delay 50000000 -use_wallclock_as_timestamps 1 -i rtsp://10.114.2.98:554/TTYfRTr7_m/ -acodec none -c:v libx264 -preset veryslow -report -f flv rtmp://10.50.0.11/cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe
ffmpeg version N-45194-g40102a213-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      56.  7.101 / 56.  7.101
  libavcodec     58. 13.100 / 58. 13.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 12.100 /  7. 12.100
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Splitting the commandline.
Reading option '-timeout' ... matched as AVOption 'timeout' with argument '-1'.
Reading option '-max_delay' ... matched as AVOption 'max_delay' with argument '50000000'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://10.114.2.98:554/TTYfRTr7_m/'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'none'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'veryslow'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://10.50.0.11/cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://10.114.2.98:554/TTYfRTr7_m/.
Successfully parsed a group of options.
Opening an input file: rtsp://10.114.2.98:554/TTYfRTr7_m/.
[tcp @ 0x5cbd5c0] No default whitelist set
[rtsp @ 0x5cbb340] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
t=0 0
a=tool:libavformat 55.19.104
m=video 0 RTP/AVP 96
b=AS:200
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1
a=control:streamid=0

[rtsp @ 0x5cbb340] video codec set to: mpeg4
[rtp @ 0x5cbdac0] No default whitelist set
[udp @ 0x5cc1400] No default whitelist set
[udp @ 0x5cc1400] end receive buffer size reported is 131072
[udp @ 0x5cc1040] No default whitelist set
[udp @ 0x5cc1040] end receive buffer size reported is 131072
[rtsp @ 0x5cbb340] setting jitter buffer size to 500
[rtsp @ 0x5cbb340] hello state=0
[mpeg4 @ 0x5cbe9c0] time_increment_bits 0 is invalid in relation to the current bitstream, this is likely caused by a missing VOL header
[mpeg4 @ 0x5cbe9c0] time_increment_bits set to 5 bits, based on bitstream analysis
[mpeg4 @ 0x5cbe9c0] time_increment_bits 4 is invalid in relation to the current bitstream, this is likely caused by a missing VOL header
[mpeg4 @ 0x5cbe9c0] time_increment_bits set to 5 bits, based on bitstream analysis
[mpeg4 @ 0x5cbe9c0] looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
[mpeg4 @ 0x5cbe9c0] Format yuv420p chosen by get_format().
[rtsp @ 0x5cbb340] invalid dts/pts combination 136790023867512
[rtsp @ 0x5cbb340] All info found
Input #0, rtsp, from 'rtsp://10.114.2.98:554/TTYfRTr7_m/':
  Metadata:
    title           : No Name
  Duration: N/A, start: 1519889154.207100, bitrate: N/A
    Stream #0:0, 5, 1/90000: Video: mpeg4 (Simple Profile), yuv420p, 960x576 [SAR 1:1 DAR 5:3], 25 fps, 25 tbr, 90k tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url rtmp://10.50.0.11/cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument none.
Applying option c:v (codec name) with argument libx264.
Applying option f (force format) with argument flv.
Successfully parsed a group of options.
Opening an output file: rtmp://10.50.0.11/cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe.
[rtmp @ 0x5d06780] No default whitelist set
[tcp @ 0x5d02680] No default whitelist set
[rtmp @ 0x5d06780] Handshaking...
[rtmp @ 0x5d06780] Type answer 3
[rtmp @ 0x5d06780] Server version 13.14.10.13
[rtmp @ 0x5d06780] Proto = rtmp, path = /cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe, app = cams, fname = 3344af69-d4fe-4b79-94bb-03dfb95bdebe
[rtmp @ 0x5d06780] Window acknowledgement size = 5000000
[rtmp @ 0x5d06780] Max sent, unacked = 5000000
[rtmp @ 0x5d06780] New incoming chunk size = 1024
[rtmp @ 0x5d06780] Releasing stream...
[rtmp @ 0x5d06780] FCPublish stream...
[rtmp @ 0x5d06780] Creating stream...
[rtmp @ 0x5d06780] Sending publish command for '3344af69-d4fe-4b79-94bb-03dfb95bdebe'
Successfully opened the file.
detected 24 logical cores
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mpeg4 @ 0x5d08d40] Format yuv420p chosen by get_format().
[mpeg4 @ 0x5d08d40] warning: first frame is no keyframe
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'video_size' to value '960x576'
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'time_base' to value '1/90000'
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x6155340] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x6155340] w:960 h:576 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:1/1 sws_param:flags=2
[format @ 0x5f32380] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le'
[AVFilterGraph @ 0x5d02bc0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[libx264 @ 0x5d02dc0] using mv_range_thread = 24
[libx264 @ 0x5d02dc0] using SAR=1/1
[libx264 @ 0x5d02dc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5d02dc0] profile High, level 4.2
[libx264 @ 0x5d02dc0] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://10.50.0.11/cams/3344af69-d4fe-4b79-94bb-03dfb95bdebe':
  Metadata:
    title           : No Name
    encoder         : Lavf58.10.100
    Stream #0:0, 0, 1/1000: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 960x576 [SAR 1:1 DAR 5:3], q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.13.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Clipping frame in rate conversion by 0.000008
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
*** dropping frame 1 from stream 0 at ts -3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.440269
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.009712
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.821663 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.718040 too large
*** dropping frame 7 from stream 0 at ts 9
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.482491
frame=    9 fps=8.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=2 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.268608
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=   19 fps= 12 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=2 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.018318
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.480263
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.763603 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.935265 too large
frame=   35 fps= 17 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=2 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
*** dropping frame 38 from stream 0 at ts 52
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=   40 fps= 15 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=3 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
*** dropping frame 40 from stream 0 at ts 54
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.978050 too large
*** dropping frame 41 from stream 0 at ts 55
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.868324 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=   47 fps= 15 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=5 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.767769 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=   55 fps= 15 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=5 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[libx264 @ 0x5d02dc0] scene cut at 1 Icost:728072 Pcost:724978 ratio:0.0042 bias:0.0250 gop:1 (imb:1942 pmb:30)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[libx264 @ 0x5d02dc0] scene cut at 1 Icost:728072 Pcost:724978 ratio:0.0042 bias:0.0250 gop:1 (imb:1942 pmb:30)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
frame=   68 fps= 16 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=5 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.051384
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.004707
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.403328
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.649437 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.940544 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
*** dropping frame 79 from stream 0 at ts 110
frame=   80 fps= 17 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=6 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
*** dropping frame 80 from stream 0 at ts 111
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.948326 too large
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.982216 too large
*** dropping frame 84 from stream 0 at ts 115
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.352486
frame=   86 fps= 16 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A dup=0 drop=8 speed=   0x    
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Clipping frame in rate conversion by 0.179710
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Past duration 0.671379 too large
[libx264 @ 0x5d02dc0] frame=   0 QP=20.04 NAL=3 Slice:I Poc:0   I:2160 P:0    SKIP:0    size=1981 bytes
Past duration 0.841652 too large
[libx264 @ 0x5d02dc0] frame=   1 QP=17.29 NAL=2 Slice:I Poc:2   I:2160 P:0    SKIP:0    size=38295 bytes
Past duration 0.881386 too large
[libx264 @ 0x5d02dc0] frame=   2 QP=18.25 NAL=2 Slice:P Poc:8   I:41   P:828  SKIP:1291 size=3452 bytes
Clipping frame in rate conversion by 0.380272
[libx264 @ 0x5d02dc0] frame=   3 QP=21.68 NAL=2 Slice:B Poc:4   I:6    P:433  SKIP:1709 size=889 bytes
[libx264 @ 0x5d02dc0] frame=   4 QP=23.68 NAL=0 Slice:B Poc:6   I:3    P:561  SKIP:1590 size=736 bytes
[libx264 @ 0x5d02dc0] frame=   5 QP=21.17 NAL=2 Slice:P Poc:10  I:12   P:453  SKIP:1695 size=1361 bytes
frame=   93 fps= 16 q=28.0 size=      47kB time=00:00:00.12 bitrate=3161.6kbits/s dup=0 drop=8 speed=0.021x    
[libx264 @ 0x5d02dc0] frame=   6 QP=20.56 NAL=2 Slice:P Poc:12  I:10   P:507  SKIP:1643 size=1608 bytes

All errors in log-file

Attachments (1)

ffmpeg-20180301-142552.log (151.6 KB ) - added by fireman10 6 years ago.
ffmpeglog

Download all attachments as: .zip

Change History (2)

by fireman10, 6 years ago

Attachment: ffmpeg-20180301-142552.log added

ffmpeglog

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: rtsp added; skip frames removed
Note: See TracTickets for help on using tickets.