[MPlayer-users] Restarting mplayer after Network Trouble
martin.m at suddenlink.net
Fri Mar 11 23:24:33 CET 2016
Is there a way to get mplayer to keep re-trying a session
that chokes up due to network trouble?
There are some radio programs I like to time shift and
too many times, stuff happens and the stream breaks up enough
that mplayer gives up and one misses the rest of the program. If
given the choice between nothing at all and most of the program
with a piece missing, the mutilated show is much better. I am
using the normal record method in which the command starts out
mplayer -noconsolecontrols -nolirc -really-quiet -dumpstream -playlist
followed by the link to the program source.
If a run-out produces a distinctive exit status, I could
probably write some shell script that saves the stream fragment
to a temporary file and then restarts mplayer again until the
time for the show has passed.
The shell scripts I use right now call mplayer to save to
stream.dump and then I background that process with & and then
kill $! after sleeping X number of seconds. If mplayer died
before that time, one just looses everything after that point.
On Friday afternoon, there are 3 programs I save from 3
different sources that all occur during roughly the same time
period Our ISP which is normally quite good must have had some
internet upheaval because all 3 programs were cut short, very
short in some cases. When I checked later, everything was fine so
service returned but mplayer had already given up.
I am certainly not complaining as mplayer works
beautifully when the network does. I simply want to devise the
best and most direct method for trying a restart when there is a
break in the stream. Normally, the stream never ends.
More information about the MPlayer-users