Posts Tagged ‘video’

Grab video from a DV camera with Kino

Posted in GNU | Linux, HowTo, Open Source on June 10th, 2009 by Jorge – Be the first to comment

First, you need to make sure you have kino installed:

$ sudo apt-get install kino

then, connect your camera with the firewire cable and make sure the iee1394 module is loaded. Doing:

$ lsmod | grep ieee1394

should give you:

ieee1394              108288  4 dv1394,raw1394,sbp2,ohci1394

Now make sure the device /dev/raw1394 has been created. Doing:

$ ls -all /dev/raw1394

should give you something like:

crw-rw---- 1 root disk 171, 0 2009-06-10 09:56 /dev/raw1394

Also, make sure /dev/raw1394 belongs to either the disk or video groups. You will notice in the output above that my /dev/raw1394 belongs to the disk group, so it’s ok, but if this is not the case for you, then you can fix it by doing:

$ sudo chown root.disk /dev/raw1394

Finally, add yourself to the disk or video groups (whichever group you added the device to):

$sudo useradd -G [group-name] [user-name]

Now Kino should be able to recognize the camera and you should be able to transfer your videos to your computer!

Video editing with Linux

Posted in GNU | Linux, HowTo, Open Source on February 22nd, 2009 by Jorge – Be the first to comment

Convert to FLV:

$ ffmpeg -i original_video.avi -qscale [quality] -s [WxH] -ar 22050 converted_video.flv

Join multiple videos:

$ mencoder -oac copy -ovc copy -o joined.avi clip1.avi clip2.avi [...]

Extract a clip from a video:

$ ffmpeg -qscale 1 -acodec mp3 -ab 256k -ss [start time in hh:mm:ss] \
   -t [length in hh:mm:ss] -i video.avi clip.avi 

Dump the audio:

$ mplayer -vc null -vo null -ao pcm -benchmark test.avi 

Grab an image from a video:

$ ffmpeg -i movie.avi -ss [time-in-seconds] -vframes 1 -f image2 frame.jpg

Overlay an image on a video:

$ ffmpeg -i input.avi -vhook '/usr/lib/vhook/imlib2.so -x 0 -y 0 -i overlay.png' output.avi

Encode a Windows-compatible video:

$ mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vbitrate=1600
  -o videoout.avi videoin.xxx

with a separate audio file:

$ mencoder -audiofile audiofile.wav -oac mp3lame -ovc lavc
-lavcopts codec=msmpeg4v2:vhq:vbitrate=1600 -o videoout.avi videoin.xxx

There is also a good guide on how use ffmpeg to create FLV videos for posting online here:
http://scott.yang.id.au/2006/07/flash-video-ffmpeg-flowplayer/

Encode a windows-compatible video

Posted in GNU | Linux, HowTo, Open Source on November 7th, 2008 by Jorge – Be the first to comment

There are a lot of constantly updated video and audio codecs available in Linux. Unfortunately, the choice in Windows is way more limited. Because of this, it is common that videos compressed with the best and latests codecs in Linux cannot be read by common Windows applications. Luckily, You can encode windows-compatible videos in Linux with mencoder by typing the following command:

$ mencoder -oac mp3lame -ovc lavc -lavcopts \
vcodec=msmpeg4v2:vhq:vbitrate=1600 -o videoout.avi videoin.xxx