Video Editing on Linux: Kino, ffmpeg, mpeg2enc, mjpegtools, ImageMagick, Gimp ...
For quite some time now I had a video footage I wanted to edit. Video editing is really the only thing I'm still running on windows most of the time. The programs I was using on Windows are slow, memory hogs and also crashing quite often. I have yet to edit single small clip on Windows without crashing a program a few times. (YMMV, may be it's just me ) I've tried most of the popular ones on Windows with Movie Maker being absolutely the worst! Well, this time I decided to try editing clip only on Linux. So I did and uploaded video to youtube.com . The clip became an instant hit with 400 views in a single day! I'm sure its popularity has nothing to do with editing it on Linux, but it was nice anyway and Tanya and I had a few chuckles about it. Here it is, the notes below the clip:
I had the Kino installed and configured and I just had to create devices manually:
$ mknod -m 666 /dev/video1394/0 c 171 16
$ mknod -m 666 /dev/raw1394 c 171 0
Commands for batch processing:
$ ffmpeg -i output2.mpeg -f image -img jpeg still_%03d.jpg # this will export mpeg stream into a sequence of jpeg files
$ for file in `ls -1 *.jpg`; do jpegorient 270 $file; done # rotate all images in current directory 270 degrees clock vise
$ ffmpeg -hq -i img%d.jpg /tmp/a.mpg # put images back into the MPEG stream
$ convert $fname -resize 640x480 $name # resize image
$ jpeg2yuv -f 25 -I p -j still_%03d.jpg | yuvdenoise | mpeg2enc -f 8 -o /var/tmp/1.mpeg # put together images, denoise and pack up into mpeg
$ mplex -f 8 clip.mp3 in.mpg -o out.mpg # adding sound
$ cat 001.kinofx.dv | dvgrab --stdin --format jpeg --jpeg-quality 100 # output DV stream into *jpg files
Here is a useful one-liner if you have a bunch of files that you would like to rename into filenames with sequential numbers ready to be imported into MPEG stream:
$ let c=0; ls -1 | while read fname; do mv $fname img_$c.jpg; let c=c+1; done
Kino is an awesome tool that I'm sure needs more exposure. Very stable, easy to use and simple. Ability to use command line tools for batch processing is a huge plus.
Notes: FOBS looks very promising, check it out later: http://fobs.sourceforge.net/
Tools of the trade:
man mjpegtools
man mpeg2enc
man ffmpeg
man convert
man mpginfo
https://sourceforge.net/docman/display_doc.php?docid=3456&group_id=5776
http://mpgtx.sourceforge.net/
http://ffmpeg.sourceforge.net/
http://mjpeg.sourceforge.net/
http://www.kinodv.org/

0 Comments:
Post a Comment
<< Home