PDA

View Full Version : Increasing delay in player


divan
12-11-2009, 05:40 AM
Hi,

I'm streaming to justintv with dvgrab/vlc/jtvlc under Linux(Ubuntu 9.04) - it works very well and I'm satisfied with the quality. But I have one issue, and cannot find answer and even realize the core of the problem.

Shortly, when I stream there is a small delay between the picture and real events - approx. 10 seconds(5-15 actually, depending on the bitrate). It's ok. The video goes smoothly and synchronization with audio is perfect.
But this delay increases more and more - after 10 minutes of streaming it's already about 1 minute delay. And if I reload the page - the delay is again 10 seconds.

So, at first look, the delay occurs in a flash player. But I wonder, what's the reason of it and how to get rid of it?
It was tested on various browsers on Linux and Windows, by few different people. Tested with bitrates from 256 to 1500 kbps - absolutely the same result on all bitrates for all viewers.

Any suggestions?

More technical info.

- SpeedTest info: http://i.imagehost.org/0623/649435780.png
- Operating System: Linux Ubuntu 9.04 amd64
- Processor: AMD Turion 64 Mobile Technology 2GHz
- CPU Usage:
here is the top snaps:
24002 divan 20 0 1094m 48m 16m S 46.8 4.3 0:03.95 vlc
24001 divan 20 0 180m 18m 1952 S 1.8 1.7 0:00.17 dvgrab

Streaming command:
dvgrab -nostop --buffers 100 -f raw - | cvlc -vvv
--reset-plugins-cache - :demux=rawdv :file-caching=10000
--no-sub-autodetect-file -v
--sout='#duplicate{dst="transcode{venc=x264{keyint=2},vcodec=h264,width=32 0,height=240,vb=256,fps=25,acodec=mp4a,ab=64,chann els=1,samplerate=44100}:rtp{dst=127.0.0.1,port=123 4,sdp=file://'$(pwd)'/vlc.sdp}"}'


SOLUTION: Change audio samplerate from 44100 to the 48000 Hz.

Multiboxing
12-11-2009, 02:05 PM
This is an indicator that your traffic is congested from the full bitrate required to stream to JTV.

divan
12-12-2009, 02:41 PM
This is an indicator that your traffic is congested from the full bitrate required to stream to JTV.
No, I don't agree. This explanation doesn't explain such issues as normal delay after page reload.

Wichitachiefsfan
12-12-2009, 07:45 PM
I've seen some delay like what you describe that starts out at only about 5-10 seconds and thats normal because your broadcast has to go to Justin.tv to your broadcast player and then back to you as a download if you are monitoring and chatting and that all takes time.

But on mine over time during a broadcast with heavy chat with peeps and if I go large screen at all to see how it looks the (lag) from my own broadcast coming back as a download goes up to about 15-25 seconds and sometimes the picture on my monitor will stall and then skip forward once in a great while.

I have DSL and I think that for some reason both uploading the broadcast and if doing heavy chat downloading the broadcast, etc. all at the same time increases the lag but i've never seen it go over about 30 seconds.

And also the peeps watching say my broadcast only has that 5-10 second delay regardless of what I see and it doesn't get any longer so from what I can tell its only on my end and largely its nothing to worry about since the people watching my broadcast don't see any problem.

So if you have DSL you might be seeing the same thing I sometimes do, if you have cable internet (its supposed to be much faster (up and dwn) than DSL you probably shouldn't see more than the 5-10 second delay.

divan
12-13-2009, 08:12 AM
Hey guys, I've solved the problem!

Quickly, I just changed audio bitrate to 48000, instead of 44100 and now this delay in 10 seconds is a constant and everything works perfectly!

I'm a little bit proud that I found the solution using the brain only ))) First, after analyzing all issues, I came to the conclusion, that the problem in the streaming/playing video speed. I.e. I stream video a little bit faster(with some wrong parameters, which affects speed), but flash player plays in normal speed and thus some extra frames appear. Next, I found two proves:
1) Sound which has been captured, streamed, played and once again captured and streamed(loop back effect) becomes lower and lower with each iteration. Thus, I understood that audio and video are little bit slower than normal playback speed.
2) Once I set the audio discr. rate to the 22050 instead of 44100 and got the playspeed double slowly than normal in justin.tv player. So I've found that in my scheme this value affects playspeed.

So, the solution came quickly after that. I found the solution, but still can't understood why it happened. Seems that VLC doesn't do full reencoding and my camera streams audio in 48000Hz.

Wichitachiefsfan
12-13-2009, 12:48 PM
Congrats on finding your fix.