I have recently made the transition from Windows to the latest Ubuntu distro. After being a long time Micro$oft user/abuser I figured it was time
As a result I am finding that things are much different now that I am on this platform and recently came up against converting a *.mp4 video to multiple other formats for use in embedding it in a web page.
As a result, I wanted to make sure that I got these out here for all to use in case they ever need an easy place to find it. (actually, it’s just so I can remember what to do LOL)
So, in order to get a video to play across most browsers you need to first convert the movies into the following formats:
- MP4
- OGV
- WEBM
- SWF
To do so in Linux (more over Ubuntu) run the following commands in Shell… just make sure to add in the path to the original file and output files… oh yeah, also make sure you have the following installed: ffmpeg and ffmpeg2theora
|
1 |
apt-get update && apt-get install ffmpeg && apt-get install ffmpeg2theora |
Here are the commands for each:
MP4 to SWF
|
1 |
ffmped2theora -o MOVIE.swf MOVIE.mp4 |
MP4 to WEBM
|
1 |
ffmpeg -i MOVIE.mp4 MOVIE.webm |
MP4 to OGG
|
1 |
ffmpeg2theora -o MOVIE.ogv MOVIE.mp4 |
And here is the proper embed code (obviously change the height/width and add some style as you see fit):
|
1 2 3 4 5 6 7 8 |
<video width="280" height="189" controls autoplay> <source src="MOVIE.mp4" type="video/mp4" /> <source src="MOVIE.ogg" type="video/ogg" /> <source src="MOVIE.webm" type="video/webm" /> <object data="MOVIE.mp4" width="280" height="189"> <embed src="MOVIE" width="280" height="189" /> </object> </video> |






