Search code examples
phpffmpegmp4oggwebm

FFMPEG conversion


I was looking at FFMPEG, and also specifically FFMPEG PHP, and found that FFMPEG PHP had all the features I needed for some other sections of my website, (such as images) however it lacked the ability to save movie files.

What would the shell command be to convert the file start.ogg that is of an undetermined format (using OGG as an example) to both the Webm format in the file end.webm as well as the MP4 format in the file end.mp4. I would like the bit rate for both video and audio to remain the same.

How can I do this?


Solution

  • The ffmpeg(1) manual includes the following:

    * You can encode to several formats at the same time and
    define a mapping from input stream to output streams:
      ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
    

    If you've only got one input and two outputs, the following does the trick:

    ffmpeg -i /tmp/start.off /tmp/end.webm /tmp/end.mp4
    

    Tested with a DivX 5 video input to WebM and MP4 outputs. Neat, thanks for the research project. :)