[FFmpeg-user] Large negative pts / dts from IP cameras

Narf! narffy at gmail.com
Thu Sep 1 21:00:44 CEST 2011


I'm trying to capture the h.264 rtsp streams from some Vivotek FD8161
and FD8134 cameras.
Usually ffmpeg can read the streams correctly. However, sometimes I
get an error like:
"Application provided invalid, non monotonically increasing dts to
muxer in stream 0: 36000 >= -102295557451260"
I'm using probesize so I don't have to wait for the probe buffer to fill up.

When using ffprobe, you can see the pts and dts suddenly change into
large negative values on the packets. Wireshark shows the time values
correctly on the packets.

Thanks!


FFmpeg:
ffmpeg -probesize 50 -loglevel debug -i rtsp://10.0.0.229/live.sdp
-vcodec copy -an -y -f avi /tmp/test.avi

ffmpeg version N-32141-g4becc86, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 29 2011 07:35:44 with gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
  configuration: --datadir=/usr/share/ffmpeg --bindir=/usr/local/bin
--libdir=/usr/local/lib --incdir=/usr/local/include
--shlibdir=/usr/lib --mandir=/usr/share/man --disable-avisynth
--extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32
-march=i386 -mtune=generic -fasynchronous-unwind-tables'
--enable-avfilter --enable-libx264 --enable-gpl --enable-version3
--enable-postproc --enable-pthreads --enable-shared --enable-swscale
--enable-vdpau --enable-x11grab --enable-librtmp
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libmp3lame --disable-static --enable-libgsm --enable-libxvid
--enable-libfaac --enable-nonfree
  libavutil    51. 14. 0 / 51. 14. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53. 10. 0 / 53. 10. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 35. 0 /  2. 35. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[rtsp @ 0x9aaa9c0] SDP:
v=0
o=RTSP 949361278 526 IN IP4 0.0.0.0
s=RTSP server
c=IN IP4 0.0.0.0
t=0 0
a=charset:Shift_JIS
a=range:npt=0-
a=control:*
a=etag:1234567890
m=video 0 RTP/AVP 98
b=AS:0
a=rtpmap:98 H264/90000
a=control:trackID=1
a=fmtp:98 packetization-mode=1; profile-level-id=4d001f;
sprop-parameter-sets=J00AH9oCgPZA,KO48gA==

[rtsp @ 0x9aaa9c0] video codec set to: h264
[NULL @ 0x9aae680] RTP Packetization Mode: 1
[NULL @ 0x9aae680] RTP Profile IDC: 4d Profile IOP: 0 Level: 1f
[NULL @ 0x9aae680] Extradata set to 0x9aaeb80 (size: 19)!hello state=0
[h264 @ 0x9aae680] Unsupported bit depth: 0
[rtsp @ 0x9aaa9c0] Probe buffer size limit 50 reached
[rtsp @ 0x9aaa9c0] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate:
180000.00 (180000/1) -> 90000.00 (180000/2)
Input #0, rtsp, from 'rtsp://10.0.0.229/live.sdp':
  Metadata:
    title           : RTSP server
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0, 1, 1/90000: Video: h264 (Main), yuv420p, 640x480,
1/180000, 90k tbr, 90k tbn, 180k tbc
Output #0, avi, to '/tmp/test.avi':
  Metadata:
    INAM            : RTSP server
    ISFT            : Lavf53.10.0
    Stream #0.0, 0, 1/90000: Video: h264 (H264 / 0x34363248), yuv420p,
640x480, 1/90000, q=2-31, 90k tbn, 90k tbc
Stream mapping:
  Stream #0.0 -> #0.0: copy
Press [q] to stop, [?] for help
[avi @ 0x9aadca0] Application provided invalid, non monotonically
increasing dts to muxer in stream 0: 36000 >= -102295549522620
av_interleaved_write_frame(): Invalid argument

---------------------------------------------------------------------
ffprobe:
ffprobe -show_packets -show_streams -pretty -loglevel debug -probesize
50 rtsp://10.0.0.229:554/live.sdp
ffprobe version N-32153-gdb5effe, Copyright (c) 2007-2011 the FFmpeg developers
  built on Aug 30 2011 13:52:50 with gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
  configuration: --datadir=/usr/share/ffmpeg --bindir=/usr/local/bin
--libdir=/usr/local/lib --incdir=/usr/local/include
--shlibdir=/usr/lib --mandir=/usr/share/man --disable-avisynth
--extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32
-march=i386 -mtune=generic -fasynchronous-unwind-tables'
--enable-avfilter --enable-libx264 --enable-gpl --enable-version3
--enable-postproc --enable-pthreads --enable-shared --enable-swscale
--enable-vdpau --enable-x11grab --enable-librtmp
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libmp3lame --disable-static --enable-libgsm --enable-libxvid
--enable-libfaac --enable-nonfree
  libavutil    51. 14. 0 / 51. 14. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53. 10. 0 / 53. 10. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 37. 0 /  2. 37. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[rtsp @ 0x84f29c0] SDP:
v=0
o=RTSP 949358831 873 IN IP4 0.0.0.0
s=RTSP server
c=IN IP4 0.0.0.0
t=0 0
a=charset:Shift_JIS
a=range:npt=0-
a=control:*
a=etag:1234567890
m=video 0 RTP/AVP 98
b=AS:0
a=rtpmap:98 H264/90000
a=control:trackID=1
a=fmtp:98 packetization-mode=1; profile-level-id=4d001f;
sprop-parameter-sets=J00AH9oCgPZA,KO48gA==

[rtsp @ 0x84f29c0] video codec set to: h264
[NULL @ 0x84f6680] RTP Packetization Mode: 1
[NULL @ 0x84f6680] RTP Profile IDC: 4d Profile IOP: 0 Level: 1f
[NULL @ 0x84f6680] Extradata set to 0x84f6b80 (size: 19)!hello state=0
[h264 @ 0x84f6680] Unsupported bit depth: 0
[rtsp @ 0x84f29c0] Probe buffer size limit 50 reached
[rtsp @ 0x84f29c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://10.0.0.229:554/live.sdp':
  Metadata:
    title           : RTSP server
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0, 1, 1/90000: Video: h264 (Main), yuv420p, 640x480,
1/180000, 90k tbr, 90k tbn, 180k tbc
[PACKET]
codec_type=video
stream_index=0
pts=N/A
pts_time=N/A
dts=N/A
dts_time=N/A
duration=0
duration_time=0:00:00.000000
size=13.749 Kibyte
pos=-1
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=9000
pts_time=0:00:00.100000
dts=9000
dts_time=0:00:00.100000
duration=0
duration_time=0:00:00.000000
size=1.005 Kibyte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=18000
pts_time=0:00:00.200000
dts=18000
dts_time=0:00:00.200000
duration=0
duration_time=0:00:00.000000
size=562.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=27000
pts_time=0:00:00.300000
dts=27000
dts_time=0:00:00.300000
duration=0
duration_time=0:00:00.000000
size=483.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=36000
pts_time=0:00:00.400000
dts=36000
dts_time=0:00:00.400000
duration=0
duration_time=0:00:00.000000
size=355.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769715270
pts_time=-315727:-41:-3.503000
dts=-102295769715270
dts_time=-315727:-41:-3.503000
duration=0
duration_time=0:00:00.000000
size=13.724 Kibyte
pos=-1
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769706270
pts_time=-315727:-41:-3.403000
dts=-102295769706270
dts_time=-315727:-41:-3.403000
duration=0
duration_time=0:00:00.000000
size=1.078 Kibyte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769697270
pts_time=-315727:-41:-3.303000
dts=-102295769697270
dts_time=-315727:-41:-3.303000
duration=0
duration_time=0:00:00.000000
size=631.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769688270
pts_time=-315727:-41:-3.203000
dts=-102295769688270
dts_time=-315727:-41:-3.203000
duration=0
duration_time=0:00:00.000000
size=470.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769679270
pts_time=-315727:-41:-3.103000
dts=-102295769679270
dts_time=-315727:-41:-3.103000
duration=0
duration_time=0:00:00.000000
size=401.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769670270
pts_time=-315727:-41:-3.003000
dts=-102295769670270
dts_time=-315727:-41:-3.003000
duration=0
duration_time=0:00:00.000000
size=13.799 Kibyte
pos=-1
flags=K
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769661270
pts_time=-315727:-41:-2.903000
dts=-102295769661270
dts_time=-315727:-41:-2.903000
duration=0
duration_time=0:00:00.000000
size=964.000 byte
pos=-1
flags=_
[/PACKET]
[PACKET]
codec_type=video
stream_index=0
pts=-102295769652270
pts_time=-315727:-41:-2.803000
dts=-102295769652270
dts_time=-315727:-41:-2.803000
duration=0
duration_time=0:00:00.000000
size=623.000 byte
pos=-1
flags=_
[/PACKET]


More information about the ffmpeg-user mailing list