Showing posts with label video. Show all posts
Showing posts with label video. Show all posts

Flash Video in Linux and Webcam

You also experienced problems when trying to use a webcam from a flash application in your Firefox browser?
It claimed about not being able to detect the cam, whereas VLC finds and uses it perfectly.

Well, there's a known compatibility limitation between the underlying video-for-linux (v4l) layer.
Modern Linux systems use version 2, whereas the Flash applets seem to be comfortable only with version 1.

There's a possibility to force Firefox to use the version 1 of v4l, by launching it this way:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so firefox &

Now the Flash applet should be able to detect and use your webcam.

More details can be found in this article I found.

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

MPEG-2 Video Support missing in ffmpeg

Today I tried to encode a MPEG-2 video in Ubuntu 8.10 (intrepid) with the following instruction:
ffmpeg -i in.avi -vcodec mpeg2video -r 25 -s pal -vb 2048 out.mpg

ffmpeg blamed about not being able to encode to mpeg2video.
ffmpeg -formats | grep mpeg2video

gave
 D VSDT mpeg2video
as result, where the E is missing which would indicate the encoding support.
Don't know when exactly this support got lost (ffmpeg also disappeared from Medibuntu repository), but after some investigation I found the solution.
You have to install different packages which include this video codec.

Install instructions


You need to have the multiverse repository enabled (see this post about how to do this from the command line).
sudo -v
sudo aptitude install ~nlibav.+-unstripped.+

If you already have installed the stripped packages, you'll be asked to remove them as they are in conflict with the unstripped one.
Now, the previous instructions give this output
 DEVSDT mpeg2video
and encoding to MPEG-2 works fine.

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

Media Player Classic

Wikipedia
Media Player Classic (MPC) is a compact media player for Windows. The application mimics the look and feel of the old, light-weight Windows Media Player 6.4 but integrates most options and features found in modern media players.

In conjunction with the Combined Community Codec Pack (it's included here), it should be your first choice for playing any multimedia file on Windows and not that overblown WMPlayer included in that OS.

Quicktime Alternative

Wikipedia
Very similar to Real Alternative, QuickTime Alternative is a trimmed down version of QuickTime that contains only the essential components needed for playing QuickTime content that is embedded in webpages.

Real Alternative

After having installed Combined Community Codec Pack on your fresh Windows System, you may stumple upon some real video files which don't play back (f.ex. Real Video 4.0 format isn't supported by ffdshow from that codec pack).

But there's still no reason to install the oficial Real Video package, which clutters your system with unnecessary stuff (that codec really sucks, go for x264 instead).

Wikipedia
With Real Alternative you can play Real Media files without RealPlayer.
The pack can be used with any DirectShow-enabled media player, such as Media Player Classic, which is included as part of the package.
As you already will have installed the CCCP, you can just install the Lite version, which doesn't include Media Player Classic.

Real video on Ubuntu

Unfortunately, I stumbled upon some video files using the RealVideo 4 codec and totem claimed about an unknown codec.

RealVideo is really outdated, you should use h.264 codec for video encoding instead, but in case you have the same trouble, just go and install the w32codec package from MediBuntu.

Totem now recognizes the codec and can playback such files perfectly.

MediBuntu

Medibuntu (Multimedia, Entertainment & Distractions In Ubuntu) is a repository of packages that cannot be included into the Ubuntu distribution for legal reasons.

Its main focus is on multimedia support, something similar to the Combined Community Codec Pack for Windows.

The most interesting feature is a full version of ffmpeg (including MP3 and x264 encoding).

More help on adding the repository and installing individual packages can be found in the Ubuntu online help.

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.

Combined Community Codec Pack


Combined Community Codec Pack is a DirectShow filter pack for Windows systems.

It covers a huge amount of video codecs and filters, and as far as I know the only one that officially is supporting the Matroska format (I like this one especially).

It is also unofficially endorsed by On2, the makers of the VP series of codecs (VP3, VP6, VP7) as a reliable codec pack to use for decoding video.

Also recommended by a large number of anime fansubbing groups, this filter pack is a must to install into a fresh Windows copy.

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).