Create VLC Batch File

About encoding, codec settings, muxers and filter usage
weekendwarrior
New Cone
New Cone
Posts: 7
Joined: 15 Nov 2010 00:49

Create VLC Batch File

Postby weekendwarrior » 15 Nov 2010 12:58

Hey fellas...
I'd like to create a batch file that does the following:

Opens source dshow:// (input from a video capture card)
Then runs this output: :sout=#transcode-{vcodec=h264,vb=0,scale=0,acodec=none}:duplicate{dst=rtp{sdp=rstp://:5544/video.mpg},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

Can anyone assist with making a batch file that launches VLC and does this automatically?

Thanks again for such a great resource.

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 16 Nov 2010 01:57

You will need to be able to enter the desired outcome from command line to do this. There many wiki entries on the subject, search them out.
For a quick shortcut example to convert your GUI input into a command line see..
http://wiki.videolan.org/Stream_VLC_to_ ... h#Appendix

Prove out your command line from the command prompt.

Re edit to create a batch file.

You need to cd and add a path in a text editor, if run from somewhere like Desktop...

<cd C:\Program Files\VideoLAN\VLC\>

Then enter the command line string as per the wiki example adapted for own circumstances

Also usefull to add <PAUSE> at the end to keep the command prompt window open while you test it out to see any errors that may occur while you test... Saved it as a . bat file

weekendwarrior
New Cone
New Cone
Posts: 7
Joined: 15 Nov 2010 00:49

Re: Create VLC Batch File

Postby weekendwarrior » 17 Nov 2010 09:15

Thanks for that...Here is what I have so far using what I believe to be windows syntax, however it does not complete the process. Am I missing some quotes or something somewhere? VLC launches, and says dshow:// on the bottom, but it is not streaming. Usually when edit via GUI it says "Streaming"

#Begin batch file
cd c:\program files\videolan\vlc
vlc dshow:// --sout=#transcode{vocdec="h264",vb="0",scale="0",acodec="none"}:rtp{sdp="rtsp://:5544/video.mpg"} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

Thanks again

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: Create VLC Batch File

Postby rogerdpack » 17 Nov 2010 12:55

any error messages?
on the commandline maybe you need to specify dshow devices (see http://wiki.videolan.org/Stream_VLC_to_ ... h#Appendix --appendix)

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 17 Nov 2010 12:58

Re read the Appendix

The input (or capture) from the GUI textbox
"The first part, up to ”sout” is the input string. The vdev= and adev= are the (your) input devices and can be viewed and extracted from the first “streaming” window or tab in the GUI, with the “show more options” box checked."
You need to copy the complete input string, not just dshow... , that is in the Next field. Check out the example.
To "Export"
"The complete input and output sections can be simply copied and pasted from the GUI into a text editor and built into a complete string to create full working command line. "

weekendwarrior
New Cone
New Cone
Posts: 7
Joined: 15 Nov 2010 00:49

Re: Create VLC Batch File

Postby weekendwarrior » 17 Nov 2010 13:40

Yes, I have tried with using the string from the options window such as:

vlc :dshow-vdev=VCE-PRO Capture :dshow-adev=none :dshow-caching=200 --sout=#transcode{vocdec="h264",vb="0",scale="0",acodec="none"}:rtp{sdp="rtsp://:5544/video.mpg"} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

Now I get errors in VLC when it launches that says VLC could not open the file "C:Program Files\VideoLAN\VLC\Capture". and VLC is unable to pen the MRL 'file:///C:Program%20Files/videoLAN/VLC%2FCapture'.

Thanks again

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: Create VLC Batch File

Postby rogerdpack » 17 Nov 2010 13:54

you'll need to add some quotes in there (guess the wiki needs some updating)

vlc :dshow-vdev="VCE-PRO Capture" etc.
Last edited by rogerdpack on 17 Nov 2010 14:13, edited 1 time in total.

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 17 Nov 2010 13:58

I take it that you have proved the command line out as a stand alone instruction from command prompt?
If that is working, then your batch file was written incorrectly, looks like you have the path rolled up into the input string.

try..
Path <cr>
instructions<cr>
PAUSE

Like

cd C:\Program Files\VideoLAN\VLC\
vlc :dshow-vdev=VCE-PRO Capture :dshow-adev=none :dshow-caching=200 --sout=#transcode{vocdec="h264",vb="0",scale="0",acodec="none"}:rtp{sdp="rtsp://:5544/video.mpg"} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
PAUSE

weekendwarrior
New Cone
New Cone
Posts: 7
Joined: 15 Nov 2010 00:49

Re: Create VLC Batch File

Postby weekendwarrior » 17 Nov 2010 14:35

cd C:\Program Files\VideoLAN\VLC\
vlc :dshow-vdev="VCE-PRO Capture" :dshow-adev="none" :dshow-caching="200" --sout=#transcode{vocdec="h264",vb="0",scale="0",acodec="none"}:rtp{sdp="rtsp://:5544/video.mpg"} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
PAUSE

Just opens VLC and nothing happens. I've tried <CR>s and then the batch file doesn't recognize the next line.

rogerdpack
Big Cone-huna
Big Cone-huna
Posts: 574
Joined: 19 Jul 2008 23:48
Operating System: windows

Re: Create VLC Batch File

Postby rogerdpack » 17 Nov 2010 14:38

nothing shows in the playlist?
missing dshow:// ?

weekendwarrior
New Cone
New Cone
Posts: 7
Joined: 15 Nov 2010 00:49

Re: Create VLC Batch File

Postby weekendwarrior » 17 Nov 2010 17:05

I'm up and running...you guys are awesome thank you. The quotes in various places were the culprit. Thanks again.

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 30 Nov 2010 08:36

Hello, I am new to this forum and it would apear I'm not in the same technical league as most of you. I am trying to create a batch file so I can simply click on an icon on my XP desktop to open my STK1160 usb video capture device with VLC. I don't want to record video, I simply want to view the output of the device on my PC screen.
720x576; PAL; 16:9; Direct Show;
I've been to Wiki but it is way over my head so unless someone can help me, I'll have to abandon VLC and try something else.

cd C:\Program Files\VideoLAN\VLC\
vlc :dshow-vdev="VCE-PRO Capture" :dshow-adev="Syntek STK1160" :dshow-caching="200" --sout=#transcode{vocdec="h264",vb="0",scale="0",acodec="none"}:rtp{sdp="rtsp://:5544/video.mpg"} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
PAUSE

As you see, I have tried adapting the batch file someone else created in this thread but although VLC opens, nothing else happens.
Thanks

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 30 Nov 2010 12:48

The input section look ok. You appear to have problems with too many quotes in your --sout section "xxxx " You only need quotes around --sout="#transcode..........mpg}" . remove the ones in between. Take a look at the guidance and example in the wiki appendix again.
You'r nearly there....!

Edit.
If you just want to Play your Input, then you don't need the sout="........" section , so just remove it alltogether.

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 30 Nov 2010 16:11

I think I am begining to understand this now. How does this look? It still loads VLC then nothing more. No error.
cd C:\Program Files\VideoLAN\VLC\
vlc :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576":dshow-caching="200" :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576" :dshow-aspect-ratio="16\:9" :dshow-chroma= :dshow-fps="25" :no-dshow-config :no-dshow-tuner :dshow-tuner-channel="0" :dshow-tuner-country="0" :dshow-tuner-input="0" :dshow-video-input="-1" :dshow-video-output="-1" :dshow-audio-input="-1" :dshow-audio-output="-1" :dshow-amtuner-mode="1" :dshow-audio-channels="0" :dshow-audio-samplerate="0" :dshow-audio-bitspersample="0" :dshow-caching="200"

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 30 Nov 2010 23:00

Goodness...!!!
You seem to have clicked on the Advanced Settings and got the whole default generated input string....!
Perhaps, just not do that for the moment. Lets keep it simple and just look at your input devices without all the other settings.
So,
your adev=SB X-Fi Audio [DF00]
your vdev=Syntek STK1160

without clicking the Advanced Settings....Yes? this is correct? Please confirm if in doubt?

So a simple command line to make this (your capture input devices) play, and a batch file should look like this

cd C:\Program Files\VideoLAN\VLC\
vlc dshow:// :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576"
PAUSE

At first glance your string was missing the // after dshow: at the beginning

If this does not work, then place -vvv at the beginning of the string like this

vlc -vvv dshow:// :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576"

and open your Messages box to find out what errors occured

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 01 Dec 2010 19:29

Hello Greg
It worked fine thanks, apart from the aspect ratio, so I added the required code as so:
cd C:\Program Files\VideoLAN\VLC\
vlc -vvv dshow:// :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576" :dshow-aspect-ratio="16\:9"
PAUSE

Now it works perfectly.
Thanks for your help.

Derek

Goodness...!!!
You seem to have clicked on the Advanced Settings and got the whole default generated input string....!
Perhaps, just not do that for the moment. Lets keep it simple and just look at your input devices without all the other settings.
So,
your adev=SB X-Fi Audio [DF00]
your vdev=Syntek STK1160

without clicking the Advanced Settings....Yes? this is correct? Please confirm if in doubt?

So a simple command line to make this (your capture input devices) play, and a batch file should look like this

cd C:\Program Files\VideoLAN\VLC\
vlc dshow:// :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576"
PAUSE

At first glance your string was missing the // after dshow: at the beginning

If this does not work, then place -vvv at the beginning of the string like this

vlc -vvv dshow:// :dshow-vdev="Syntek STK1160" :dshow-adev="SB X-Fi Audio [DF00]" :dshow-size="720x576"

and open your Messages box to find out what errors occured

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 01 Dec 2010 19:48

Simples :)

You might went to delete the -vvv and PAUSE now it's all working OK

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 12 Dec 2010 08:21

Is it posible to load the following with VLC: rtsp://npslivewm.fplive.net/npslive-live/Yellowstone
I've tried manualy but get no video and interupted audio.
If it can be got working, I would like to load with a batch file from my desktop.
Thanks
Derek
PS: If you try this link, please bear in mind the cam is located in Wyoming USA so the time is GMT -7 hours and it will be black until sunrise.

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 12 Dec 2010 17:22

Try
mms://npslivewm.fplive.net/npslive-live/Yellowstone?MSWMExt=.asf

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 12 Dec 2010 17:42

Try
mms://npslivewm.fplive.net/npslive-live/Yellowstone?MSWMExt=.asf
Thanks Greg, it now opens with Windows Media Player, but is it posible to open with VLC?

Derek

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 12 Dec 2010 18:25

Open Network Stream.......

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 12 Dec 2010 18:35

Open Network Stream.......
Thanks Greg, I was doing that but didn't realise it would take a few seconds to start running.
Now finally, can I start it with a batch file?

Derek

Greg
Cone that earned his stripes
Cone that earned his stripes
Posts: 316
Joined: 24 Feb 2009 00:37

Re: Create VLC Batch File

Postby Greg » 12 Dec 2010 19:13

yes, just like you did before
cd c:\program files\videolan\vlc
vlc mms://..... etc

man-of-kent
New Cone
New Cone
Posts: 8
Joined: 29 Nov 2010 22:49

Re: Create VLC Batch File

Postby man-of-kent » 12 Dec 2010 22:09

Thanks Greg
All running fine now.

Derek

gbrown
New Cone
New Cone
Posts: 5
Joined: 16 Mar 2011 17:38

Re: Create VLC Batch File

Postby gbrown » 17 Mar 2011 17:53

Hey, any chance one of you knows how to make a simple command to set the audio output in VLC when launching? I've searched and searched and can find tons of commands for video, but none for audio. What am I missing?

I need to open VLC, with DirectX selected as the output module, and specify a certain sound driver (I'm using a virtual sound card).

Is it: --aout ? Then what do I put?\

Thanks in advance . . . I'm pulling my hair out over here.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 24 guests