Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   rtmpdump (http://stream-recorder.com/forum/forumdisplay.php?f=54)
-   -  

rtmpdump using .bat file

(http://stream-recorder.com/forum/showthread.php?t=12779)

rossifeder 06-12-2012 07:07 AM

rtmpdump using .bat file


 
hello :)

I did a script to stream some channels and it work, I used :
Code:

rtmpdump -v -r rtmp://xxx -a xxx -y xxx -W wwww -p ZZZZ -f xxx | vlc -
so first start rtmpdump (with all his log like connecting etc etc ) + start vlc and i wait 5 sec then the stream work

ok good :D

but i want to do this differently, I want to start rtmpdump and wait
if there is a connection then start vlc to watch the stream
if there is no conecction (server error , no internet, wrong url , etc etc) then write (echo) there is no stream & exit

i am searching this on internet in last 3 days and i cant find a solutin

if there is a value the rtmpdump can return o there is an external programm.exe that i can use in my .bat file
i would accept any suggestion to do this

i cant figure out how to do this :(
plz help me :confused:

KSV 06-12-2012 08:02 AM

Re: rtmpdump using .bat file


 
you can use --stop 1 switch to download 1 second of stream and then check that file's duration using MediaInfo command line tool. if media duration is 1 second then stream is live and working else some error occurred during download.

rossifeder 06-12-2012 08:11 AM

Re: rtmpdump using .bat file


 
Quote:

Originally Posted by KSV (Post 47481)
you can use --stop 1 switch to download 1 second of stream and then check that file's duration using MediaInfo command line tool. if media duration is 1 second then stream is live and working else some error occurred during download.

ok i am going to try this and am going to tell you the results after that

thank you very much :o

rossifeder 06-12-2012 08:38 AM

Re: rtmpdump using .bat file


 
^^^^^^

its more complicated than what i thought :D
i downloaded MediaInfo but I cant find the right command line
can you give me an example of a command line
thanks

KSV 06-12-2012 09:13 AM

Re: rtmpdump using .bat file


 
Code:

MediaInfo --Inform=Video;%Duration% your_file
This command will tell you the duration in milliseconds. replace % with %% when using in batch file.

rossifeder 06-12-2012 09:31 AM

Re: rtmpdump using .bat file


 
thank you KSV for your time

rossifeder 06-12-2012 02:23 PM

Re: rtmpdump using .bat file


 
I have discovered the timeout command
rtmpdump −−timeout
which i never noticed before
it will risolve the problem
thanks

chap 06-12-2012 03:18 PM

Re: rtmpdump using .bat file


 
Quote:

Originally Posted by rossifeder (Post 47480)
hello :)
but i want to do this differently, I want to start rtmpdump and wait
if there is a connection then start vlc to watch the stream
if there is no conecction (server error , no internet, wrong url , etc etc) then write (echo) there is no stream & exit

try use
Quote:

rtmpdump -v -r rtmp://xxx -a xxx -y xxx -W wwww -p ZZZZ -f xxx | "C:\Program Files\VideoLAN\VLC\vlc.exe --play-and-exit" -

rossifeder 06-12-2012 03:54 PM

Re: rtmpdump using .bat file


 
Quote:

Originally Posted by chap (Post 47497)
try use

thanks :o


All times are GMT -6. The time now is 09:43 PM.