Stream PC desktop using VLC

General Forum for talking area for B series TVs.

nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Stream PC desktop using VLC

Post by nescha »

I'm trying to stream my PC desktop using VLC (option for HTTP streaming).

Local network stream is connected to TV either using TVersity Internet podcast or TwonkyMedia Db patch (adds shared content link to network stream as a file).

Unfortunately, my Samsung B651 just reports unsupported video type, after several seconds of attempt.

I tried with different formats, but with no luck. It is interesting that VLC streamed desktop into files which played on TV perfectly, either with TVersity, TwonkyMedia or Samba. Same options streamed to HTTP didn't play on TV.

PS. The best combination for AV type is H.264+AAC packed into .MP4 or .TS in terms of FPS and resolution.

Can you, good people, tell me what am I missing here? Is there any other approach that may satisfy a request to share PC desktop on TV?
nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Re: Stream PC desktop using VLC

Post by nescha »

I managed to succeed desktop streaming using Wild Media Server to my Samsung B651.

Main catch was applying custom transcoding parameters to "Internet television" resource, by using VLC's "screen://" as input stream, to whatever URL you supply as a source (since source is set to "screen://").

In order to reduce latency I played around with parameters and managed to reduce it to only 4sec latency between desktop activity and TV showing it.

Main problem is allowing TV to parse stream header properly while server buffers it and forward it to proper moment. If inappropriate param combination is sent, TV doesn't recognize format. In some cases, 2nd attempt can succeed, which is considered as boundary scenario. In order to achieve low latency and usable quality, video bitrate is set to really high level which makes temp file really big (2MB/s).

Here is the configuration:

URL: http://192.168.1.107:8080/go.mpg (doesn't matter since this input isn't actually used)

Code: Select all

<VLC> --no-crashdump -Idummy --language=en --sout=#transcode{vcodec=mp1v,vb=15000,fps=25,scale=1,vfilter={canvas{width=1366,height=768,aspect=16:9}},acodec=none}:file{mux=ts,dst="<OUTPUT FILE>"}} screen:// :screen-fps=25.000000 :screen-caching=2900 :start-time=2.8
Device => Type: Samsung TV, DLNA, 16:9, 1280x720, with "Transfer data buffer size for this device" set 64 kB (default = 4096 kB)

Transcoder => Transcoding file parameters => File size for transfer start = 1 kB (default = 4096 kB)

If anyone has idea for an improvements like reducing latency or supplying synchronized audio from sound card, lemme now...
mattberlin
SamyGO Project Donor
Posts: 140
Joined: Sun Jan 24, 2010 6:18 pm
Location: Germany

Re: Stream PC desktop using VLC

Post by mattberlin »

Are you really talking about the media player VLC or are you talking about VNC?

In any case, streaming the Windows desktop might solve problems mentioned in the following thread:
http://forum.samygo.tv/viewtopic.php?f=5&t=675

Best regards
Matthias
my TV: LE32B679
nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Re: Stream PC desktop using VLC

Post by nescha »

mattberlin wrote:Are you really talking about the media player VLC or are you talking about VNC?

In any case, streaming the Windows desktop might solve problems mentioned in the following thread:
http://forum.samygo.tv/viewtopic.php?f=5&t=675

Best regards
Matthias

VLC of course...

But problem is having only video (audio is still missing in my solution).
mattberlin
SamyGO Project Donor
Posts: 140
Joined: Sun Jan 24, 2010 6:18 pm
Location: Germany

Re: Stream PC desktop using VLC

Post by mattberlin »

Ok, so it's just about streaming the VLC output and not the entire desktop with its taskbar etc. That's why I got confused.
However, I installed the trial version of Wild Media Server which seems to work quite well when it comes to regular streaming.
But, I haven't yet figured out how to establish your solution when I quickly tested WMS yesterday evening. In any case this is an interesting approach.
my TV: LE32B679
nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Re: Stream PC desktop using VLC

Post by nescha »

mattberlin wrote:Ok, so it's just about streaming the VLC output and not the entire desktop with its taskbar etc. That's why I got confused.
However, I installed the trial version of Wild Media Server which seems to work quite well when it comes to regular streaming.
But, I haven't yet figured out how to establish your solution when I quickly tested WMS yesterday evening. In any case this is an interesting approach.
Well, with my approach, I stream whole desktop as it looks on my laptop with resolution 1366x768. The main thing here is a "patch" a applied to WMS transcoding profile.

1. Add some Internet television link with dummy local address, e.g. http://192.168.1.100:8080/go.mpg
2. Click 4th icon assigned to field Link => Path
3. Set "Use this transcoding parameters" to ON
4. Click 1st icon beside text area. You'll get something like this:

Code: Select all

<VLC> --no-crashdump -Idummy --language=en --sout=#transcode{vcodec=mp2v,vb=12000,fps=24,scale=1,vfilter={canvas{width=1280,height=720,aspect=16:9}},acodec=mpga,ab=192,channels=2,samplerate=48000}:duplicate{dst=std{access=file,mux=ts,dst="<OUTPUT FILE>"}} "<INPUT FILE>"
5. Notice the <INPUT FILE> tag. Instead of real external content or IP stream, I've set screen:// as source
6. I played around with the parameters that match my Samsung B651 and managed to succeed with already mentioned parameters and result
mattberlin
SamyGO Project Donor
Posts: 140
Joined: Sun Jan 24, 2010 6:18 pm
Location: Germany

Re: Stream PC desktop using VLC

Post by mattberlin »

Thx a lot for the guidance.
But for some reason, I don't really know what exactly to do. Which 4th icon are you talking about for instance?
http://img708.imageshack.us/i/unledti.jpg/

best regards
Matthias
my TV: LE32B679
nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Re: Stream PC desktop using VLC

Post by nescha »

mattberlin wrote:Thx a lot for the guidance.
But for some reason, I don't really know what exactly to do. Which 4th icon are you talking about for instance?
http://img708.imageshack.us/i/unledti.jpg/

best regards
Matthias
My interface looks a bit different (Windows version in English), but I presume you should pick "Transcoding" and enable button "Script" to the right... Just a wild (media server) guess :)
nescha
Posts: 30
Joined: Mon Jan 03, 2011 11:03 am

Re: Stream PC desktop using VLC

Post by nescha »

khaivq wrote:Hi nescha,

I was able to follow your guide, and succesfully "push" my laptop screen to my B650. It's amazing.

However, the latency is huge (~10 sec), and the transcoding tax > 90% CPU of my 4 year old laptop.

I have tried to reduce the quality to lower the CPU load by reduce the fps in transcoding parameter, but the TV complain about file format. Is there any way to reduce the quality for latency improving?

Also, how did you change "Transfer data buffer size for this device"?

AFAIK, the encoding heavyweight is being done by VLC, Wild Media Server only act as a simple media wrapper. There could be some way to use Windows 7 build-in media server. The best way is creating some playlist file, and then use Windows 7 "Play to" feature to push the screen to the TV. I am exploring this direction and will report if success,

Khaivq
I'm glad you succeeded!
Streaming of desktop is quite consuming (my I5 goes also to 100% on one processor making the laptop noisy) and this is the price of the method. You can't lower output frame rate since Samsung B650 support only frame rates not lower than 15-20 fps (I couldn't find the source where I read this). You can try lowering the input frame rate sample, e.g. :screen-fps=10.000000

The parameters I've got are pure empirical and I couldn't find the understandable pattern how to adjust the parameters (only my pure logic which didn't help in many occasions :p).

I even tried to use plain file transcoded to use screen as a source, and the results I've got are: much faster start of streaming (around 6-7 secs) but I couldn't reduce the latency to below 10 secs. Internet TV is still the way to go (4-5 secs of latency).

These 4-5 secs only works with these parameters that are defined in "Settings" (5th icon in top toolbar in Windows version of WMS):
1. Go to "Device" panel where I chose Media Device Player "Type" to be "Samsung TV, DLNA, 16:9, 1280x720"
2. Set "Transfer data buffer size for this device" to 64 kB (default = 4096 kB)
3. Go to "Transcoder" panel, and in section "Transcoding file parameters, set "File size for transfer start" to be 1kB (default = 4096 kB)

I contacted WMS forum support if they can give some suggestions which params should work the best, but still no response.
WMS is the only server I could find that would achieve sync properly (request for screen streaming when file is requested by TV, transcoding, and actual streaming). I thought about using TwonkyBeam for this also (where stream can be controlled from PC), but access to transcoding isn't transparent enough.

I hope I gave both of those companies interesting idea to upgrade their software. Hardware solution that can support wireless video streaming(e.g. Intel Wireless Display or PC-to-TV using USB-to-HDMI) also have delay with similar latency (couple of seconds) and cost around 100? (with audio support of course).

Post Reply

Return to “[B] General”