Sunday, March 23, 2014

Use VLC to share your desktop in a classroom or for a multicast lab

It's been a few weeks since I've posted so I thought I would post a short set of instructions on how I use VLC to create a video stream of my desktop in my classroom.  I also use this method to run a multicast routing lab.  I use the arrow to show what should be selected next in the GUI, you can read it as "then select." 

First from the Instructor/Source computer.  Open VLC.
  1. Choose Media -> Stream
  2. Capture Device -> Capture Mode -> Desktop -> Stream (this will start a wizard)
  3. @Source -> Next
  4. @Destination Setup -> New Destination -> RTP / MPEG Transport Stream -> Add
    Address -> 225.99.99.99 -> Next
  5. @Transcoding Options -> Profile ->  Video - H.264 + MP3 -> Next
  6. @Option Setup -> Stream all elementary streams -> Stream (If you want your stream used for a multicast routing lab, modify the ttl value, to how many routers it will need to traverse; see ttl value set in the cli.)
From the CLI (linux - This is a single line):
cvlc screen:// :screen-fps=10 --sout '#transcode{vcodec=h264,vb=0,scale=1,acodec=none}:
rtp{dst=225.99.99.99,port=5004,mux=ts,ttl=5}' --sout-all --sout-keep



Now from the Student/Client computer.  Open VLC.

  1. Media -> Open Network Stream
  2. Network URL -> rtp://@225.99.99.99:5004 -> Play

From CLI (linux):
cvlc rtp://@225.99.99.99:5004


Fedora Shortcut - Create a file called Classroom.desktop placed in /usr/share/applications with the following content:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Classroom Video Stream
Comment=Classroom Video Stream
Exec=/bin/cvlc rtp://@225.99.99.99:5004
Icon=vlc
Terminal=false