This is a really quick post about how to convert vbr (variable bit rate) mp4 video files (such as those that come out of phone cameras/iphones) to mpg format. In order to do this, I have used three different pieces of software - mplayer, ffmpeg and avidemux.
Opening a vbr mp4 file in avidemux appears to kick up the following error: "No audio decoder found for this file. Save (A+V) will generate bad AVI. Save audio will work". The first thing that I did was to extract the audio:
root@yivo:~/Desktop/Aaron Vids# mplayer -vo null -ao pcm -af resample=8000,volume=+16db:sc file.mp4
A: 69.9 V: 69.8 A-V: 0.060 ct: 0.015 1000/1000 0% 0% 0.3% 881 0
Exiting... (End of file)
root@yivo:~/Desktop/Aaron Vids#
This will dump out a wav file called audiodump.wav.
Now, open avidemux, open the original mp4 file and click past the error - "No audio decoder found for this file. Save (A+V) will generate bad AVI. Save audio will work". Go to audio -> main track -> audio source -> external wav -> select the audiodump.wav. You may need to tweak the sync to get the audio to match the video. Save the new file as temp.mp4.
Now, convert the temp file to a mpg file.
root@yivo:~/Desktop/Aaron Vids# ffmpeg -i temp.mp4 -ar 44100 -r pal output.mpg
Finally, some of the videos that I converted were sideways, mencoder can fix this little problem as seen on this site:
http://www.yolinux.com/TUTORIALS/LinuxTutorialVideo.html
root@yivo:~/Desktop/Aaron Vids# mencoder -vf rotate=1 -ovc lavc -oac copy output.mpg -o output_rotated.mpg
As usual, if you break your files using these instructions you get to keep all of the pieces.
Popularity: 25% [?]


Latest Comments