Video Editing Magic with ffmpeg
Non-linear video editing tools are great, but they're not always the best tool for the job. This is where a powerful tool like ffmpeg becomes useful. This tutorial by Elliot Isaacson covers the basics of transcoding video, as well as more advanced tricks like creating animations, screen captures, and slow motion effects.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Validate an E-Mail Address with PHP, the Right Way
- New Products
- Developer Poll
- Tech Tip: Really Simple HTTP Server with Python
- direct cable connection
22 min 22 sec ago - Agreed on AirDroid. With my
32 min 38 sec ago - I just learned this
36 min 48 sec ago - enterprise
1 hour 6 min ago - not living upto the mobile revolution
3 hours 58 min ago - Deceptive Advertising and
4 hours 33 min ago - Let\'s declare that you have
4 hours 34 min ago - Alterations in Contest Due
4 hours 35 min ago - At a numbers mindset, your
4 hours 36 min ago - Do not get Just Almost any
4 hours 40 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
thank you so much! you just
thank you so much! you just made my day. i've fiddled on and off with linux video tools for several years now and only tonight after watching this video did i get them to do the few simple tasks i needed them to do.
alternatively, i could have spent several years reading the manuals, because that's how long it would have taken to slog through all those barely-useful, arcane options.
Nice nice nice
After working very slow foreword with ffmpeg for 2 years this 10 minutes ware pretty mind blowing :-)
ffmpeg split screen
hi -- thanks for the great tutorial! Can you think of any way to take two video files and create a split screen single video file?
you mean join 2 clips into 1
you mean join 2 clips into 1 or display 2 video clips on the screen at the same time?
i used avisynth to display 2 clips on the screen at the same time, but you need to resize both clips smaller to fit into the screen.
if you want to join clips together, i think you got the "cat" command. then re-encode the file again.
i am playing with ffmpeg for a while, if you need help, i'm pleased to help.
This is completely insane ....
.... creating a video about UNIX commands.
You cannot copy&paste them.
The room is far too small for longer commands.
You cannot associate the explanations to them.
There cannot be links to the reference manual.
The video is zig times larger than an HTML tutorial.
Yeah, and Google will not be able to find the keywords.
\rho
i can help with some of
i can help with some of ffmpeg options if you need.
This is completely insane...
... complaining about someone making a vid tutorial.
Many people including myself have clearly found it helpful.
Videos are more fun to watch than text tutorials are to read.
Seeing instant examples of the use of the commands is helpful.
No one forces you to watch the vid if you don't like it.
Different people like different media for learning things and it's sad that you can't handle this fact.
Yeah, and Google does find the keywords.
\gtfo
Thanks
Hi there Elliot,
Excellent video and 'how to'.
I'm created a link from my (slightly better than 'under construction') site www.youcantdothatinlinux.com and am about to enter a comment on my blog, which is hosted by your Linux Journal colleague, Marcel Gagné, at his www.cookingwithlinux.com site.
Again, thanks for the great 'how to'.
Regards,
Patrick
great demo
Just wanted to say thanks for doing this -- it was great !!!
Operating system ?
Hello !
After watching this great video , I want to ask one question :
Which is the best operating system for FFMPEG and all the libraries to get best performence ?
I have just tried Fedora core 6 !
can u please suggest me which os you are using ?
:)
maybe the ffmpeg creators got
maybe the ffmpeg creators got the answer :D
ffmpeg performance
Of all the things that could impact the performance of a tool like ffmpeg, the operating system probably matters the least. Much more important is just the hardware you are using: the processor(s), the hard disk and the RAM. I use Vector Linux, but any distribution will work fine. You can even use windows if you really want to.
script for auto fade transition
This video is great, and it make me think that it is possible to do something I've tried in the past with no success. I would like to create a script that will take all the video clips in a fold and put them together with a one second cross-fade transition between each.
Does anyone know how to do this?
i used Avisynth to do that.
i used Avisynth to do that.
script
OK, I think I found something that sort of works. The code for the script is here:
http://dark-code.bulix.org/kdqxmw-67863 (with syntax highlighting and line numbers)
http://dark-code.bulix.org/kdqxmw-67863?raw (without syntax highlighting and line numbers)
Before you can run the script you need to patch your ffmpeg with the following:
http://dark-code.bulix.org/x6iy8f-67862?raw
which is an ever so slightly modified version of the patch on this page:
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-October/017666.html
After patching the ffmpeg source tree (make sure the resulting pip.c file ends up in the vhook directory), you will need to find the line in your Makefile that looks something like this:
BASEHOOKS = fish null watermark
and change it to:
BASEHOOKS = pip fish null watermark
Then, before the script will run, you need to take all the videos you want to concatenate together and turn them into .mpg files with the same dimensions and frame rate. Then, you need to open up any image editor and create an all black image with the same dimensions as your videos. The script will print out usage information if you execute it with no arguments. Here is an example of how to run the script:
$ ls
video1.mpg
video2.mpg
video3.mpg
all_black_320x240.png
fade.sh
$ OUTPUT_FILE="final_video.mpg" BLACK_PICTURE_FILE="all_black_320x240.png" FADE_FRAMES="25" ./fade.sh video1.mpg video2.mpg video3.mpg
And that's it. Please note that this script doesn't exactly "cross-fade" the videos... the transition is "fade to black," but it might work for some things. As far as I can tell a true cross fade is not possible. I know this is not pretty, please someone improve it :-)
Watermarking
Hi there. Would you know how to watermark videos using a current version of ffmpeg? I'm finding that -vhook isn't working for me.
Cheers
daBee, Toronto
Script
I had thought that this was not possible (imlib2 only allows changing the opacity of text), although I think I might have found a solution for you. I'll try it out later today and let you know if it actually works :)
Thanks!
This was really useful, thanks for putting it together!
Gracias
Your tutorial is clear, bright and very useful. I expected to see more thankyou comments in this place, but I'm surprised. I say "THANK YOU." This is something I've been searching for since I discovered ffmpeg as a great program. You explain things ans stuff perfectly. Keep on with your excellent work!
Re: Gracias
You're welcome, I'm glad you found it useful.
hyphen target
That's a great find. I never knew about the -target parameter.
+5
Wow - +5 geek points for algorithmic spotlight animation from the command line.
Cool.
How many geek points do I need before I can trade them in for some new hardware?
Speaking of Video Editing...
What software do you use for video editing, screencasts, and showing the highlights on the video you created today?
From your tutorial I can see that it's totally possible to place fading highlights on a still image and cat a bunch of mpgs together... but I'd prefer not to do that to create my own.
:-D
The non-linear editor I use
The non-linear editor I use is cinelerra-cv. It works great. Although if you are going to be expanding still frames into movies (like I had to do with the "highlighting") I would do the expanding in ffmpeg. Otherwise you'll spend unnecessarily large amounts of time zooming in and dragging then zooming out and dragging some more etc. etc. to get the still frame expanded to the right length. The highlighting is just making two still frame movies (one highlighted and one not) and ramping the opacity between them.
For screen captures I usually use pyvnc2swf and then jump through some hoops to get it formated in a way that can be combined with other video clips. If you don't want to deal with that you can use recordmydesktop, which is also very good and much easier to use. Some people like xvidcap but it is not functional at all on my box (1.46Ghz Celeron Laptop.), it needs much more juice than my machine can pump out.
LiVES
Great movie !
Just so you know, LiVES has a tool for generating clips from still images (Tools/Generate/Generate clip from image). You might find it easier to use than cinelerra.
And btw, LiVES also uses ffmpeg for decoding/encoding videos.
http://lives.sourceforge.net
ffmpeg document can show you
ffmpeg document can show you how to convert images into a clip
Still images to video
You can also create raw DV footage from still images using image2raw.
http://ccrma.stanford.edu/planetccrma/man/man1/image2raw.1.html
Here's an example from the page:
****************************************************************************
To encode a sequence of jpegs as PAL Raw DV while maintaining the
aspect ratio of the images, use:
image2raw -a *.jpeg > file.dv
To do the same thing with NTSC, use:
image2raw -n -a *.jpeg > file.dv
****************************************************************************
I'm not associated with the application but have found it very useful.
BTW, I'm currently developing a site (www.youcantdothatinlinux.com) to present useful video editing information, hints and tips and provide links to sites, like this, which contain great information about video editing on the Linux desktop.
Like many others, I've spent long hours on the 'net looking for help, hints and 'how tos' to improve the videos I make.
I'd appreciate any information or links to sites people have found useful to help make my site more productive and helpful to others.