VLC command line: how to generate dynamic filenames

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.
Blutarsky
New Cone
New Cone
Posts: 5
Joined: 17 Sep 2013 12:19

VLC command line: how to generate dynamic filenames

Postby Blutarsky » 17 Sep 2013 12:36

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

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: VLC command line: how to generate dynamic filenames

Postby Jean-Baptiste Kempf » 17 Sep 2013 14:26

no.
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.

Blutarsky
New Cone
New Cone
Posts: 5
Joined: 17 Sep 2013 12:19

Re: VLC command line: how to generate dynamic filenames

Postby Blutarsky » 17 Sep 2013 14:37

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

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: VLC command line: how to generate dynamic filenames

Postby Jean-Baptiste Kempf » 17 Sep 2013 14:45

That is for recording, not transcoding or dunmping
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.

Blutarsky
New Cone
New Cone
Posts: 5
Joined: 17 Sep 2013 12:19

Re: VLC command line: how to generate dynamic filenames

Postby Blutarsky » 17 Sep 2013 15:42

Yes I need recording options.... I need to record an audio stream. Am I using the wrong syntax?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC command line: how to generate dynamic filenames

Postby mederi » 17 Sep 2013 20:24

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"}

Blutarsky
New Cone
New Cone
Posts: 5
Joined: 17 Sep 2013 12:19

Re: VLC command line: how to generate dynamic filenames

Postby Blutarsky » 18 Sep 2013 11:27

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...

Blutarsky
New Cone
New Cone
Posts: 5
Joined: 17 Sep 2013 12:19

Re: VLC command line: how to generate dynamic filenames

Postby Blutarsky » 18 Sep 2013 11:44

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! :D

JNavas
Blank Cone
Blank Cone
Posts: 20
Joined: 16 Nov 2013 23:11
Location: San Francisco Bay Area

Re: VLC command line: how to generate dynamic filenames

Postby JNavas » 16 Nov 2013 23:34

[deleted]
Last edited by JNavas on 17 Nov 2013 21:23, edited 1 time in total.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: VLC command line: how to generate dynamic filenames

Postby mederi » 17 Nov 2013 21:17

In VLC-2.1 and newer use also "--sout-file-format" CLI option.

rsisson
Blank Cone
Blank Cone
Posts: 12
Joined: 16 Jul 2014 02:16

Re: VLC command line: how to generate dynamic filenames

Postby rsisson » 16 Jul 2014 14:23

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.

man2002ua
New Cone
New Cone
Posts: 3
Joined: 09 Jul 2014 20:20

Re: VLC command line: how to generate dynamic filenames

Postby man2002ua » 19 Jul 2014 12:28

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!

JNavas
Blank Cone
Blank Cone
Posts: 20
Joined: 16 Nov 2013 23:11
Location: San Francisco Bay Area

Re: VLC command line: how to generate dynamic filenames

Postby JNavas » 19 Jul 2014 20:13

I am using VLC 2.1.3 and none of above work!
It does work in 2.1.3 -- follow the recipe exactly.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 47 guests