[FFmpeg-user] Streaming failure. libfdk_aac "Queue input is backward in time"

Luke l1 at newanswertech.com
Thu Jun 12 20:31:19 CEST 2014


Hello

I am trying to stream a webcam with audio through ffmpeg 2.2 (Ubuntu 32 bit), to 
an ffserver 2.2 (Ubuntu 64 bit) instance running on a remote machine.

I get a lot of these from ffmpeg while the stream is running:

[ffm @ 0xb803b00] Non-monotonous DTS in output stream 0:0; previous: 326160208, 
current: 325682540; changing to 326160209. This may result in incorrect 
timestamps in the output file.

But okay, it keeps working, so I ignore that.  Then I get:

[libfdk_aac @ 0xb80a260] Queue input is backward in time
[ffm @ 0xb803b00] Non-monotonous DTS in output stream 0:0; previous: 326160209, 
current: 325726485; changing to 326160210. This may result in incorrect 
timestamps in the output file.

Meanwhile, the ffserver is logging lots of these:

Thu Jun 12 08:11:30 2014 [asf_stream @ 0x2a5e890]Application provided invalid, 
non monotonically increasing dts to muxer in stream 0: 1402560663965 >= 
1402560663965
Thu Jun 12 08:11:30 2014 Error writing frame to output for stream 'test.asf': 
Invalid argument

I think maybe these errors are cumulative, and at some point the error is too 
much to handle, but that's only a guess.

Windows media player claims that there was a problem with the file, and doesn't 
try.  Mplayer on Ubuntu can play audio, but unfortunately the streaming unit is 
a headless machine accessed via ssh, so I can not determine whether mplayer is 
getting video.  Mplayer is not my intended audience anyway, but I used it for 
testing.

Abruptly, after a few minutes, my mplayer instance that is listening to the 
stream dies with several of "Error while reading network stream.".
ffmpeg keeps streaming though.

Oh, not sure if it's related, but I'm also seeing this from ffserver, at the 
beginning of the mplayer session:

Thu Jun 12 08:08:59 2014 [asf_stream @ 0x2a5e890]Codec for stream 1 does not use 
global headers but container format requires global headers

My ffmpeg command:

ffmpeg -f oss -i /dev/dsp2 -f video4linux2 -i /dev/video0 \
http://somewhere.org/:5430/test.ffm

ffserver.conf:

Port 5430
BindAddress a.b.c.d
MaxHTTPConnections 50
MaxClients 45
MaxBandwidth 10000
CustomLog /var/log/ffserver.log
<Feed test.ffm>
File /home/vidstream/.test.ffm
FileMaxSize 50MB
</Feed>
# Windows Media Player
<Stream test.asf>
feed test.ffm
Format asf
VideoCodec msmpeg4v2
VideoFrameRate 15
VideoSize vga
VideoBitRate 320
VideoBufferSize 40
VideoGopSize 15
StartSendOnKey
AudioCodec aac
AudioBitRate 128
AudioChannels 2
AudioSampleRate 44100
PreRoll 15
</Stream>
<Stream status.html>
Format status
</Stream>

ffmpeg says the following during startup phase:

ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
   built on Jun 12 2014 02:47:30 with gcc 4.4.7 (Debian 4.4.7-2)
   configuration: --prefix=/usr/local/ffmpeg_build 
--extra-cflags=-I/usr/local/ffmpeg_build/include 
--extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin 
--extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac 
--enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora 
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
   libavutil      52. 89.100 / 52. 89.100
   libavcodec     55. 66.100 / 55. 66.100
   libavformat    55. 43.100 / 55. 43.100
   libavdevice    55. 13.101 / 55. 13.101
   libavfilter     4.  7.100 /  4.  7.100
   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.0 : stereo
Input #0, oss, from '/dev/dsp2':
   Duration: N/A, start: 1402597049.537882, bitrate: 1536 kb/s
     Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[21827264.482140] ehci_hcd 0000:00:1d.7: dma_pool_free buffer-32, 
c0500000/500000 (bad dma)
[21827264.487722] ehci_hcd 0000:00:1d.7: dma_pool_free buffer-32, 
c06e0000/6e0000 (bad dma)
[21827264.493086] ehci_hcd 0000:00:1d.7: dma_pool_free buffer-32, 
c0700000/700000 (bad dma)
Input #1, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 1402597050.073822, bitrate: 147456 kb/s
     Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 
kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Output #0, ffm, to 'http://somewhere.org:5430/test.ffm':
   Metadata:
     creation_time   : now
     encoder         : Lavf55.43.100
     Stream #0:0: Audio: aac (libfdk_aac), 44100 Hz, stereo, s16, 128 kb/s
     Metadata:
       encoder         : Lavc55.66.100 libfdk_aac
     Stream #0:1: Video: msmpeg4v2 (MP42 / 0x3234504D), yuv420p, 640x480, q=2-31, 
320 kb/s, 30 fps, 1000k tbn, 30 tbc
     Metadata:
       encoder         : Lavc55.66.100 msmpeg4v2
Stream mapping:
   Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
   Stream #1:0 -> #0:1 (rawvideo (native) -> msmpeg4v2 (msmpeg4v2))
Press [q] to stop, [?] for help
[libfdk_aac @ 0xb8da260] Trying to remove 1024 samples, but the queue is empty
[ffm @ 0xb8d3b00] Encoder did not produce proper pts, making some up.
[libfdk_aac @ 0xb8da260] Trying to remove 1024 samples, but the queue is empty
qframe=    0 fps=0.0 q=0.0 Lsize=       8kB time=00:00:00.04 
bitrate=1411.2kbits/s
video:0kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: 1002.557190%

Thanks

Luke


More information about the ffmpeg-user mailing list