Posts Tagged ‘JVC’

JVC Everio GZ-MG132E and Ubuntu Hardy 8.04

24.07.2008

Right,

This little HDD Camcorder is starting to be really handy. Start with it was a bit of a pain, but with great patience from Jartza, as he managed to get the correct settings for mencoder just right. Need to buy him few beers when he gets back from his tour.

So, the problem with the camcorder is that it creates almost standard MPEG2 movie clips, but those are saved in .MOD type and the “real” video scale is 1.33:1 and that creates a small trouble if you don’t want to use the software that came with the camera. Also, the movie clips are huge, one hour clip is 4G, and to my opinion it needs to be smaller for reasonable storing.

So! Now we need mencoder. $ sudo apt-get install mencoder should do the trick to get it installed.

After a short talk with Jartza, we decided that H264 MPEG4 would be good. 4Gb clip shrinks into about 700Mb and that starts to look much prettier in terms of storing.

Now the actual conversion of the .MOD file into .mp4 is done with two commands, which are long. So I won’t even try to remember them. We need a bit of scripting. Below are the commands, notice that there’s two passes for the same files, so if you have for example MOV011.MOD as original and you give mov011.mp4 as output filename, you need to give those exact names for the second command too.

$ mencoder original.MOD -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=1:turbo=1:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o output.mp4

$ mencoder original.MOD -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=2:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o output.mp4

For someone to remember those is seriously damaging to the brain, so we probably like to somehow shorten the procedure. Here’s how it’s done in the easiest way.

Open editor which you prefer, and copy the following code to it and save with some name which is easy for you to remember.

#!/bin/sh

# Script to convert JVC Everio .MOD files into x264 mpeg4 movies#

mencoder $1 -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=1:turbo=1:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o $2

mencoder $1 -sws 9 -vf pp=ci,dsize=1.78,harddup -oac faac -faacopts br=128:mpeg=4:object=2:raw -ovc x264 -x264encopts pass=2:bitrate=1500:vbv_maxrate=2500:vbv_bufsize=2500:nocabac:level_idc=13:global_header:threads=2 -of lavf -lavfopts format=mp4 -o $2

After saving the text, you can use it as follows: open terminal and cd to the same directory as the script you just saved. will ease up if you have the .MOD file also in that same folder. Then use the script like

$ ./scriptname inputfile.MOD outputfile.mp4

After awhile, you should have outputfile.mp4 in the same directory. Be patient, conversion takes long. I like to open a screen and start the conversion in it, as it can be detached and then attached from other locations too to see if it’s ready.

However, that little script will not check wheter the inputfile exists nor if there’s already an outputfile in the same folder. I use that just to get a shitload of files in a conversion “pipe” by opening screen and then using the script as

./scriptname inputfile1 outputfile1; ./scriptname inputfile2 outputfile2; ./scriptname inputfile3 outputfile3

and then ctrl-a d to detach it and let it do it’s magic.

I’ll post more about how to get some error-checking into the script tomorrow or soon, it’s getting late and I need a hug and sleep to be fresh tomorrow morning. Last day before my one week holiday.

Taa-Taa.