During my latest trip to Japan, I bought a Sanyo Xacti C5 camera. This hybrid digicam/videocam device is rather honest, and what I especially liked was that it directly records videos in Mpeg 4 format. Pretty nice, that you can save almost 1 hour of quality video on a 1 Gb flash!
However, I quickly noticed that something sucked about it. When I wanted to watch my recorded videos on my PC, I could only see the top-left corner of the video. Although the device records videos in 640x480, mplayer, xine, or vlc would invariably show me a 320x240-sized window with only the top-left part. Only ffplay would play them correctly (but without sound). I know my videos sucks, but this way they suck even more now.
It is no surprise that the feature is actually a bug: for unknown reasons, the video size is not correctly written in the MP4 file (it seems the Olympus C-770 is also affected). So, here is how to fix it. I have found two ways, one bad, one better.
The bad one first: use mencoder to rewrite your file into an avi. You'll have to encode the sound, but the video will be left untouched. This can be achieved by the following command:
$ mencoder -oac mp3lame -ovc copy SCREWED-FILE.MP4 -o FIXED-FILE.avi
There are two disadvantages to this solution:
So here is the better version, found on this thread. You just have to use MP4Box (which most likely comes with the gpac package of your distro) to fix the video. The command to apply to every video is:
$ MP4Box -isma -add SCREWED-FILE.MP4 FIXED-FILE.MP4Since I already have plenty of shit recorded, I ran this little command in my top directory to fix it all:
$ find -name "*.MP4" -execdir MP4Box -isma -add {} /tmp/MOO.MP4 \; -execdir mv /tmp/MOO.MP4 {} \;