Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Audio stream recording
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 12-17-2011, 12:53 PM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Question

[SOLVED]How to download files with timestamp in filename (Windows).


Hi
With Linux I can use a command like this:-
Code:
NOW=$(date +"%Y-%m-%d-%H-%M"); vlc --run-time=30 http://stream-sd.radioparadise.com:9000/rp_192.ogg --sout "#std{access=file,mux=ogg,dst=$NOW-RadioParadise.ogg}" vlc://quit
It gives me a downloaded file with this filename format:- 2011-12-17-18-36-RadioParadise.ogg

What is the syntax when using Windows from cmd or with a bat script to give the file a name with the timestamp in the filename?

Last edited by bat999 : 12-17-2011 at 08:43 PM.
Reply With Quote
  #2  
Old 12-17-2011, 01:13 PM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: How to download files with timestamp in filename (Windows).


http://stream-recorder.com/forum/ren...and-t9041.html
Reply With Quote
  #3  
Old 12-17-2011, 03:16 PM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

Re: How to download files with timestamp in filename (Windows).


This command:-
Code:
for /f "tokens=1-6 delims=/:." %a in ("%date%.%time%") do set FileName="%c-%b-%a-%d-%e-RadioParadise.ogg" && "C:\Program Files\VideoLAN\VLC\vlc.exe" --run-time=30 http://stream-sd.radioparadise.com:9000/rp_192.ogg --sout "#std{access=file,mux=ogg,dst=%FileName%}"
Gives a filename like this:- 2011-12-17-21-02-RadioParadise.ogg
Reply With Quote
  #4  
Old 12-18-2011, 07:55 PM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

Re: [NOT SOLVED]How to download files with timestamp in filename (Windows).


Hi
I think there's a problem when using this method with Windows.
When the hour is a single digit (1am) it is trying to create a filename with a space in it.
Like this:-
2011-12-19- 1-45-RadioParadise.ogg

Maybe something is needed to pad the hour out to 2 digits ("01" instead of " 1").

Perhaps this applies to month and date too.

(With the Linux command it seems to pad out the hour to 2 digits automatically).
Reply With Quote
  #5  
Old 12-18-2011, 10:25 PM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: [SOLVED]How to download files with timestamp in filename (Windows).


actually it's little dependent on your system's time display settings. for example the command
Code:
echo %date%.%time%
outputs
Code:
Mon 19/12/2011. 9:43:13.76
on my system. so i need to work with this string.

the following adjusted command outputs the filename from the above data in the format you want.
Code:
for /f "tokens=2-7 delims=/:., " %a in ("%date%.%time%") do set FileName="MyShow_%a-%b-%c_%d-%e-%f.flv"
Code:
set FileName="MyShow_19-12-2011_9-53-15.flv"
Reply With Quote
  #6  
Old 12-18-2011, 11:07 PM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

Re: [SOLVED]How to download files with timestamp in filename (Windows).


It gives a different result on this Windows XP box.

Code:
echo %date%.%time%
19/12/2011. 5:01:32.84
Code:
set FileName="MyShow_12-2011-5_02-13-46.flv"
The day (19th) is missing.
I would like a solution that is OK for all Windows systems, whatever the settings.
Reply With Quote
  #7  
Old 12-19-2011, 02:04 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: [SOLVED]How to download files with timestamp in filename (Windows).


i have written a little app in c (just 3 lines of code) which will output the current time in fixed format making it easy to parse.
Code:
for /f "tokens=1-7 delims=: " %a in ('timestamp.exe') do set FileName="MyShow_%g-%b-%c_%d-%e-%f.flv"
Code:
set FileName="MyShow_2011-Dec-19_13-29-40.flv"
Code:
http://www.mediafire.com/file/89a7ymiu3s3bsid/timestamp.exe
Reply With Quote
  #8  
Old 12-19-2011, 03:55 AM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

Re: [SOLVED]How to download files with timestamp in filename (Windows).


Yes, timestamp.exe gives an output:-
Code:
C:\Documents and Settings\Administrator\Desktop>timestamp
Mon Dec 19 09:53:15 2011
Reply With Quote
Reply Post New Thread
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 05:51 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons