D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] mpg to mp3

 

If you have mplayer installed, this script has worked for me to convert
many different file formats (just sub the input type in the first line)
the output type can be $out.wav, .$out.mp3, $out.ogg etc



#!/bin/bash
# 
# *.mpg2wav
# 
for i in *.mpg; do
    out=$(echo $i | sed -e 's/.mpg//g')
    mplayer -ao pcm "$i" -ao pcm:file="$out.wav"
done


On Thu, 2007-05-24 at 10:54 +0100, Simon Robert wrote:
> Hi
> I have been asked to record the archers and round our way the only means 
> of good reception is via satellite. Recording is not a problem, I have a 
> card and feed into my pc and can record using kaffine.
> 
> Now I need to turn the result *.mpg/TS file into a mp3 or wav or ogg or 
> whatever. I have found a neat script that will convert mpg to avi with 
> an mp3 soundtrack.
> 
> I tried adapting this by taking out the video codec part, leaving only 
> the mp3 bit. This don't work as mencoder says that a video stream is 
> mandatory. The same thing happens when I attempt to convert to avi, as 
> kaffine has not recorded any video as Radio 4 don't do it. I can extract 
> the soundtrack from avi's using avidemux.
> 
> Anyone have any ideas on how I can create either an mp3 or an avi from 
> this? When the recording has a video component it's not a problem!
> 
> Any suggestions recieved gratefully.
> 
> Thanks
>      Simon




-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html