User Tools

Site Tools


talk:stream_pc

This is an old revision of the document!


Comments by hiviking, 2012-01-13:

I tried the setup described in the article and it worked, but I got jerky video. My computer is a Lenovo R61 which has a Core2Duo T8100 2.1 GHz CPU, running Windows XP SP3. My mediplayer is an Ellion HMR-600. For a long time I have been using VHScrCap to capture Google Earth animations in VirtualDub, and it has been able to capture at 848×480 pixels and 30 fps without missing a frame. So, I gave it a try in VLC. It worked fine in Play mode, but when I tried to stream it, I got a blank screen and lots of errors in the log.

I, therefore, returned to the Screen Capture Recorder and experimented with the settings. In the end I managed to get a very good result, which played smoothly. I tested this on a YouTube video and compared the desktop stream with a direct stream from YouTube. The desktop stream was in fact much better quality.

Since I spent some time on getting this result I think it is worthwhile to share it. The Lenovo R61 has no Wave input that you can record from, so I used the Virtual Audio Cable. You may be able to use the Wave input from your soundcard as the audio capture device in step 3a.

To get a sharp image of the screen that plays smoothly I found that I had to limit the capture area to about 640 x 360 pixels. I also found that the area must have an aspect ratio of exactly 16:9, otherwise the output will be garbled. So, you initially setup a 640 x 360 area at max 25 fps in the Screen Capture Recorder using “configure by setting specific screen capture numbers” in the start menu. In the future you just use “configure screen capture by resizing a transparent window”, but you don't resize it, just move it to the right place on the screen. You have to make the video appear at a size close to 640 x 360 pixels, which can be done by using the zoom feature in your browser.

To set up VLC streaming the following steps are needed. You can use the VLC command line listed below, but using the GUI allows you to make changes according to your preferences.

1. Direct all audio output to Virtual Cable 1 in Control Panel/Sounds and Audio Devices.

 Or setup recording from the Wave input if your computer allows it, and select your sound card as the audio device.

2. Resize the video you wish to stream to a size close to 640 x 360 pixels on the desktop.

 Place the Screen Capture Recorder window over the video as explained above.

3. Open VLC and select Media>Streaming.

 a. Select Capture device and then Select screen-capture-recorder and Virtual Cable 1 (or your sound card).
 b. Click Advanced options... and set the aspect ratio to 16:9.
 c. Check Show more options and increase caching to 2000 ms.
    The first part of the command line options can be seen below.
 d. Click Stream which gets you to the Source window where you click Next.
 e. In the Destinations window you select HTTP, click Add and write go.ts after the / like this: /go.ts.
    (it may work for you with go.mp4, but my mediaplayer won't accept it, only go.ts).
 f. Activate Transcoding should be checked and you select H.264 + AAC (MP4), which should be the default choice.
 g. Click the Edit Selected Profile button and for Encapsulation choose MPEG-TS.
    This corresponds to the ts extention; if you choose .mp4 you should use the MP4/MOV encapsulation.
 h. Click the Video codec tab and set: H-264, 600 kbps, and 25 fps. Scale 1, width 0, height 0.
 i. Click the Audio codec tab and set: MPEG 4 Audio (AAC), 96 kbps, 2, and 44100.
 j. Click Save to save the profile. You can now skip steps g-j in the future.
 k. Click Next to get to Options. If your path to the mediaplayer goes through several routers you should increase TTL.
 l. Click Stream and you should see "Streaming" appear at the bottom of the VLC window.
    The second part of the command line options are listed.
 If you want to see the streamed video in the VLC window, you can check "Display locally" before step e.
 This will probably take some extra processing, so you should normally skip it.

4. In the ServioConsole you add this Online Source as a Live Stream: http://@localhost:8080/go.ts, with a Display Name of e.g. Desktop Stream.

I tried to use the command line copied from 3c and 3l and adapted to my system like this:

"F:\Programs\VLC\vlc.exe" -vvv "dshow:// --dshow-vdev=screen-capture-recorder --dshow-adev=Virtual Cable 1 --dshow-aspect-ratio=16\:9 --dshow-fps=0 --dshow-caching=2000 --sout=#transcode{vcodec=h264,vb=600,fps=25,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=44100}:http{dst=:8080/go.ts} --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep"

Interestingly, I got the image from my webcam. The same thing happened with the command line from the article.

PS: I first tried the command without quotes around the options and enclosing “Virtual Cable 1” in quotes, but VLC then does nothing. It seems reasonable that a device name with spaces should be in quotes, so it is probably something else that is wrong.

talk/stream_pc.1326473844.txt.gz · Last modified: 2012/01/13 16:57 by hiviking