On Sun, 13 Jul 2008, Rodney Baker wrote:- <snip>
To reduce the time taken I have created a named pipe called 'streamdump'. In one Konsole window I start 'ffmpeg -i streamdump
', then in another start 'mplayer -dumpstream -dumpfile streamdump -playlist "<url>".
No need to have two consoles open. Using the named pipe you can use:
ffmpeg -i streamdump What I would like to know is if there is a way to redirect the output from
mplayer directly to ffmpeg without having to use the named pipe and two
konsole sessions. I don't know about not using the named pipe, but I don't think so. My
own tests trying to use dumpstream with an RM file on my drive and
sending it through an ordinary pipe failed. So far nothing I've tried has worked. I'm guessing that
there is likely to be more than one way to do this in a single step but I
haven't been able to make it work yet. A simple way would be to write a script to do it and just pass the URL
and output name to it. That way you can hide the various steps away and
only need to worry about the one command.
You might want to add in a bit more error-checking, but something like
this should do:
#!/bin/bash
URL="$1"
OUTPUT="$2"
# make sure there's an input and an output specified
#
[ -z "${URL}" -o -z "${OUTPUT}" ] && exit
# check for pre-existing output file and abort if present
#
[ -s "${OUTPUT}" ] && exit 1
# get a temporary filename
#
TEMPFILE=$(mktemp)
# and then use it to create named pipe
#
rm "${TEMPFILE}"
mkfifo "${TEMPFILE}"
# have ffmpeg read from the named pipe, write the mp3 as 160kbits, and
# background it. Redirect stdin so it doesn't try reading from the
# keyboard.
#
ffmpeg -f rm -i "${TEMPFILE}" -f mp3 -ab 160k "${OUTPUT}" http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys
SUSE 10.1 32 | | openSUSE 10.3 32bit | openSUSE 11.0 32bit
| openSUSE 10.2 64bit | openSUSE 10.3 64bit | openSUSE 11.0 64bit
RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11
--
To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse+help@opensuse.org