Page 1 of 1

delay growth

Posted: 03 Nov 2011 15:45
by xdenser
Trying to stream with BlackMagic Intensity Pro card under Ubuntu 11.10.

Using custom built vlc
VLC media player 1.2.0-git Twoflower (revision 1.1.0-pre1-6962-geb5b116)

started with following command line

Code: Select all

cvlc decklink:// --decklink-video-connection hdmi --decklink-mode hp60 --extraintf cli --lua-config cli={host='localhost:4000'} --sout #duplicate{dst='transcode{vcodec=FLV1,venc=ffmpeg{},acodec=no}:std{access=http,mux =ffmpeg{mux=flv},dst=:8081/stream.flv}',dst='transcode{venc=x264{subme=7, ref=4, bframes=16, b-adapt=1, bpyramid=none, weightp=0,preset=medium,tune=film,vbv-bufsize=1500, bitrate=1200, vbv-maxrate=1500}, vcodec=h264, vb=1200, width=720, acodec=no, threads=6}:udp{mux=ts,dst=255.255.255.255,port=1234}'}
everything works fine except growing delay of udp stream.
After several hours it delays about 30 mins. Have not waited more than 5-6 hours but suspect vlc will crash when there will be no memory for buffer.
There is no delay on FLV stream.

Constant delay is ok. How to eleminate growth?

Re: delay growth

Posted: 03 Nov 2011 18:45
by Rémi Denis-Courmont
Turn off multithreaded encoding, maybe,

Re: delay growth

Posted: 04 Nov 2011 09:23
by xdenser
You mean use threads=1 ?
It does not help - delay still grows and vlc memory usage too, while making quality of stream unacceptable.

Re: delay growth

Posted: 04 Nov 2011 09:54
by Rémi Denis-Courmont
This might be a bug in the transcoder or the muxer then.

Re: delay growth

Posted: 04 Nov 2011 19:29
by xdenser
changed vencoder to ffmpeg, dst to rtp.
The problem still there. I also have found that delay (and memory usage) starts growth after some time following vlc start.

Re: delay growth

Posted: 07 Nov 2011 13:55
by xdenser
Further discovery with -vvv option shows that problem starts when following messages appear on stderr
..
main input warning: clock gap, unexpected stream discontinuity
main input warning: feeding synchro with a new reference point trying to recover from clock gap
...

Re: delay growth

Posted: 07 Nov 2011 16:32
by Rémi Denis-Courmont
Oh that... The source has a discontinuity. This might be a bug in the decklink plugin, a hardware problem, or plain stupid scheduling jitter... I guess VLC attempts to recover from the problem in a way that causes extra buffering.

Re: delay growth

Posted: 09 Nov 2011 00:10
by xdenser
What is strange there is no delay growth with FLV1 http output.
And the problem starts after 35-45 minutes of streaming.
Now I've made workaround - just parsing stderr and restaring vlc on 'unexpected stream discontinuity'.