With ffmpeg2theora you can convert mp4 files to theora ogv files.
ffmpeg2theora filename.mp4
In the following case all mp4 in that directory will be converted into ogv without video output.
for i in *.mp4; do ffmpeg2theora --novideo -a5 "$i"; done
Showing posts with label convert. Show all posts
Showing posts with label convert. Show all posts
Thursday, December 2, 2010
Thursday, April 30, 2009
How to convert wma to ogg
How can I convert all *.wma to *.ogg in one directory?
I first tried the approved ffmeg. That one helped me many times with good results.
Version 1:
Version 2:
# ${i/.wma} is cutting the filename $i from ".wma"
The quality gets really worse.
Best quality with version 3:
1. Step: Convert wma to flac with ffmeg
2. Step: Convert flac to ogg with oggenc
# -o output-file
Or all in one line to convert the whole directory:
# rm -f delete without further questions
I first tried the approved ffmeg. That one helped me many times with good results.
Version 1:
find -name '*wma' -exec ffmpeg -i {} -acodec vorbis -ab 128k {}.ogg \;or
rename 's/\.wma//' *\.wma\.ogg
(Test the renameing: rename --no-act --verbose 's/\.wma//' *\.wma\.ogg)
Version 2:
for i in *.wma; do ffmpeg -i "$i" -vn -acodec vorbis -ab 128k "${i/.wma}".ogg; done# ffmpeg: -vn => novideo, -acodec vorbis => ogg-encoder, -ab set audio bitrate to 128k (64 is standard. That option doesn't seem to work with ogg :-(
# ${i/.wma} is cutting the filename $i from ".wma"
The quality gets really worse.
Best quality with version 3:
1. Step: Convert wma to flac with ffmeg
ffmpeg -i input.wma -vn -acodec flac output.flac
2. Step: Convert flac to ogg with oggenc
oggenc input.flac -q2 -o output.ogg# -q quality 2 (1 bad .. 10 excellent)
# -o output-file
Or all in one line to convert the whole directory:
for i in *.wma; do ffmpeg -i "$i" -vn -acodec flac -y tmp.flac; oggenc tmp.flac -q2 -o "${i/.wma}".ogg; done; rm -f tmp.flac# -y Overwrite output files.
# rm -f delete without further questions
Wednesday, December 24, 2008
Convert ogg to mp3
My sister is here for the holidays. Unfortunately her mp3 player only supports mp3 and no ogg. :-(
I helped her to convert their ripped ogg files from her kubuntu system into mp3 files. The following command transforms the whole directory from ogg in mp3.
for i in *.ogg; do sox "$i" "${i/.ogg}".mp3; done
(sox old.ogg neu.mp3 is the basic command to transform ogg to mp3.)
I helped her to convert their ripped ogg files from her kubuntu system into mp3 files. The following command transforms the whole directory from ogg in mp3.
for i in *.ogg; do sox "$i" "${i/.ogg}".mp3; done
(sox old.ogg neu.mp3 is the basic command to transform ogg to mp3.)
Sunday, November 16, 2008
Extract mp3 from flv
Tonight I tried to rip the audio track from a flv file. First I wanted to convert it into ogg but as the audio track is a mp3 stream itself I decided just to rip the mp3 data into a file (same quality as in the video file. A higher samplerate would only increase filesize).
UPDATE: Today the audiostream is often aac (not mp3 anymore). That means, you have to use mp4 instead of mp3 with ffmpeg ... -f mp4 ... .mp4).
One of those commands will do the job:
mplayer -dumpaudio in-video.flv -dumpfile out-audio.mp3
ffmpeg -i input.flv -f mp3 -vn -acodec copy output.mp3
To convert all files (*.flv to *.mp3) in the directory use one of the following commands:
for i in *.flv; do mplayer -dumpaudio -dumpfile "${i/.flv}".mp3 "$i"; done
for i in *.flv; do ffmpeg -i "$i" -f mp3 -vn -acodec copy "${i/.flv}".mp3; done
#ffmpeg: -f mp3 => force mp3 format, -vn => novideo, -acodec copy => stream-copy
# ${i/.flv} is cutting the filename $i from ".flv"
UPDATE: As the files are not always in the same format and my portable music player couldn't play mp4 I decided to convert them to ogg.
ffmpeg -i input.flv/mp4 -vn -acodec vorbis output.ogg
This script will transform all flv files in your directory into mp3 files.
1. Create a new file e.g. with kate and name it flv2mp3.sh
#!/bin/bash
for i in *.flv
do
echo "$i"
# Alternative 1
# mplayer -dumpaudio -dumpfile "${i/.flv}".mp3 "$i"
#Alternative 2
ffmpeg -i "$i" -f mp3 -vn -acodec copy "${i/.flv}".mp3
done
2. Change the right of this file:
chmod +x flv2mp3.sh
3. Goto the directory and run the script
UPDATE: Today the audiostream is often aac (not mp3 anymore). That means, you have to use mp4 instead of mp3 with ffmpeg ... -f mp4 ... .mp4).
One of those commands will do the job:
mplayer -dumpaudio in-video.flv -dumpfile out-audio.mp3
ffmpeg -i input.flv -f mp3 -vn -acodec copy output.mp3
To convert all files (*.flv to *.mp3) in the directory use one of the following commands:
for i in *.flv; do mplayer -dumpaudio -dumpfile "${i/.flv}".mp3 "$i"; done
for i in *.flv; do ffmpeg -i "$i" -f mp3 -vn -acodec copy "${i/.flv}".mp3; done
#ffmpeg: -f mp3 => force mp3 format, -vn => novideo, -acodec copy => stream-copy
# ${i/.flv} is cutting the filename $i from ".flv"
UPDATE: As the files are not always in the same format and my portable music player couldn't play mp4 I decided to convert them to ogg.
ffmpeg -i input.flv/mp4 -vn -acodec vorbis output.ogg
This script will transform all flv files in your directory into mp3 files.
1. Create a new file e.g. with kate and name it flv2mp3.sh
#!/bin/bash
for i in *.flv
do
echo "$i"
# Alternative 1
# mplayer -dumpaudio -dumpfile "${i/.flv}".mp3 "$i"
#Alternative 2
ffmpeg -i "$i" -f mp3 -vn -acodec copy "${i/.flv}".mp3
done
2. Change the right of this file:
chmod +x flv2mp3.sh
3. Goto the directory and run the script
Subscribe to:
Posts (Atom)

