Showing posts with label conversion. Show all posts
Showing posts with label conversion. Show all posts

Video Edition for Linux

You have some nice vacation video in your Camcorder and want to edit it on your Linux system.
It seems, that Windows user are more luckily, lots of video edition software exists (for example ULead), but Linux users also can edit their videos with free software.

In this post, I'll comment about three applications, which are powerful and easy to use.

Kino


Kino
Kino is a non-linear digital video editor which supports many basic video editing and assembling tasks.
But its main feature is the import from raw AVI and DV files, as well as capture footage from digital camcorders using the raw1394 and dv1394 libraries, and export to camcorders using the ieee1394 or video1394 libraries.
During import, it detects scene changes (when you stopped grabbing) and can split the scenes into separate files.


For me, its the application which works best when passing my videos from the digital camera onto the hard drive, without frame dropping.

Install instructions


sudo aptitude install kino

or click here to install it from the browser.

Troubleshooting


A normal user doesn't have privileges to the RAW 1394 device, which is used to transfer data from the camcorder to the computer. You would have to launch Kino as superuser or execute the following commands:
sudo modprobe raw1394
sudo chmod a+rw /dev/raw1394


To make these changes permanent:
sudo echo "install raw1394 /sbin/modprobe --ignore-install raw1394 $CMDLINE_OPTS ; \
sleep 0.5 ; \
/bin/chmod a+rw /dev/raw1394" > /etc/modprobe.d/raw1394.modprobe


OpenShot



OpenShot is a video editor for GNU/Linux, being simple but yet powerful. It has all functionality one would need for day-to-day video cutting and assemblage.

Its interface supports themes, is very eye-candy and integrates well with Gnome.
You can see a list of features on its website.

Install instructions


sudo add-apt-repository ppa:jonoomph/openshot-edge
sudo apt-get update
sudo apt-get install openshot openshot-docs

or see instructions here if you don't use Ubuntu Karmic.

Kdenlive


Kdenlive
Kdenlive is an intuitive and powerful multi-track video editor, including most recent video technologies.
It has tons of video and audio effects and video snippets can be arranged visually on the several tracks.
The resulting video can also be exported to DV devices, or written to a DVD with chapters and a simple menu.

Where Kino's importing feature is more powerful, Kdenlive is so much better when editing and creating the "final cut".

Install instructions


sudo aptitude -y install kdenlive

or click here to install it from the browser.

DVD Authoring


You should install the following additional programs, so you can export the video from Kdenlive to a DVD folder which can be burned to DVD directly.
sudo aptitude install ffmpeg lame mjpegtools dvdauthor

Convert Open Type fonts to True Type


FontForge, a multi-platform font editor, allows you to create and modify postscript, truetype and opentype fonts. You can save fonts in many different outline formats, and generate bitmaps.
We'll use it here to convert one format to another.

Convert Open Type to True Type with FontForge


On Ubuntu systems, we can create a conversion script, that does the conversion automatically. Paste the following in your favourite shell
sudo -v
# Make sure with have fontforge installed on our system
sudo aptitude install fontforge
echo '#!/usr/bin/fontforge
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);' > otf2ttf.sh
chmod a+x otf2ttf.sh

## The following lines are examples of the usage:
#
# Convert MyFont from Open Type to True Type in the same location:
# ./otf2ttf.sh MyFont.otf
#
# Convert all Open Type fonts of the current folder:
# for font in $(ls *.otf); do ./otf2ttf.sh $font; done
#
# Convert all Open Type fonts even in subfolders:
# find . -name *.otf -exec ./otf2ttf.sh {} \;
Note: I found the original script in this blog, but mine has slightly changes to be called directly.

FontForge can also be used on Windows systems, but I have no instructions for doing the conversion automatically, so you'll have to load the font and then store it again in the TrueType format.

In the next post we'll see how to install True Type fonts in our Ubuntu system.

Matroska


Matroska is a new multimedia container format usually found as .mkv files (matroska video) and .mka files (matroska audio).

This high-end container format supports fast seeking, embedded chapters and subtitle, several video and audio tracks, and supports latest codecs like H.264 and AAC (I highly recommend to encode your videos with these for quality reasons).
Unlike other container formats like AVI, you can easily switch between subtitle or audio tracks during playback and stream it over RTP.
In the near future it will also include menu support like found on DVDs.

Tools


To create such a multimedia stream the best tool is MKV-Toolnix, a graphical user interface for the mkvmerge program, which allows to create Matroska files from other formats.
It can be found for Windows and for Linux.

Install instructions for Ubuntu Hardy


The following instructions will install the latest version, not the old one which is found in the official Ubuntu repository.

sudo -s
echo "deb http://www.bunkus.org/ubuntu/hardy/ ./ #MKVToolNix - Cross-platform tools for Matroska
deb-src http://www.bunkus.org/ubuntu/hardy/ ./ #MKVToolNix - Cross-platform tools for Matroska" > /etc/apt/sources.list.d/bunkus.list
wget -q http://www.bunkus.org/gpg-pub-moritzbunkus.txt -O- | apt-key add -
aptitude update
aptitude -y install mkvtoolnix-gui
exit

AcetoneISO

AcetoneISO2, is a feature-rich and complete software application to manage CD/DVD images. Thanks to powerful open source tools such as fuseiso, AcetoneISO2 will let you mount typical proprietary images formats of the Windows world such as ISO BIN NRG MDF IMG and do plenty of other things. Everything will be done inside a handy GUI.

It's installation is a bit tricky, so you can go and see my install instructions for Ubuntu.

DVD Ripper

On Ubuntu, several tools are available. The following three can be installed right from the application menu.

dvd::rip


I recommend this tool, because it's fast and has a lot of options for tweaking the final output.
+ It lets you encode with several codecs
+ lets you specifying the final movie size
+ visual clipping and scaling
+ normalizing audio, multiple audio languages
+ subtitle handling
- Only supports 3 container formats (Avi, Ogg, Mpeg), not Matroska f.ex.
- Audio only in mp3 or AC3, not AAC f.ex.

Install note:


You should install additional software for being able to use all features:
sudo -i
apt-get install xvid4conf


AcidRip DVD Ripper


- Only Avi and Mpeg container
- Doesn't save your setup
- A bit confusing interface

Thoggen DVD Rip


+ Quick and easy setup of encoding
- Only supports Ogg for audio and Theora for video
- Slow encoding

DVD Authoring

Q-DVDAuthor is a GUI frontend for dvdauthor and other related tools.
The goal is to provide an easy-to-use, yet powerful and complete interface to generate DVD menus, slideshows, and videos to burn on a DVD.

Installation on Ubuntu


You can install it from the Application menu. But I recommend to install it from the command line, so some optional tools used will be installed as well.
sudo apt-get install qdvdauthor transcode toolame dvdrtools


Visit also


Check out the applications web page for some menu templates and user guides.

Create ISO dump from CD/DVD

Visually with K3b


K3b is a CD/DVD creator for Linux (optimized for KDE). It is the best disc burn tool, also for Ubuntu.

You can get the ISO dump with these steps:
  1. Insert CD/DVD and select Copy CD...

  2. Select Only create image in the Options tab.

  3. Write the image name in the Image tab.


These steps will just read the CD into the specified ISO image.

From the Command Line


On Linux systems you don't need any additional software for creating an .iso file from your CD or DVD.

# cat /dev/cdrom1 > mydisc.iso # if you know your cdrom device
cat /dev/`ls -l /dev | grep "^b.*cdrom.*" | awk '{print $9}'` > mydisc.iso
# You'll get an Input/output error, just ignore it.

You can use this .iso file in virtual machines or for burning copies.

Problem:

Only the first session of a multi-session disc will be stored. So this solution doesn't work with this kind of discs.

Therefore, you should use AcetoneISO, which can extract multi-sessions discs, and mount any kind of disc images. Read more about this tool in this separate post.

Have a look at this post to see how you can mount such .iso files as regular folder on your system.

ffmpeg

ffmpeg is a very powerful video coding suite. It is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. ffmpeg is developed under Linux, but it can be compiled under most operating systems, including Windows.

How to enable mp3 support?


Because of license rights, ffmpeg doesn't include encoding support of mp3 by default.
So we have to recompile it or get a non-free version of ffmpeg.

Install from non-free repository


You can find an already compiled version of ffmpeg in the MediBuntu repository.
It contains a ffmpeg compiled with risky option.

Recompile by yourself


In Ubuntu this can be done quite simply.
Just follow these steps in a shell.

  • Install necessary development packs:
    sudo apt-get install quilt libsdl1.2-dev libogg-dev libvorbis-dev liba52-dev
    libdts-dev libimlib2-dev texi2html libraw1394-dev libdc1394-13-dev
    libtheora-dev libgsm1-dev
    liblame-dev libxvidcore-dev libfaac-dev libfaad2-dev libx264-dev

  • Download ffmpeg sources:
    cd /usr/local/src
    sudo apt-get source ffmpeg
    cd ffmpeg

  • The most important step: enable support for mp3, x264, etc:
    export DEB_BUILD_OPTIONS=risky

  • Build installable debian packages
    sudo dpkg-buildpackage
    cd ..

  • Finally, install all generated debian packages:
    sudo dpkg -i ffmpeg_0.cvs20060823-3.1ubuntu4+medibuntu2_x86.deb libavcodec0d_0.cvs20060823-3.1ubuntu4+medibuntu2_x86.deb libavcodec-dev_0.cvs20060823-3.1ubuntu4+medibuntu2_x86.deb ... 

    Essentially, you have to list all generated debian packages here.

    Maybe you could do something like this:
    sudo dpkg -i `ls *.deb`

Test the non-free version


That's it. Now we can test the installation:
 ffmpeg -i some_of_your_movies.avi -ar 44100 test.flv

This should convert one of your AVI movies into a Flash Video.
ffmpeg shouldn't claim any longer about unknown codec for output stream 0.1 (the audio one).