You are not logged in.

#1 2013-12-19 09:41:54

unhammer
Member
Registered: 2009-10-01
Posts: 99
Website

program that can play http://foo.com/bar.ogg and exiting on timeout?

Is there a program like ffplay/mplayer or similar that can play a shoutcast ogg stream and _exit_ if the stream stops / times out / gets disconnected / in some other manner stops playing the stream?

I've tried ffplay and mplayer and cvlc, and tried various options to no avail (though I may have missed something), I still have no indication of when the stream times out.

Offline

#2 2013-12-20 20:26:19

R81Z3
Member
Registered: 2013-09-03
Posts: 7

Re: program that can play http://foo.com/bar.ogg and exiting on timeout?

You might want to try your hand at scripting just make a basic script with a for/loop that counts a certain period of time and then stops or kills the application at the end of the time. I know it sounds messy, but you could make it do almost everything you wanted to do you can redirect output and have the script read the errors from say mplayer, or other cmd line tools and if a certain error is detected then kill the process.

I know mplayer does a good job of just stopping when a stream is not available. But to do exactly what you want might be a little difficult.

R81Z3


R81Z3

Security +, Linux +, LPIC 1, still learning!

Offline

#3 2013-12-21 02:52:35

Thaodan
Member
From: Dortmund, Nordrein-Westfalen
Registered: 2012-04-28
Posts: 448

Re: program that can play http://foo.com/bar.ogg and exiting on timeout?

what about using wget or something a like to download the file and use another programm to play it?


Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux

Offline

#4 2013-12-21 09:07:52

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: program that can play http://foo.com/bar.ogg and exiting on timeout?

downloading the file first wouldn't be real-time, and i suppose that's what op wants.
i'd go with scripting, too.
you have to get hold of some flags being set either on your system, or in the metadata that comes with the stream, and kill the player according to their values.
or simply, if sound output doesn't get sound (above some dB threshold ) for n seconds, kill player.
also i say +1 to looking into mplayer if it already has useful capabilities inbuilt.

Offline

#5 2013-12-21 16:49:26

unhammer
Member
Registered: 2009-10-01
Posts: 99
Website

Re: program that can play http://foo.com/bar.ogg and exiting on timeout?

R81Z3 wrote:

I know it sounds messy

messy is the word http://sprunge.us/YbjM?bash (and that's the cleaned up version!)
well, it sort of works :-/

Offline

Board footer

Powered by FluxBB