published on

concatenating m4a into a large ogg file

so imagine that you accidentally purchased m4a files of an audiobook, but wanted to play them on your superawesome sansa clip (warning, clicking on this link leads to awesomeness)

here’s how you could do it:

for i in *.mp4
do
    ffmpeg -i $i -vn -f wav - | oggenc -o ${i%\.*}.ogg -
done 

buuuuut, let’s say you wanted to have a single file (audiobook) where the clip could keep track of your location in the book …

for i in *.mp4
do
    ffmpeg -i $i -vn -f wav - >> superfile.wav
done
oggenc -q 1 superfile.wav