Encoding PPM/WAV to Ogg Theora/Vorbis
The process:
- # input files are PPM/*.ppm and audio.wav, with an empty PNG directory for temporary usage
- cd PPM && find -name "*.ppm" -exec convert {} ../PNG/{}.png \; && cd ..
- mencoder "mf://PNG/*.png" -mf type=png:fps=25 -ovc raw -o video.avi
- avidemux video.avi # add audio.wav as audio track, use COPY/COPY as codecs and save as video2.avi
- avifix -F "RGB" -i video2.avi
- ffmpeg2theora -V 480 -S 1 -A 128 --optimize video2.avi
- # output file is video2.ogg
Some notes:
- mencoder doesn't support PPM, so convert to PNG
- avidemux is used simply to multiplex the audio and video into one file
- avifix is needed to set the fourcc so that ffmpeg2theora can understand
- ffmpeg2theora doesn't support separate audio / video input streams, so we need to have a single already-multiplexed file to feed it with
There must be a better way to do this.