Page 1 of 1
VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 12:36
by Blutarsky
While I could accomplish generating dynamic filenames for a command line script, using date:
Code: Select all
set day=%Date:~0,2%
set month=%Date:~3,2%
set year=%Date:~6,4%
set D=%year%-%month%-%day%
vlc http://62.196.56.141:8080 --sout=#std{access=file,mux=raw,dst="C:\temp\streaming\%D%-RSMorn.mp3"}
I was wondering if VLC itself can use VLC specific variables in the filename, WITHOUT using CMD/Environment variables
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 14:26
by Jean-Baptiste Kempf
no.
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 14:37
by Blutarsky
no.
I was asking because of this article, however I couldn't sort it out to make it work...
The record parameters above assume the stream is in the most universal MP3 format. Where a source has multiple stream formats available, choose MP3 to avoid problems; to try recording some other format, use the appropriate file extension (instead of .mp3). You can of course change the file name from Recording to whatever you might prefer. To create unique file names with date and time, see Play HowTo/Format String; e.g., Recording_%Y%m%d_%H%M
http://tips.navas.us/2013/02/record-internet-radio.html
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 14:45
by Jean-Baptiste Kempf
That is for recording, not transcoding or dunmping
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 15:42
by Blutarsky
Yes I need recording options.... I need to record an audio stream. Am I using the wrong syntax?
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Sep 2013 20:24
by mederi
You need to use "%%" within batch file:
Code: Select all
vlc http://62.196.56.141:8080 --sout=#std{access=file,mux=raw,dst="C:\temp\streaming\%%Y-%%m-%%d %%Hh%%Mm%%Ss RSMorn.mp3"}
Re: VLC command line: how to generate dynamic filenames
Posted: 18 Sep 2013 11:27
by Blutarsky
You need to use "%%" within batch file:
Code: Select all
vlc http://62.196.56.141:8080 --sout=#std{access=file,mux=raw,dst="C:\temp\streaming\%%Y-%%m-%%d %%Hh%%Mm%%Ss RSMorn.mp3"}
It is not a batch file, the command is being run from Windows Task Scheduler...
However your suggested syntax won't work from command line either...
Re: VLC command line: how to generate dynamic filenames
Posted: 18 Sep 2013 11:44
by Blutarsky
Now it works!!!! Yes!!!! Correct syntax is:
Code: Select all
"C:\Program Files\VideoLAN\VLC\vlc.exe" http://62.196.56.141:8080 --sout=#std{access=file,mux=raw,dst="C:\temp\streaming\%Y-%m-%d-RSMorning.mp3"}
[/size]
Hooray!! Thanks!
Re: VLC command line: how to generate dynamic filenames
Posted: 16 Nov 2013 23:34
by JNavas
[deleted]
Re: VLC command line: how to generate dynamic filenames
Posted: 17 Nov 2013 21:17
by mederi
In VLC-2.1 and newer use also "--sout-file-format" CLI option.
Re: VLC command line: how to generate dynamic filenames
Posted: 16 Jul 2014 14:23
by rsisson
For me the final format was:
vlc rtsp://192.168.1.128:554/12 --sout=file,dst="C:\temp\%y-%m-%d-%Hh -%Mm DrivewayClip.mpg"
and that created a file name of "2014-07-16-08h-20m DrivewayClip"
I am not worried about seconds as each of my video clips is at least 1 min long and has the time/date in the stream.
Re: VLC command line: how to generate dynamic filenames
Posted: 19 Jul 2014 12:28
by man2002ua
For me the final format was:
vlc rtsp://192.168.1.128:554/12 --sout=file,dst="C:\temp\%y-%m-%d-%Hh -%Mm DrivewayClip.mpg"
and that created a file name of "2014-07-16-08h-20m DrivewayClip"
I am not worried about seconds as each of my video clips is at least 1 min long and has the time/date in the stream.
I am using VLC 2.1.3 and none of above work!
Re: VLC command line: how to generate dynamic filenames
Posted: 19 Jul 2014 20:13
by JNavas
I am using VLC 2.1.3 and none of above work!
It
does work in 2.1.3 -- follow the recipe exactly.