[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm to mp3



--- Ron Johnson <ron.l.johnson@cox.net> wrote:

> > 
> > here is a script which uses 
> > mplayer and external program lame to encode a mp3 
> > from source
> > 
> > #!/bin/bash
> > FIFO="MYFIFO"
> > PLAYER="mplayer"
> > ENCODER="lame"
> > PLAYER_LOC=`which $PLAYER`
> > ENCODER_LOC=`which $ENCODER`
> > PLAYER_OPTS="-ao pcm:file="$FIFO" -vo null -vc
> dummy "
> > ENCODER_OPTS=""
> > 
> > if [ $# -ne 2 ]; then
> >      echo "Usage: "$0" <source> <out filename>"
> >      exit 1
> > fi
> > 
> > if [ ${#PLAYER_LOC} -eq 0 ]; then
> >     echo "This requires "$PLAYER" be present in
> your
> > path"
> >     exit 1
> > fi
> > 
> > if [ ${#ENCODER_LOC} -eq 0 ]; then
> >     echo "This requires "$ENCODER" be present in
> your
> > path"
> >     exit 1
> > fi
> > 
> > if [ ! -f $FIFO ]; then
> >     mkfifo $FIFO
> > else
> >     echo "FIFO "$FIFO" already exists. Exiting"
> >     exit 1
> > fi
> > 
> > $PLAYER $PLAYER_OPTS ${1} &
> > $ENCODER $ENCODER_OPTS $FIFO ${2}
> > rm $FIFO
> 
> Interesting.  But that's only for audio files.  Will
> something 
> like it also work on video files?


it should work also with video files.
" -vo null -vc dummy "
these options were to process the video stream with a
dummy codec and pass to the null output driver.

the audio stream of couse is still sent to the FIFO.

if you leave these options off you would see the video
stream but it also may take longer to process.



		
__________________________________ 
Do you Yahoo!? 
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide



Reply to: