Launch VLC as a background recorder and streamer

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
egrillo
New Cone
New Cone
Posts: 5
Joined: 09 Feb 2011 13:05

Launch VLC as a background recorder and streamer

Postby egrillo » 09 Feb 2011 14:22

We are using VLC as a streamer+recorder of a videocamera input.

We run VLC on a Windows XP machine with an Osprey 100 acquisition board.

The VLC process is started from an Apache2 php page using the exec() call. Currently we are been successful in lounching VLC with the command:

start C:/Programmi/VideoLan/VLC/vlcs.exe dshow:// :dshow-vdev="Osprey-100 Video Device 1" :dshow-adev="Realtek HD Audio Input" --sout-x264-keyint=100 --sout-x264-min-keyint=50 :sout=#transcode{deinterlace,vcodec=h264,vb=0,scale=0,width=576,height=432, acodec=mp4a,ab=96,channels=1,samplerate=44100}:duplicate{dst=file{dst=d:/vieweb/sedute/1292247850_1292247850.mp4},
dst=http{dst=:8080/stream.flv}} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

When we want to stop encoding/streaming, another php page with another exec() call launches the command:

taskkill /f /im vlc.exe

This works perfectly but lounches a visible VLC interface that we want to hide. We have tried to add to the vlc start command the options --qt-start-minimized or -I dummy but both of them requires a taskkill /f to stop vlc and this does not properly close the mp4 recording.

Any hint on how to start a background directshow recording and properly stop it?
Thano you for any help,
Enrico

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Launch VLC as a background recorder and streamer

Postby Jean-Baptiste Kempf » 11 Feb 2011 17:40

Use -Idummy
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

egrillo
New Cone
New Cone
Posts: 5
Joined: 09 Feb 2011 13:05

Re: Launch VLC as a background recorder and streamer

Postby egrillo » 23 Feb 2011 18:18

Thank you Jean-Baptiste.
I had already tried the Idummy solution with no success, after spending some more time investigating all the alternatives, I have found what seems to be a working solution.

Let me briefly describe my applcation:

I need to start VLC as a background application with null or minimum interference with the machine desktop.

IOur current solution is to start VLC with its standard GUI with the command:

start /min "VLCStreamer" c:\"Program Files"\VideoLAN\vlc\vlc -vvv dshow:// :dshow-vdev="Sony Visual Communication Camera VGP-VCC7" :sout=#transcode{fps=10,vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=VlcStream.mp4},dst=http{dst=:8080/stream.flv}} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

It streams ok and writes an mp4 video recoding.
When I want to stop streaming and recording, I use the command:

taskkill /T /IM vlc.exe

This command send a sigterm signal to VLC and it terminates properly closing the mp4 file that will then be playable.
The inconvenience of this solution is that VLC opens its GUI on top of the desktop and we have to manually iconize it.

If we start VLC iconized, using the command:

start /min "VLCStreamer" c:\"Program Files"\VideoLAN\vlc\vlc -vvv --qt-start-minimized dshow:// :dshow-vdev="Sony Visual Communication Camera VGP-VCC7" :sout=#transcode{fps=10,vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=VlcStream.mp4},dst=http{dst=:8080/stream.flv}} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

VLC starts minimized and streams OK but to close streaming and recoding I cannot anymore use "taskkill /T" but I have to use "taskkill /F" and this forces VLC to quit but it does not proerly closes the mp4 recoding that will be unusable.

Same behaviour using -Idummy with the command:

start /min "VLCStreamer" c:\"Program Files"\VideoLAN\vlc\vlc -vvv -Idummy dshow:// :dshow-vdev="Sony Visual Communication Camera VGP-VCC7" :sout=#transcode{fps=10,vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=VlcStream.mp4},dst=http{dst=:8080/stream.flv}} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

We have found an elegant solution starting vlc with the following command:

start /min "VLCStreamer" c:\"Program Files"\VideoLAN\vlc\vlc -vvv -Ihttp dshow:// :dshow-vdev="Sony Visual Communication Camera VGP-VCC7" :sout=#transcode{fps=10,vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=VlcStream.mp4},dst=http{dst=:8080/stream.flv}} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep vlc://quit

To stop streaming and properly close VLC and the mp4 file we do a command:

wget "http://localhost:8080/requests/status.x ... nd=pl_next"

This solution fits very well our background operation mode requirement but unfortunatelly it does not allow viewing error and debug messages shown in the message window or on the dummy dos shell. Any way to have messages recorded to a file?
Thank you for any help.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 12 guests