Posts Tagged ‘FFmpeg’

New FFMpeg Changes Headers Location; Breaks Stuff

May 19, 2008 Leave a comment

Recently, and it’s hard to say exactly which SVN snapshot this occured in, the FFMpeg project changed the location of a number of its header files. This has caused soem havoc with other applications that use FFmpeg for video decoding or encoding.

Amongst other things, Open Movie Editor complained that certain libraries were not installed, which they plainly were. This could be seen from running a simple “ffmpeg -i” command to see what which libraries FFmpeg had been configured again.

Trying to re-compile Open Movie Editor from source struck some problems, in that OME was looking for FFmpeg headers in the wrong place. To overcome this issue, so that OME would compile and then install correctly, I made the following changes.

The first crash will be with regards to avformat.h in the file nle_main.cxx

and the other two files you need to make some small edits to can be
found in the “src” directory created when OME is unpacked.

There are three files you’ll need to edit in the text editor of your choice:


Open each of those files and near the beginning (around line 35) will be references that look something like this:

#include <ffmpeg/avformat.h>

You’ll need to find where avformat.h, avcodec.h and swscale.h are residing on your machine.

You can do this by using the following command:

>sudo find / avformat.h

On my machine, a build of Debian Lenny, these files can all be found in /usr/local/include

I edited the files so the code looks like this (example from VideoFileFfmpeg.H):

#include </usr/local/include/libavcodec/avcodec.h>
#include </usr/local/include/libavformat/avformat.h>
#ifdef SWSCALE
    #include </usr/local/include/libswscale/swscale.h>

Once you’ve saved those files, OME should now be able to find the FFmpeg header files and build correctly.

Hopefully a new version of Open Movie Editor will soon be available where these issues have been rectified in the source.

FFmpeg: Update Installing on Ubuntu Hardy

May 1, 2008 1 comment

Having recently installed Xubuntu Hardy Heron on a laptop, I also
needed to install FFmpeg. This post is really just a couple of notes
for myself, updating my earlier How-To post regarding installation of
FFmpeg on Ubuntu Gutsy.

New apt-get install line:

sudo apt-get install liblame-dev libfaad2-dev libfaac-dev
libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev libdts-dev
libswscale-dev checkinstall build-essential subversion

Here I’ve added the swscale development libraries. Swscale is used for scaling videos.

you are ever stuck behind a firewall or proxy, especially one that you
have no control over and which does not understand certain SVN
commands, there is a nightly Subversion snapshot available for download
from the FFmpeg website. This alleviates the need to checkout the
source with SVN.

New configure line:

–enable-gpl –enable-libvorbis –enable-libtheora –enable-liba52
–enable-libdc1394 –enable-libgsm –enable-libmp3lame –enable-libfaad
–enable-libfaac –enable-libxvid –enable-pthreads –enable-libx264
–enable-shared –enable-swscale –enable-avfilter –enable-postproc

Here I’ve removed –enable-pp as it is no longer recognised. And I’ve
added –enable-swscale, –enable-avfilter, –enable-avfilter-lavf and

Avfilter is the new FFmpeg library that replaces the deprecated vhook functionality.

One last note to self is to investigate the possibilities of AVIsynth scripting and FFmpeg.

Read more…

Categories: Uncategorized Tags: ,

Kino 1.3.0 Released

February 25, 2008 Leave a comment

Yesterday a new version of popular Linux video editing tool, Kino, was released. The new version is 1.3.0 and contains the following changes:

  • Updated export scripts for FFmpeg changes (x264, mp3)
  • Improved speed on SMP systems by enabling FFmpeg multi-threaded codecs
  • Improved import (DV conversion) progress dialog
  • Added gstreamer-based Ogg Theora to the publishing script
  • Added quality level option to the publishing script
  • Updated Hungarian translation
  • Added Ukranian translation by Yuri Chornoivan

Congratulations to Dan Kennedy and the team.

The new source files can be downloaded directly from here.

Categories: FFmpeg, Kino, Video Tags: ,

Real World Open Source Video Editing

February 7, 2008 1 comment

A short while ago I wrote a review about Open Movie Editor. Essentially this review was written after a couple of hours testing various video clips and assessing the functionality within OME. Now, I can write about what OME is like on a real editing assignment.

Recently I was given a DVD full of PAL DV material and asked to create a compilation from the individual clips. A fun little project that should only take a day or two. Open Movie Editor was the obvious tool for the job.

The good news I can report is that even after 10 to 12 hours of constant video editing, OME is still a very stable piece of software. I only managed to induce two crashes – once when trying to undo multiple edits in a row and once when vigorously moving clips around on the timeline. Other than that, Open Movie Editor was easily up to the task.

I’m not an advanced video editor, happy within my comfort zone using something like Adobe Premiere, but also not using all the intricate features. However, Open Movie Editor does still lack a few basic features, that would have greatly increased my productivity. Changing playback speed of a clip is not possible within OME. I needed to change the framerate of target clips using FFmpeg and mjpeg tools to achieve this effect. While fade transitions are easy enough, I’m sure they could have been even quicker if such a function was built into OME. Precise frame editing, for splitting clips for example, would also make life easier.

There are some really nice features in Open Movie Editor though. Audio automations are a breeze, the media browser window provides easy access to your video library and the list of render options is quite vast – dependent on FFMpeg, Libquicktime and other shared video libraries.

So what did I produce in my 12 hours of work? A fun 4 minute clip, which is still a little rough around the edges, but generally a good laugh. Here’s a link for your viewing pleasure:

Edited in Open Movie Editor, with some clip transformations using FFmpeg and mjpeg tools. Follow this with final transcoding to x264, again with FFmpeg for more finite control, and you have an Open Source Editing project.

The Kapital Moto TV site uses open source products where possible. The server runs on Debian Etch, the site is served with Apache, built largely with PHP and data is stored in a MySQL database. Content is a mix of QuickTime generated H.264 and FFmpeg generate x264 video files. The Flash player is not open source, but is free as in beer.

How-To: Alter Video Speed with FFmpeg and mjpegtools

February 6, 2008 2 comments

Unfortunately my Linux based non-linear editing tool of choice, Open Movie Editor, doesn’t currently support directly altering video playback speed. For example, if you wanted a portion of your new compilation to run at 200% of original recorded speed, it can’t be done within OME. This exact functionality was something I needed for an existing editing project.

After some thought and investigation, such changes can be achieved through using a combination of FFmpeg and yuvfps, which is part of mjpeg tools, to alter the framerate of the desired footage. If your original file is PAL based, with a framerate of 25fps, changing the framerate to 50fps will result in the video running twice as fast, for half as long.

I didn’t initially have mjpegtools installed, but on my Debian based system this was easy enough with

sudo apt-get install mjpegtools

Next, the input video needs to be converted to yuv4mpegpipe format, passed through yuvfps and output to a new avi file. Here’s the command line I used to create a clip at 50fps:

ffmpeg -i input.dv -f yuv4mpegpipe - | yuvfps -s 50:1
-r 50:1  | ffmpeg -f yuv4mpegpipe -i - -b 28800k -y output.avi

Change the 50:1 ratios to whatever framerate you require. e.g. 100:1 for 100fps. Be sure to set the output file bitrate to a relevant quality level. Omitting this flag will result in a poor quality AVI output file by default.

The resulting AVI file was easily played back with Totem, and handled on the timeline admirably by OME.

Thanks to Victor Paesa on the FFmpeg mailing list for pointing me in the right direction.

Some other options to investigate include the new Libavfilter for FFmpeg and converting the original footage to a raw data file, which will lost the audio.

How-To: Extract images from a video file using FFmpeg

February 6, 2008 5 comments

Extracting all frames from a video file is easily achieved with FFmpeg.

Here’s a simple command line that will create 25 PNG images from every second of footage in the input DV file. The images will be saved in the current directory.

ffmpeg -i input.dv -r 25 -f image2 images%05d.png

The newly created files will all start with the word “images” and be numbered consecutively, including five pre-appended zeros. e.g. images000001.png.

From a video that was 104 seconds long, for a random example, this command would create 2600 PNG files! Quite messy in the current directory, so instead use this command to save the files in a sub-directory called extracted_images:

ffmpeg -i input.dv -r 25 -f image2 extracted_images/images%05d.png

Moving on, let’s say you just wanted 25 frames from the first 1 second, then this line will work:

ffmpeg -i input.dv -r 25 -t 00:00:01 -f image2 images%05d.png

The -t flag in FFmpeg specifies the length of time to transcode. This can either be in whole seconds or hh:mm:ss format.

Making things a little more complex we can create images from all frames, beginning at the tenth second, and continuing for 5 seconds, with this line:

ffmpeg -i input.dv -r 25 -ss 00:00:10 -t 00:00:05 -f image2 images%05d.png

The -ss flag is used to denote start position, again in whole seconds or hh:mm:ss format.

Maybe extracting an image from every single frame in a video, resulting in a large number of output files, is not what you need. Here’s how to create a single indicative poster frame, of the video clip, from the first second of footage:

ffmpeg -i input.dv -r 1  -t 00:00:01 -f image2 images%05d.png

Notice that the -r flag is now set to 1.

If you want the poster frame from a different part of the clip, then specify which second to take it from using the -ss tag, in conjunction with the line above.

Lastly, if you wanted to create a thumbnail story board, showing action throughout the entire length of the video clip, you’ll need to specify the output image dimensions. Use the following line:

ffmpeg -i input.dv -r 1 -f image2 -s 120x96 images%05d.png

My original file was 720×576, so the image dimensions are a whole division of this.

Open Movie Editor How-To: Fade to Black Transition

January 31, 2008 1 comment

After my previous overview of Open Movie Editor (OME), I decided to create a small How-To regarding an easily obtainable piece of functionality that’s not yet standard within OME.

Open Movie Editor natively contains only one transition between clips – a simple cross fade. However, one of the most used transitions in video editing is a fade to black. By adding a black still image, between two clips on a single video track in OME, it is possible to generate exactly what you need.

Here’s how by following the steps below:

1. Open your favourite image editor, in this example we’ve used the GIMP.
2. Create a new image with a solid black background, at the same size as your video clips. We’ve used PAL 720×576.
3. Save the image as a PNG, although JPG will also work.
4. Switch to Open Movie Editor and navigate to your footage in the Media Browser window. We’ve previously downloaded two QuickTime clips from stock footage supplier BBC Motion Gallery, to use in this example.
5. Add the first clip to video track one.
6. Add the black still image to the same video track.
7. Add the second video clip to the same video track.
8. Now, overlap the beginning of the black still image with the end of the first clip. A blue area with a red cross through it should appear – this is the length of time that the fade will occur.
9. Adjust the length of the black still image to suit the speed of the fade to black required.
10. Now, drag the beginning of the second video clip over the end of the still image, so that another blue box and red cross appears.
11. Move the timeline marker before the first blue box and test your fade out to and in from black.

Easy! Move the clips, and adjust the length of the black still image until you are happy with the fade.

To make is even easier, we’ve created a screen cast for you to watch, complete with a couple of extra fades created in OME. Don’t adjust your volume, there is no sound.

Get Flash Player 9 to see this movie.

var so = new SWFObject(‘;,’player’,’640′,’500′,’9′);
so.addVariable(“screencolor”, “0x000000″);
so.addVariable(“autostart”, “false”);
so.addVariable(“shownavigation”, “false”);
so.addVariable(“overstretch”, “fit”);

This screen cast was created with RecordMyDesktop, edited with Open Movie Editor, and transcoded into an x264 file, using a custom Perl script to control FFmpeg.


Get every new post delivered to your Inbox.