A buddy of mine (thanks Mike) showed me this today. There is a input Access module in the newer versions of VLC (0.8.6+) called "screen" which makes this possible. To stream your desktop to another machine (ip address: 192.168.1.2 in this case) just use the following command in Linux (sorry command line only):
vlc screen:// :screen-fps=30 :screen-caching=100 --sout '#transcode{vcodec=mp4v,vb=4096,acodec=mpga,ab=256,scale=1,width=1280,height=800}:rtp{dst=192.168.1.2,port=1234,access=udp,mux=ts}'or in Windows (slightly different syntax) use this command:
vlc screen:// :screen-fps=30 :screen-caching=100 :sout=#transcode{vcodec=mp4v,vb=2048,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.1:1234}}This is one massive command, so lets take a look at it in more detail:
- screen:// is our input module selection (if you just run vlc screen:// you'll see your own screen on the server inside vlc....kinda cool)
- :screen-fps=30 specifies that we want to screengrab at 30 fps (from default 5 fps)
- :screen-caching=100 sets the internal caching to 100ms (from default 300 ms)
- --sout is our output chain.
- #transcode tells vlc that we first want to transcode the input using parameters to follow
- {} contains our transcoding parameters
- vcodec=mp4v sets the video codec to mpeg4 video
- vb=4096 sets the bitrate of the transcoded video (4Mb/s)
- acodec=mpga sets the audio codec to mpeg audio (mp3). Audio does not work yet, this is a place holder.
- ab=256 sets the bitrate of the transcoded audio (256 Kb/s)
- scale=1 sets the scaling value
- width=1280 sets the width of the transcoded video to 1280 pixels
- height=800 sets the height of the transcoded video to 800 pixels
- :rtp tells VLC that we want to use rtp protocol to send the encoder output to our receiver machine using Real Time Protocol.
- dst=192.168.1.2 is the ip address of our destination/playback machine
- port=1234 is the default port on the destination/playback machine
- access=udp specifies UDP protocol
- mux=ts sets multiplexing to mpeg-2 Transport stream
Now on the destination machine just open vlc, goto
File/Open Network and by default the
Media Resource Locator on top of the window should read
udp:// and
UDP/RTP with
port 1234 should be selected. If it's not select
UDP/RTP (option 1) and put
1234 as the
port number. Press Okay and you should see the video stream from the other machine (your server machine). That's it....Opensource comes to rescue again :-)
18 comments:
Hi,
i got interested by your post :-) , and tried it on my Open Suse 10.3 .
after doing this "vlc screen:// :screen-fps=30 :screen-caching=100 --sout '#tr anscode{vcodec=mp4v,vb=4096,acodec=mpga,ab=256,scale=1,width=1280,height=800}:rt p{dst=172.16.5.16,port=1234,access=udp,mux=ts}'"
i recieved
"vlc: symbol lookup error: vlc: undefined symbol: img_resample_full_init "
any idea what it could be ,, thanks for a great post .. i would surely try it once more , it could be some error in my system
Bye and thanks a lot
P.S::
(i have vlc 0.8.6d Janus with open suse 10.3 )
Hi Shanky,
Yep, it seems like a known problem with SuSE 10.3 and 10.2......(http://forum.videolan.org/viewtopic.php?f=13&t=41958)
Might want to try it with the latest Ubuntu Linux (7.10). It works like a charm.
Hope this helps....
TTYL
Many
Hi.
Interesting piece of command.
I wanted to test the screen streaming on a windows' and check its performance in terms of CPU/Nwrk/Mem utilization.
It would be great if you could please give me some know-hows using the latest VLC GUI
- BlueBox.
Thank you!
I am trying to stream my desktop over http using Vlc. Is this possible (i succeded only by using VH Screen Capture Driver, but not with your method) ?
Adi,
You're right, I had assumed that VLC would use the same command line syntax across platforms. It does not. I've included a working command line for windows now. It's not HTTP, but for windows only I will be doing a couple of screen shots showing the process through the GUI, I will use http for that example.
TTYL
Many
Works great, thanks a lot.
If I would like to add the sound from the computert as well?
Any ideas?
Cool, this works great. Has anyone figured out how to add this to a live show on ustream.tv?
@John, the only thing that has worked with Ustream so far is Webcamstudio sourceforge.net/projects/webcamstudio/ if you can get VLC working though that would be great to know how.
Are you able to use this as a remote desktop or just streaming the display?
Hey Dan,
Nope just streaming from what's in the article. Although nothing is holding you from using something like synergy (windows/osx/linux) or teleport (osx only) to do the mouse and keyboard bit.
So essentially you setup the remote machine to be on the left or right side of your viewing machine, then you run the procedure above to get the video streaming and once you move your mouse to the edge of the screen you will see it "jump" to the remote desktop over the streaming video.
Nice thing about this is that given about 3-5 Mb/s bandwidth you can do full motion video/3d (with obvious encoding delay).
Wow thank you for passing along that info, it was just what I was looking for.
Off topic, so I understand if you dont post this, we are working with the VLC guys to make a user generated database of secure, virtually partitioned streaming remote desktops. Basically VLC meets UltraVNC meets bittorrent. This really helps, thank you again.
Quick qestion though sorry, couldnt you set the streaming protocol to 3GPP and send it to your cell phone, which is less than a 3-5 mbps connection (until wimax/lte anyway)?
Hey Dan,
Hmmm, Interesting suggestion. My only worry would be the size of the screen on a phone. Maybe the newer netbooks might be a bit better for now. But yeah that would be a neat idea as well......I came across a progy for ipodtouch/iphone that does the remote keyboard/mouse thing if you have VNC installed on the mac or PC....so it might be cool to use it and a netbook/highres phone to do this kinda thing.
BTW thanks for the info in your other email.....looks like a interesting app....keep me posted :-)
TTYL
Many
Actually a quick question. I followed your code and it worked the first time. Now everytime I do it, it just gives me a static image of the screen capture. I am using the exact code that you used on Vista. Any Ideas?
HI Rebelstar,
Try this gui based tutorial : (http://www.nerdlogger.com/2008/03/stream-your-linuxmacwindows-desktop-as.html).
It's basically the same but I might have screwed up a switch or something. Also check to make sure your source machine is actually working. You said that you get a static image on the destination machine. Are you on a local network (ie: both machines). Are you sure there is no bandwidth shaper somewhere between the machines. The stream will be about 5Mb/s, have you checked to make sure that's available between the machines.
I have not tried this on vista at all (don't have vista installed anywhere), so I can't say for, but it might be a vista issue.....maybe.
TTYL
Many
I'm curious if anyone has tried to do this with a multicast so multiple machines could pick up the stream? I'm thinking this would rock in a classroom environment.
Thanks!
Hi Atlas IT,
I've tried multicast and it works beautifully. You do NEED a very good network infrastructure to handle this amount of data being mcast'd around. I've tried it at work (university) with Force10 Equipment and it worked flawless. I then got a bit more adventurous and tried various D-Link/Linksys "SME switches" and they barfed. MP4 and MP2 are pretty time sensetive so these cheapo switches can't seem to deliver things on time. The stream falls apart and you get noise at first followed by a green screen.....
Hope this helps....
Post a Comment