14 Nov
2013
14 Nov
'13
01:43
On Thu, 14 Nov 2013 00:24:14 +1100 Basil Chupin wrote: > My wife has accumulated quite a number of *.flv files which need > converting to *.mp3 so that they may be played on an mp3 device. I > know that VLC will do such a conversion but having to convert some > 200 files individually is not my idea of how I want to spend Sunday > afternoons :-( . > > I have checked the 'net and came across a couple of suggestions on > how to batch-process these files using ffmpeg- but they don't work in > all cases, they convert some of the files but not all for some reason. > > Does anyone, please, know of a reliable method of how a batch convert > from *.flv to *.mp3 can be done? > > (There are also some files which are *.avi and *.wav but I guess that > I can use the slow method of doing them with VLC - but if there is a > faster way.......?) > > BC > Hi Basil, You've already been given the basics but I've done enough of this that I simply can't _not_ throw in my 2 cents. Below is the simple looping script that I use. YMMV depending upon your hardware but I always set it up to read the source from one physical drive while writing to another ... it's faster and less stress on the drives. - - - - - 8< - - - - - > #!/bin/bash > # for all .flv files, extract .mp3 audio content > FILES="*.flv" > # for loop read each file > for f in $FILES > do > INF="$f" > OUTF="/TARGET/PATH/$f.mp3" > ffmpeg -i $INF $OUTF > done - - - - - 8< - - - - - common ffmpeg audio options: `-ar freq' Set the audio sampling frequency (default = 44100 Hz). `-ab bitrate' Set the audio bitrate in bit/s (default = 64k). `-ac channels' Set the number of audio channels. For input streams it is set by default to 1, for output streams it is set by default to the same number of audio channels in input. If the input file has audio streams with different channel count, the behaviour is undefined. e.g. ffmpeg -i somefile.flv -ar 44100 -ab 64k -ac 2 /path/somefile.mp3 hth & regards, Carl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org