Page 1 of 12

Re: streaming desk top to tv

PostPosted: Mon Jan 09, 2012 10:25 am
by jk50
Greetings and thanks to zip for his brilliant work.

Has anyone tried to get it working in a linux environment?


I've got desktop streaming working on Kubuntu 11.10 using vlc 1.3.0 with this vlc command line

  Code:
vlc screen:// :screen-fps=24.000000 :input-slave=alsa://pulse :sout="#transcode{vcodec=mp2v,vb=10000,fps=24,width=1280,acodec=mp3,ab=192,channels=2,samplerate=44100} :http{dst=:8081/desk.ts}" :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


and this url in Serviio Console/Online Sources/Live Stream

  Code:
http://localhost:8081/desk.ts


I got vlc 1.3.0 from vlc nightly builds here http://nightlies.videolan.org/.
I don't know if this works with the older version of vlc in the ubuntu repositories, maybe someone can chime in on that.
So far I can't figure out how to capture the mouse cursor, maybe someone smarter than me can help with that.

Re: streaming desk top to tv

PostPosted: Mon Jan 09, 2012 10:37 am
by zip
great, could you add the to the Wiki? A linux section of the article perhaps.

Re: streaming desk top to tv

PostPosted: Mon Jan 09, 2012 10:47 am
by Cerberus
i will add it later for you zip.

EDIT: http://wiki.serviio.org/doku.php?id=stream_pc_linux

Re: streaming desk top to tv

PostPosted: Tue Jan 10, 2012 1:31 am
by sohail579
does anyone think windows media encoder would work as a all in one solution?

Re: streaming desk top to tv

PostPosted: Tue Jan 10, 2012 1:37 am
by fmustang76
wapman wrote:When I run the script from Wiki, VLC opens and it says at the bottom left (status line?) ://dshow, the timer down right is counting. I also get an error message saying VLC can not use unit screen-capture-recorder because it is not a supported type (translated from Swedish..so aprox.)


I had the same problem on a fresh Windows 7 x86 install. I found that I had to install the "Microsoft Visual C++ 2010 Redistributable Package". Not sure if you have to reinstall "screen-capture-recorder" for everything to be registered correctly but I did.

http://www.microsoft.com/download/en/de ... px?id=5555


To verify that VLC has the "screen-capture-recorder" dshow filter available:

Open VLC. Click "Media" on top bar, click "Streaming", then select "Capture Device".

Across from "Video device name" there should be a drop down box and there should be a listed device "screen-capture-recorder".

Also in order to configure "screen-capture-recorder" you need the Java JRE installed.

Re: streaming desk top to tv

PostPosted: Tue Jan 10, 2012 7:00 am
by wapman
Hi friends,

Thanks to your help I have now been able to "partly" get the streaming of my desk top to work.

I can verify that you need to re install screen-capture-recorder after installing the MVC. I did it the other way around and then the filter was not in the list of devices in VLC.

Now I have the following problems:

I have to set s-c-r to 1280 x 720 to get a picture on my Samsung, otherwise it says "codec not...". Of course this force me to set the PC screen to the same, instead of 1366 x 768.

Serviio will crash after about 20 seconds of watching sluggish "streamed TV" on the Samsung. I have changed the stream to 5000 and cache to 20000, it seems to help but not solve. Will play around a bit more with those settings.

Thanks for your help so far..:)

Cheers.

Re: streaming desk top to tv

PostPosted: Tue Jan 10, 2012 9:14 pm
by vince
Gents,

I am trying to get desktop streaming to work from an XP Professional SP2 machine via my xbox to my panasonic. Streaming other video files works fine.

Having installed VLC (1.1.11) and VAC (driver 4.10.0.2537, Control Panel 4.10.0.2537 - which comes up as "Virtual Cable 1" rather than "Line 1" as per wiki, so will add that in when I get this going), then run the StreamDestop.bat file:

  Code:
@echo off

:This bat is used to stream the desktop with VLC using HTTP
:A corresponding player must be started using HTTP

@echo off

:This bat is used to stream the desktop with VLC using HTTP
:A corresponding player must be started using HTTP


"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv dshow:// --sout=#transcode{venc=ffmpeg,vcodec=mp2v,vb=10000,fps=24,scale=0.5,width=1280,acodec=mp3,ab=192,channels=2,samplerate=44100,soverlay}:std{access=http,mux=ts,dst=:8081} --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep   :dshow-vdev=screen-capture-recorder :dshow-adev="Virtual Cable 1" :dshow-caching=2000


Then add the stream into Serviio online sources and try to play it through the xbox, I get a "Unplayable Content, the connection to your computer was lost" error (where other avi's are streamed fine.


Testing the output via mplayer (after setting the resolution to 1280*1024 via the config utilities) I see a playback of my screen that gradually "grows" and gets marginally longer and wider and distorts.

Any help greatly appreciated, with the promise of adding the knowledge back onto the wiki!!

Regards.

Re: streaming desk top to tv

PostPosted: Tue Jan 10, 2012 11:40 pm
by jhb50
The documentation/read-me with screen capture recorder addresses the reinstall of MVC and the Startmenu entries provide utilities to set this and screen sizes correctly.

It also provides a performance utility that may indicate your cpus are not sufficient to capture and transcode to MPEG-2. I have an 8 way processor that only uses about 10% cpu to doi the job, but if I only use 2 cores the utilization increases to 90%. As a rule of thumb, I would say that if your system is not in the $500+ range, it probably won't have the power it needs. Others may want to post their experiences wrt this. If the system cannot provide the screen in real time then it will drop the feed to Serviioo and Serviio will give an unsupported file format error (On Samsunng D).

Strange that your VAC comes up with "Virtual Cable 1" in "Virtual Cable 1" in VLC. I'm using the same release and VLC shows as per the bat. My Playback Devices also shows "Line 1" as per the Wiki. Maybe something in the config.

Try reducing your screen resolution to 640x360 and the bitrate to 2000 to see if it works. If it does then a 1280x720 screen is too much load for your system.

Re: streaming desk top to tv

PostPosted: Wed Jan 11, 2012 2:08 am
by mchristian
[quote="jk50"]Greetings and thanks to zip for his brilliant work.

[quote]
  Code:
vlc screen:// :screen-fps=24.000000 :input-slave=alsa://pulse :sout="#transcode{vcodec=mp2v,vb=10000,fps=24,width=1280,acodec=mp3,ab=192,channels=2,samplerate=44100} :http{dst=:8081/desk.ts}" :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


quote]



When I try to run the code for VLC I get the following errors:

y increased to 181 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 622 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 3627 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 6268 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 9732 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 12839 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 15973 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 16225 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called

Any ideas what I am doing wrong?

Re: streaming desk top to tv

PostPosted: Thu Jan 12, 2012 3:22 pm
by hiviking
Hi jhb50,
I have tried your method as described in the Wiki and it works, but the screen-capture-recorder is too slow, so I get jerky video. A more efficient screen capture driver is VHScrCap (which I have used for a long time to capture Google Earth animations with VirtualDub at 30 fps) but I cannot get it to work with VLC. It captures OK when you are in "Play" mode, but in "Stream" mode I just get a blank screen. The log contains a stream of errors like this:

avcodec warning: almost fed libavcodec with a frame in the past (current: 7477251179, last: 14886365001)
stream_out_transcode debug: drift is too high, resetting master sync

Any ideas anyone?

By the way, for most users it will be easier to use the VLC GUI to set up the stream instead of using the command line. There is a guide at http://betterlogic.com/roger/2010/07/ho ... playon-tv/ and another at http://grok.lsu.edu/article.aspx?articleid=14625 (fullscreen only).

Re: streaming desk top to tv

PostPosted: Thu Jan 12, 2012 3:55 pm
by zip
hiviking wrote:By the way, for most users it will be easier to use the VLC GUI to set up the stream instead of using the command line. There is a guide at http://betterlogic.com/roger/2010/07/ho ... playon-tv/ and another at http://grok.lsu.edu/article.aspx?articleid=14625 (fullscreen only).

Feel free to update the wiki with any tips.

Re: streaming desk top to tv

PostPosted: Thu Jan 12, 2012 3:59 pm
by jhb50
with a frame in the past ...drift is too high


Sounds to me like your pc is too slow. I think these messages indicate that the stream is not able to go out at real-time, whereas in play mode perhaps it can handle that. Just my guess.

for most users it will be easier to use the VLC GUI to set up the stream instead of using the command line


I don't know where you got the idea that a command line has to be typed in. I don't think going thru a multi-click/type gui that your guides describe is preferable to clicking on a "StreamDesktop.bat" icon that does it all.

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 10:16 am
by hiviking
zip wrote:Feel free to update the wiki with any tips.

I have entered my comments and experiences on the Discussion page at http://wiki.serviio.org/doku.php?id=talk:stream_pc. I have now managed to get a very good quality with smooth video, using the Screen Capture Recorder.

jhb50 wrote:I don't know where you got the idea that a command line has to be typed in. I don't think going thru a multi-click/type gui that your guides describe is preferable to clicking on a "StreamDesktop.bat" icon that does it all.

Of course you don't type it in. I have no problems using the command line as I have been a programmer since the late 1970s. In the old days that was all we had. But nowadays most users shy away from using the command line as they are used to a graphical interface. In this case, using the GUI has several advantages: (1) it is easier to see and understand what it is you are selecting, and (2) you can more easily make different choices. It is not very likely that anybody can use the command line the way it is written in the article. As an example, my Virtual Audio Cable interface looks different. That is easy to see in the GUI, but not so easy with the command line. In addition, as mentioned in my Wiki discussion entry, the command line is not working for me, but the GUI is.

When I use the VLC command line I get the image from my webcam displayed in VLC and nothing seems to be streamed. I have not researched this any further and I am not very familiar with VLC. Perhaps somebody who has more experience with the VLC command line interface can help?

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 10:53 am
by jk50
Linux streaming

When I try to run the code for VLC I get the following errors:

y increased to 181 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 622 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 3627 ms)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 6268 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 9732 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 12839 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 15973 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called
[0x815aa40] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (jitter of 16225 ms ignored)
[0x815aa40] main input error: ES_OUT_RESET_PCR called

Any ideas what I am doing wrong?

You may not be doing anything wrong. Google finds a lot of people with this problem, but sadly very little in the way of answers.
Some people say adding this "--clock-jitter=0" switch to the command line solves the problem, some say it doesn't help at all. If you
add this "-vvv" switch it turns on verbose logging , that might give you a clue as to what the problem is. Does it work in spite of the
errors,or crap out compleatly ? You need a fairly fast computer to capture and encode in real time. Check your cpu usage while vlc is
running , if it's high, yours may not be up to the task.
There are some things that can be done to lighten the load.One would be to lower the framerate, downside there is jerkier playback.
Another is to lower the output resolution,downside is fuzzier picture. Another is you don't have to capture the entire screen. For example
the command line below captures only a 1280x720 of my 1920x1080 screen. If you constrain your video to that portion of the screen,
it works reasonably well and cuts my cpu usage in half.

  Code:
vlc  screen:// :screen-fps=24 :screen-width=1280 :screen-height=720 :input-slave=alsa://pulse :sout="#transcode{vcodec=mp2v,vb=10000,fps=24,width=1280,acodec=mp3,ab=192,channels=2,samplerate=44100} :http{dst=:8081/desk.ts}" :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


On my computer ffmpeg captures and encodes with significantly lower cpu usage than vlc but I don't know how to send ffmpeg output to the network yet.
So here's some examples a bit of a kludge , pipe ffmpeg output through vlc. In the examples below change the 1920x1080 to the resolution of
your monitor or smaller if you only want a portion of your screen.


  Code:
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec mpeg2video -bf 2  -vb 6000k -g 15 -acodec libmp3lame -ar 44100 -ac 2  -f mpegts vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec mpeg4  -vb 6000k -acodec libmp3lame -ar 44100 -ac 2  -f mpegts - | vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 24 -s 1920x1080 -i :0.0 -r 24 -s 1280x720 -vcodec  libx264 -crf 4  -acodec libfaac -b 192k -ar 44100 -ac 2  -f mpegts  - | vlc - :sout=#http{dst=:8081/desk.ts} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep


Anybody know why my samsung D opens mpeg2 streams from vlc without a problem ,but doesn't open mpeg2 streams encoded with ffmpeg ?

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 2:44 pm
by jhb50
hiviking:That is easy to see in the GUI, but not so easy with the command line. In addition, as mentioned in my Wiki discussion entry, the command line is not working for me, but the GUI is.


I appreciate your response and your wiki entry. I fail to understand why you would recommend a 12 step GUI setup with complex changes for the users to go thru each time they want to stream the desktop rather than a one click on a script(bat) icon. That simply makes no sense. In addition your recommendation & choice of x264 as the codec will significantly increase the cpu load which most users have a problem with, that's why the bat uses MPEG2.

Your command line should work if you enclose your audio device name (which contains blanks) in quotes as per the wiki and the wiki bat, and once you change the bat you can run the bat with one click on a shortcut each time you want to stream without going thru all the gui steps you have documented or typing the whole command line each time.

Appreciate your entry in the wiki and how you shrunk the capture area to improve the performance. I've updated the wiki to reflect yoursand others comments including how to check the device names with the GUI and the need for quotes if the device name has spaces.

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 4:46 pm
by hiviking
jhb50,

I tried enclosing the device name in quotes, of course, but nothing happens, VLC just hangs. The same thing happens with your command line, replacing the audio device name. When I enclose all the options in quotes, as shown in my Discussion comments, VLC runs. It just shows the wrong video device (which has no spaces, by the way). So, the best reason to use the GUI, is the fact that it works. I would be the first to use a batch file with the command line if I could make it work. But I also think that new users will benefit from using the GUI to understand what the command line items actually are and to make their own choices where appropriate. Once they find the best settings they can make a command file (if they can make it work). That makes a lot of sense to me. In any case, we write these entries to help each other and now we have described both methods, so that can only be seen as a positive.

I tried the MPEG2 codec, but the quality was poor. I actually get a much better quality with H264 and a reduced size of the video. My goal was to find the best quality that my CPU can handle, providing smooth video. This is another area where the user might want to make other choices, and the GUI makes it easy to experiment. I am not sure that my current choices are the optimal ones for my computer, but I am actually quite impressed with the quality I am getting.

If I solve the command line problem I will let you all know. Any ideas are welcome.

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 5:26 pm
by Cerberus
hiviking wrote:jhb50,

I tried enclosing the device name in quotes, of course, but nothing happens, VLC just hangs. The same thing happens with your command line, replacing the audio device name. When I enclose all the options in quotes, as shown in my Discussion comments, VLC runs. It just shows the wrong video device (which has no spaces, by the way). So, the best reason to use the GUI, is the fact that it works. I would be the first to use a batch file with the command line if I could make it work. But I also think that new users will benefit from using the GUI to understand what the command line items actually are and to make their own choices where appropriate. Once they find the best settings they can make a command file (if they can make it work). That makes a lot of sense to me. In any case, we write these entries to help each other and now we have described both methods, so that can only be seen as a positive.

I tried the MPEG2 codec, but the quality was poor. I actually get a much better quality with H264 and a reduced size of the video. My goal was to find the best quality that my CPU can handle, providing smooth video. This is another area where the user might want to make other choices, and the GUI makes it easy to experiment. I am not sure that my current choices are the optimal ones for my computer, but I am actually quite impressed with the quality I am getting.

If I solve the command line problem I will let you all know. Any ideas are welcome.


personaly im with Jhb50 you way is far to complicated, plus id rather conversations went on in the forum than have multiple version of the same thing on the wiki.

Re: streaming desk top to tv

PostPosted: Fri Jan 13, 2012 11:32 pm
by jhb50
hiviking:

I understand your post and I'd only reassert that the purpose of the predefined working process in the wiki is to make it extremely easy (one click) for everyone to stream their desktop to Serviio on demand and to avoid the need, as you are doing and suggest others do, to learn VLC setup, and invent their own process, and then getting in trouble and then looking for support on how to make it work.

So we are at the point that there is not much we can do to help you. Your command line is so totally different from that in the wiki that it would be a disservice to suggest that the command line in the wiki bat does not work.

I will only say that others are using "Virtual Cable 1" succesfully with the wiki command and that your other parameter changes are the source of your VLC hang.

I'd also suggest that quality has nothing to do with the video codec. Both h264 and mpeg2 produce the same quality, just at different bitrates. Since bitrate is not a constraint here, using h264 at twice the cpu makes no sense when the cycles can be better used to increase your capture area and get as close to full 1280x720 resolution as possible. That's why the wiki uses MPEG-2 at 10mbps, and why we consider your recommendations to be suboptimal.

I think you will find that if you follow the wiki (which is being improved all the time) it will work fine. If it does not your feedback will help to improve a single easy to use solution that can be supported for you and everyone else.

On a personal note, I'd be interested to know how long you tolerate using the GUI each time you want to stream the desktop. My own experience in another environment was that I gave up trying to start the stream with the GUI until I could get the bat to work, and that's why I developed and recommend the bat solution here in lieu of using the GUI.

Re: streaming desk top to tv

PostPosted: Sat Jan 14, 2012 5:26 pm
by hiviking
Hi Cerberus and jbh50,

I cannot seem to get through to you guys on the fact that the command line in the article doesn't work for me. And I believe it is very likely that it won't work for lots of other users as well. Your goal of making it easy for the users is a good one, but what if it doesn't work? Most users will not know how to modify the command line, but they can operate the GUI. Although there are many steps the first time you set it up, it is quite easy to do. My goal was to make that process even easier and to give users a way to try out various options. Once you have it working you should be able to produce a batch file from the command line options indicated in the GUI, although this does not seem to be straightforward. By combining the command line in the article with the options displayed by the GUI, I have managed to get it working now, and I have updated my Wiki discussion entry (I put it there, as zip wrote "Feel free to update the wiki with any tips").

You have a point with regard to the bitrate. At the same bitrate MPEG2 is nowhere near the quality of H264, but if you compare at a 10-fold difference in bitrate the quality difference will obviously be much smaller. I initially kept the bitrate low at 600 kbps for the H264 video, as I figured it would reduce my CPU load, and 600 kbps H264 is as good or better than 10000 kbps MPEG2! As it turns out the bitrate hasn't very much influence on the CPU load. I made a test today with the tiny video at http://www.ehf-euro.com, enlarged by 207% in Google Chrome. I ran it with 1000 kbps H264 and 10000 kbps MPEG2. The H264 provided a sharper picture, but the MPEG2 is definitely acceptable. It does take some processing, however, and my CPU load was 90-95% for the H264, but only 60-65% for the MPEG2.

The key to avoiding jerky video has been to reduce the size of the desktop area to be streamed. I rarely look at videos on the web that are as large as 1280x720, so 640x360 is a good size for me. If you do need the large size I guess the advice should be: Check out what your computer can handle. If it can handle H264 at your required frame rate, then it will give you the best quality. If your computer cannot handle it, or if you want to have some spare CPU capacity for doing something else you should use MPEG2.

Re: streaming desk top to tv

PostPosted: Sat Jan 14, 2012 5:59 pm
by Cerberus
hiviking wrote:Hi Cerberus and jbh50,

I cannot seem to get through to you guys on the fact that the command line in the article doesn't work for me. And I believe it is very likely that it won't work for lots of other users as well. Your goal of making it easy for the users is a good one, but what if it doesn't work? Most users will not know how to modify the command line, but they can operate the GUI. Although there are many steps the first time you set it up, it is quite easy to do. My goal was to make that process even easier and to give users a way to try out various options. Once you have it working you should be able to produce a batch file from the command line options indicated in the GUI, although this does not seem to be straightforward. By combining the command line in the article with the options displayed by the GUI, I have managed to get it working now, and I have updated my Wiki discussion entry (I put it there, as zip wrote "Feel free to update the wiki with any tips").


yes TIPS not try and rewrite the whole wiki that one of our VIP member took along time making and testing with our beta test team, and starting your post liek that will simple get your post on wiki removed and no support will be given to you as you clearly have no manner, so either keep your post polite or find some were else.