[FFmpeg-user] Getting Non-monotonous DTS in output stream 0:1 error

Bogdan ioan Gabor bogdanioan.gabor at yahoo.com
Sun Feb 1 16:16:58 CET 2015


Hi,I'm trying to transcode an RTSP live stream which comes from a network camera into HTTP, in Flash and HLS format, in order to make it available on desktop and mobile browsers.I dynamically create a ffserver configuration file and start ffserver and ffmpeg, since I can't add other feeds on the fly (or can I?).
The problem is that, sometimes work, sometimes doesn't.Whenever it does not, I'm getting the Non-monotonous DTS in output stream 0:1, in first frames, so I'm thinking it's something related to syncing.
fserver command:
ffserver -f {path to ffserver.conf} -d
ffmpeg flash command:
ffmpeg -y -rtsp_transport tcp -i "rtsp://{rtsp_url}" -acodec copy -vcodec copy "http://127.0.0.1:8080/feed.ffm"
ffserver configuration:
Port 8080
 BindAddress 0.0.0.0
 
 <Feed feed.ffm>
     File {path to feed.ffm}
     FileMaxSize 5M
     ACL allow 127.0.0.1
 </Feed>
 
 <Stream stream.flv>
     Feed feed.ffm
     Format flv
    VideoCodec libx264
     AVOptionVideo flags +global_header
    AudioCodec libmp3lame
     AVOptionAudio flags +global_header
 </Stream>
ffmpeg log:

ffmpeg version 2.3.4 Copyright (c) 2000-2014 the FFmpeg developers
 built on Dec 4 2014 09:23:21 with gcc 4.8.2 (GCC) 20140120 (Red Hat
4.8.2-16)
 configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg
--incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man
--arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio
--enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads --disable-static
--enable-shared --enable-gpl --disable-debug --disable-stripping
--shlibdir=/usr/lib64 --enable-runtime-cpudetect
 libavutil 52. 92.100 / 52. 92.100
 libavcodec 55. 69.100 / 55. 69.100
 libavformat 55. 48.100 / 55. 48.100
 libavdevice 55. 13.102 / 55. 13.102
 libavfilter 4. 11.100 / 4. 11.100
 libavresample 1. 3. 0 / 1. 3. 0
 libswscale 2. 6.100 / 2. 6.100
 libswresample 0. 19.100 / 0. 19.100
 libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from
'rtsp://{rtsp_url}':
 Metadata:
 title : Media Presentation
 Duration: N/A, start: 0.000000, bitrate: 64 kb/s
 Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709), 1280x960, 10 fps, 25
tbr, 90k tbn, 20 tbc
 Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
Output #0, ffm, to 'http://127.0.0.1:8080/feed.ffm':
 Metadata:
 title : Media Presentation
 creation_time : now
 encoder : Lavf55.48.100
 Stream #0:0: Audio: pcm_mulaw, 8000 Hz, mono, 64 kb/s
 Stream #0:1: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1280x960,
q=2-31, 10 fps, 1000k tbn, 10 tbc
Stream mapping:
 Stream #0:1 -> #0:0 (copy)
 Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621000,
current: 121000; changing to 621001. This may result in incorrect timestamps
in the output file.
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621001,
current: 202000; changing to 621002. This may result in incorrect timestamps
in the output file.
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621002,
current: 321000; changing to 621003. This may result in incorrect timestamps
in the output file.
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621003,
current: 401000; changing to 621004. This may result in incorrect timestamps
in the output file.
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621004,
current: 521000; changing to 621005. This may result in incorrect timestamps
in the output file.
[ffm @ 0x20064a0] Non-monotonous DTS in output stream 0:1; previous: 621005,
current: 602000; changing to 621006. This may result in incorrect timestamps
in the output file.
frame= 32 fps=0.0 q=-1.0 size= 124kB time=00:00:03.40 bitrate= 298.8kbits/s
frame= 39 fps= 36 q=-1.0 size= 136kB time=00:00:04.04 bitrate= 275.8kbits/s
...

video:169kB audio:69kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 4.125630%
Received signal 15: terminating.

ffserver log:
ffserver version 2.3.4 Copyright (c) 2000-2014 the FFmpeg developers
 built on Dec 4 2014 09:23:21 with gcc 4.8.2 (GCC) 20140120 (Red Hat
4.8.2-16)
 configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg
--incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man
--arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib
--disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio
--enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads --disable-static
--enable-shared --enable-gpl --disable-debug --disable-stripping
--shlibdir=/usr/lib64 --enable-runtime-cpudetect
 libavutil 52. 92.100 / 52. 92.100
 libavcodec 55. 69.100 / 55. 69.100
 libavformat 55. 48.100 / 55. 48.100
 libavdevice 55. 13.102 / 55. 13.102
 libavfilter 4. 11.100 / 4. 11.100
 libavresample 1. 3. 0 / 1. 3. 0
 libswscale 2. 6.100 / 2. 6.100
 libswresample 0. 19.100 / 0. 19.100
 libpostproc 52. 3.100 / 52. 3.100
Sun Feb 1 14:15:44 2015 FFserver started.
Sun Feb 1 14:15:46 2015 5.13.73.123 - - New connection: GET
/feed.flv
Sun Feb 1 14:15:48 2015 127.0.0.1 - - New connection: GET /feed.ffm
Sun Feb 1 14:15:48 2015 127.0.0.1 - - [GET] "/feed.ffm HTTP/1.1"
200 4175
Sun Feb 1 14:15:48 2015 127.0.0.1 - - New connection: POST
/feed.ffm


Looks like it doesn;t work on flowplayer, since the first frames are "broken", but it works if I open the link in VLC (the "broken" frames are visible.)Is there any possibility to drop the affected frames. I've also tried to use -dts_delta_threshold, but with no luck.Also, since the stream is a live stream, and I don't care very much about the quality of the output, any idea of how I can improve the speed, and avoid the delay will be appreciated.
Thank you. 


More information about the ffmpeg-user mailing list