4

I was having some difficulty with running a Live Screencast under Linux. I've found jtvlc and tried using that, but whenever I use it the stream comes out either blank or lagged with extremely high latency. I have a fast internet connection and a fast computer, but am I perhaps taxing it too much?

Any ideas on what I could possibly be doing wrong?

# 1. Get an account on http://www.justin.tv/
# 2. Copy streaming key from: http://www.justin.tv/broadcast/adv_other
# 2. Install VLC: http://www.videolan.org/vlc/
# 3. Get Win/Mac/Lin Stream Client: \
# http://apiwiki.justin.tv/mediawiki/index.php/Linux_Broadcasting_API
# 4. Adjust the vlc parameters to your liking and run VLC like this

#!/bin/bash
cvlc screen:// --input-slave=pulse:// \
    --screen-width 1920 \
    --screen-height 1080 \
    --screen-fps 5 \
    -v input_stream \
    --sout='#duplicate{ dst="transcode{ scale=1, venc=x264{ keyint=60 }, vcodec=h264, vb=600, acodec=mp4a, ab=32, channels=2, samplerate=22050 } :rtp{dst=127.0.0.1,port=1234,sdp=file:///tmp/vlc.sdp} "}' \
    --sout-transcode-threads=4 & sleep 2

# 5. Run JTVLC to stream like this:
./jtvlc/jtvlc omnipotententity censored /tmp/vlc.sdp

# Notes:
#- If you want to see what you're about to stream add 'dst=display, '
# before 'dst="transcode['
# More about the VLC parameters: http://wiki.videolan.org/Documentation:Modules/screen

Update:

I've fixed my issue... for the most part. I was trying to put too much information through my upstream. I've since reduced my resolution and used the crf option for x264.

Now my script lookes like this:

# 1. Get an account on http://www.justin.tv/
# 2. Copy streaming key from: http://www.justin.tv/broadcast/adv_other
# 2. Install VLC: http://www.videolan.org/vlc/
# 3. Get Win/Mac/Lin Stream Client: \
# http://apiwiki.justin.tv/mediawiki/index.php/Linux_Broadcasting_API
# 4. Adjust the vlc parameters to your liking and run VLC like this

#!/bin/bash
cvlc screen:// --input-slave=pulse:// \
    --screen-width 1920 \
    --screen-height 1080 \
    --screen-fps 5 \
    -v input_stream \
    --sout='#duplicate{ dst="transcode{ scale=1, width=1280, height=720, venc=x264{ keyint=60, crf=35 }, vcodec=h264, acodec=mp4a, ab=32, channels=2, samplerate=22050 } :rtp{dst=127.0.0.1,port=1234,sdp=file:///tmp/vlc.sdp} "}' \
    --sout-transcode-threads=4 & sleep 2

# 5. Run JTVLC to stream like this:
./jtvlc/jtvlc omnipotententity redacted /tmp/vlc.sdp

# Notes:
#- If you want to see what you're about to stream add 'dst=display, '
# before 'dst="transcode['
# More about the VLC parameters: http://wiki.videolan.org/Documentation:Modules/screen

That being said, I still do have a few problems. Sometimes when I change the stuff on the screen a bunch it fails to encode properly. Which is odd, because screencasting through Skype 4.0 works just fine. So there's still a few kinks to work out.

I'm leaving the bounty open and I'm actively trying things mentioned. I'll still assign the bounty, even though I self-resolved.

7
  • 1
    When you try to run it, what are the utilizations for CPU, GPU, bandwidth (in % terms)
    – soandos
    Jun 18, 2012 at 5:12
  • CPU is totally fine (less than 50% on any one core), I'm unsure how to measure GPU usage, bandwidth usage hovers right around whatever I put vb= to. (For obvious reasons.) If I set the vb number lower it works much better, but I also get video tearing, artifacting and encoding messes. It might be lost packets, but it also might be that the vb rate is too low? Is there a nice way to set VLC to variable bitrate? Jun 18, 2012 at 17:54
  • @OmnipotentEntity: What's your internet connections maximum bandwidth/throughput? Jun 19, 2012 at 17:59
  • If you get this working, let me know. It'd make it so I don't have to startx, open a browser, and start up my webcam.
    – Rob
    Jun 19, 2012 at 18:10
  • @Oliver: 30mbps down / 5mbps up Jun 20, 2012 at 1:17

3 Answers 3

3
+200

This is probably a shot in the dark but I have a feeling that

--screen-fps 5 \

should be the problem. try to change 5 to a higher value like 50 and see what happens.

7
  • 5 means a rather choppy frame rate, but 50 is way too much. At most I'd do around 30 (that's roughly what movies usually are), but with his bandwidth restriction, I'd probably not go above 10.
    – zebediah49
    Jun 20, 2012 at 20:41
  • Actually bumping up to 24 gets rid of the artifacting issues that I was having before. Jun 21, 2012 at 0:38
  • May I know your graphic card model?
    – Nima
    Jun 21, 2012 at 8:48
  • NVidia 260 GTX If I recall correctly. Jun 21, 2012 at 19:59
  • Ok can you change your screen size to 1280 x 720, set fps to 24 and try it? after changing your desktop size [from your desktop property settings] don't forget to change --screen-width 1920 \ --screen-height 1080 \ to 1280 and 720. I'm guessing the random failures to encode properly is because it needs to resize your captured video runtime and that might cause this issue.
    – Nima
    Jun 21, 2012 at 21:33
0

Another product that you can try :

WebcamStudio For GNU/Linux

0

Try this..!

# 1. Get an account on http://www.justin.tv/
# 2. Copy streaming key from: http://www.justin.tv/broadcast/adv_other
# 2. Install VLC: http://www.videolan.org/vlc/
# 3. Get Win/Mac/Lin Stream Client: \
#    http://apiwiki.justin.tv/mediawiki/index.php/Linux_Broadcasting_API
# 4. Adjust the vlc parameters to your liking and run VLC like this

#!/bin/bash
cvlc screen:// \
    --screen-width 1576 \
    --screen-height 886 \
    --screen-fps 5 \
    --screen-caching 200 \
    --screen-top 75 \
    -v input_stream \
    --sout='#duplicate{ dst="transcode{ scale=1, width=630, height=354, venc=x264{ keyint=60 }, codec=h264, vb=600, acodec=mp4a, ab=32, channels=2, samplerate=22050 } :rtp{dst=127.0.0.1,port=1234,sdp=file:///tmp/vlc.sdp} "}' \
    --sout-transcode-threads=2 &

# 5. Run JTVLC to stream like this:
jtvlc justintvusername streamkey /tmp/vlc.sdp

# Notes:
#- If you want to see what you're about to stream add 'dst=display, '
# before 'dst="transcode['
# More about the VLC parameters: http://wiki.videolan.org/Documentation:Modules/screen

If that doesn't works you can try Live Desktop Streaming via DLNA on GNU/Linux.

1
  • 1
    Man, that script looks weirdly familiar. Jun 18, 2012 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .