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 > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 05-07-2011, 01:45 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


This is very simple in any scripting language. if you are using simple batch file in Windows then use:
Code:
for /f "tokens=1-6 delims=/:." %%a in ("%date%.%time%") do set FileName="MyShow - %%a-%%b-%%c - %%d-%%e-%%f.flv"
rtmpdump.exe -r "rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34" -p "http://www.seeon.tv/view/11073" -W "http://www.seeon.tv/jwplayer/player.swf" --stop 3600 --live -o %FileName%
Reply With Quote
  #2  
Old 05-07-2011, 06:28 AM
Stream Recorder
 
Posts: n/a
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by KSV View Post
Code:
for /f "tokens=1-6 delims=/:." %%a in ("%date%.%time%") do set FileName="MyShow - %%a-%%b-%%c - %%d-%%e-%%f.flv"
Thank you for a great tip!!!

Could you please explain how it works? Specifically:
1. Where do the variables %%b, %%c, %%d, %%e, %%f come from?
2. What is "tokens=1-6 delims=/:."?
Reply With Quote
  #3  
Old 05-07-2011, 07:02 AM
chap chap is offline
Senior Member
 
Join Date: Feb 2011
Location: Ukraine
Posts: 1,165
chap is on a distinguished road
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by KSV View Post
This is very simple in any scripting language. if you are using simple batch file then use:
Code:
for /f "tokens=1-6 delims=/:." %%a in ("%date%.%time%") do set FileName="MyShow - %%a-%%b-%%c - %%d-%%e-%%f.flv"
rtmpdump.exe -r "rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34" -p "http://www.seeon.tv/view/11073" -W "http://www.seeon.tv/jwplayer/player.swf" --stop 3600 --live -o %FileName%
It works. You know a lot. Respect!
Code:
C:\Documents and Settings\Администратор\Мои документы\rtmpdump-2.3>for /F "token
s=1-6 delims=/:." %a in ("07.05.2011.14:54:23,64") do set FileName="MyShow - %a-
%b-%c - %d-%e-%f.flv"

C:\Documents and Settings\Администратор\Мои документы\rtmpdump-2.3>set FileName=
"MyShow - 07-05-2011 - 14-54-23,64.flv"

C:\Documents and Settings\Администратор\Мои документы\rtmpdump-2.3>rtmpdump.exe
-r "rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34" -p "http://www.seeon.tv/view/110
73" -W "http://www.seeon.tv/jwplayer/player.swf" --stop 3600 --live -o "MyShow -
 07-05-2011 - 14-54-23,64.flv"
RTMPDump v2.3 r568 (Compiled by KSV)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting Live Stream
For duration: 3600.000 sec
INFO: Metadata:
INFO:   author
INFO:   copyright
INFO:   description
INFO:   keywords
INFO:   rating
INFO:   title
INFO:   presetname            Custom
INFO:   creationdate          Wed Apr 13 18:22:26 2011
INFO:   videodevice           MagicCamera Capture(User Mode)
INFO:   framerate             25.00
INFO:   width                 320.00
INFO:   height                240.00
INFO:   videocodecid          avc1
INFO:   videodatarate         400.00
INFO:   avclevel              31.00
INFO:   avcprofile            66.00
INFO:   videokeyframe_frequency5.00
INFO:   audiodevice           Digital Audio Interface (WinTV
INFO:   audiosamplerate       22050.00
INFO:   audiochannels         2.00
INFO:   audioinputvolume      75.00
INFO:   audiocodecid          .mp3
INFO:   audiodatarate         56.00
2049.631 kB / 36.43 sec
Reply With Quote
  #4  
Old 05-07-2011, 08:07 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by Stream Recorder View Post
Could you please explain how it works? Specifically:
1. Where do the variables %%b, %%c, %%d, %%e, %%f come from?
2. What is "tokens=1-6 delims=/:."?
token 1-6 specifies that we want to divide the input string ("%date%.%time%") in maximum 6 parts starting from %a. delims specifies the delimiters that will be used to break the string.

PS: when using outside the batch file use single % eg: %a instead of %%a
Reply With Quote
  #5  
Old 05-07-2011, 09:09 AM
primtim34 primtim34 is offline
Junior Member
 
Join Date: Mar 2011
Posts: 18
primtim34 is on a distinguished road
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Any chance I could get you to write that same script but for a linux machine instead of a windows one? Thanks.
Reply With Quote
  #6  
Old 05-07-2011, 09:53 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by primtim34 View Post
Any chance I could get you to write that same script but for a linux machine instead of a windows one? Thanks.
The following script should do the trick
Code:
#! /bin/bash
FileName=`date +"MyShow - %0d-%0m-%0y - %0k-%0M-%0S.flv"`
rtmpdump.exe -r rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34 -p http://www.seeon.tv/view/11073 -W http://www.seeon.tv/jwplayer/player.swf --stop 3600 --live -o \"$FileName\"
Reply With Quote
  #7  
Old 06-01-2014, 01:51 PM
Nori Nori is offline
Junior Member
 
Join Date: Jun 2014
Posts: 3
Nori is on a distinguished road
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by KSV View Post
The following script should do the trick
Code:
#! /bin/bash
FileName=`date +"MyShow - %0d-%0m-%0y - %0k-%0M-%0S.flv"`
rtmpdump.exe -r rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34 -p http://www.seeon.tv/view/11073 -W http://www.seeon.tv/jwplayer/player.swf --stop 3600 --live -o \"$FileName\"

Hi
i have a problem with this script. the output flv file is always MyShow with no date and when restart the script the previous flv file is overwritten.
Reply With Quote
  #8  
Old 06-03-2014, 05:36 AM
zer00 zer00 is offline
Junior Member
 
Join Date: Oct 2011
Posts: 12
zer00 is on a distinguished road
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by Nori View Post
Hi
i have a problem with this script. the output flv file is always MyShow with no date and when restart the script the previous flv file is overwritten.
There is only a little mistake in the script.
This should work:

Code:
#! /bin/bash
FileName=`date +"MyShow - %0d-%0m-%0y - %0k-%0M-%0S.flv"`
rtmpdump -r rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34 -p http://www.seeon.tv/view/11073 -W http://www.seeon.tv/jwplayer/player.swf --stop 3600 --live -o "$FileName"
Reply With Quote
  #9  
Old 06-04-2014, 02:07 PM
Nori Nori is offline
Junior Member
 
Join Date: Jun 2014
Posts: 3
Nori is on a distinguished road
Default

Re: Renaming rtmpdump downloads automatically based on date and time (Windows, Linux)


Quote:
Originally Posted by zer00 View Post
There is only a little mistake in the script.
This should work:

Code:
#! /bin/bash
FileName=`date +"MyShow - %0d-%0m-%0y - %0k-%0M-%0S.flv"`
rtmpdump -r rtmp://live1.seeon.tv/edge/nvcrd4lz4zs0w34 -p http://www.seeon.tv/view/11073 -W http://www.seeon.tv/jwplayer/player.swf --stop 3600 --live -o "$FileName"
Thank you!!
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 10:21 AM.


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