The shit that’s called ffmpeg

How more stupid these developers can be? FFmpeg has a lot of hype, and yet it’s the most inflexible encoder I have ever seen. There is no “letterbox” option and it doesn’t auto-calculate the height to keep the aspect ratio. You see, I wanted to write a Nautilus script where you simply right click on any video file and it would automatically create the right mp4+aac video file for cellphones. On each case I need the video size to be 320×240, but if the video is widescreen it should automatically create the letterboxing effect and keep the right aspect ratio. But with ffmpeg this is simply not possible. Except the fact that the existing padtop/padbottom options are not useful in my case (because I need the application to decide these values each time automatically), these pads are added to the existing predefined height instead of just pushing down the video (so if you add pads of 32pixels each, you are ending up with a video of 320×304 even if you have defined the size to be 320×240). To use ffmpeg to encode a video for cellphones you have to change its command line EACH time to accommodate the kind of video source file you got! Therefore, I can’t really create a proper generic script for encoding using ffmpeg.

To make things even worse, Ubuntu has compiled their ffmpeg without AAC support, so there is no way to encode compatible videos for your cellphones if are using Ubuntu. I had to recompile ffmpeg to use faac/faad and even fix a compilation error before I stumble on the rest of the problems. Email me if you require the fixed .deb ffmpeg file that has AAC support, I can send it to you.

And don’t get me started about MEncoder. The thing does not even create valid MP4 and AAC files.


Pav Lucistnik wrote on March 16th, 2007 at 3:51 AM PST:

Hehe, that you can’t do basic shell scripting does not mean ffmpeg is bad software.

This is the admin speaking...
Eugenia wrote on March 16th, 2007 at 6:19 AM PST:

What are you talking about? You obviously don’t understand the problem here. The problem is not bash, the problem is ffmpeg for not offering a more automatic solution regarding aspect ratios. It has nothing to do with the language you use to write the script. And I can’t auto-calculate the right WxH because ffmpeg does not provide me with that information. So Bash has nothing to do with the problem. FFmpeg has.

If you are talking about having the user input the source video’s WxH each time (so my script can auto-calculate the resulted video size), this is out of the question. Yes, it can be done, but it is terrible usability. We are talking about batch processing here!

Tom Dison wrote on March 16th, 2007 at 6:57 AM PST:

So how are your C programming skills?

This is the admin speaking...
Eugenia wrote on March 16th, 2007 at 7:06 AM PST:

I have C knowledge but I am not going to fix ffmpeg for them. They should have engineered it right the first time around as this is basic usability for a command line encoder. And “knowing C” won’t help me fix ffmpeg because we are talking about some hard core video knowledge here — that’s the killer. But they have the right video knowledge required (much better than mine), all they need to do is sit down and provide proper letterbox support in the upcoming ffmpeg 3.0.

This is the admin speaking...
Eugenia wrote on March 16th, 2007 at 7:57 AM PST:

Heh, what do you know. Other people have the same problem as well!

This guy emailed the ffmpeg-users list today asking how to do the same thing. And the answer he got was simply the one that he didn’t want: the guy who replied implies that the user must know by heart the source video’s WxH each time before encoding and then calculate manually, which solidifies my opinion that ffmpeg is useless in a batch process environment.

Tom Dison wrote on March 16th, 2007 at 8:06 AM PST:

I predict they will change this soon.

This is the admin speaking...
Eugenia wrote on March 16th, 2007 at 8:13 AM PST:

FFmpeg is a pretty old project. I doubt that they will change it on their own, except if they read this blog post and get pissed off enough to fix it. ;-)

mikesum32 wrote on March 16th, 2007 at 9:13 AM PST:

Couldn’t use another command to get the aspect ratio ? Isn’t that the Linux way ? 10 billion CLI programs that do one thing and they all have different, yet similar options, just enough to be confusing. Use them together and you get it to work eventually, or just give up after hours of trying, and reading the useless man file, if there is one, and it is probably written by someone whose native language isn’t English.

This is the admin speaking...
Eugenia wrote on March 16th, 2007 at 9:19 AM PST:

No, there is no other app that provides that information by supporting reading of as many file formats as ffmpeg/mencoder do.

John Moylan wrote on March 17th, 2007 at 8:06 AM PST:

ffplay -stats videofile.avi
Grab the first few lines of output and kill ffplay ;)

John Moylan wrote on March 17th, 2007 at 8:12 AM PST:

Actually just tried:
ffplay -stats -vn -an videofile.avi
works better as it does not require a kill.

Oh, and ffmpeg rocks.


This is the admin speaking...
Eugenia wrote on March 17th, 2007 at 8:30 AM PST:

That’s hardly an elegant solution.

John Moylan wrote on March 17th, 2007 at 8:45 AM PST:

Might work well enough for a nautilus script though.

This is the admin speaking...
Eugenia wrote on March 17th, 2007 at 9:54 AM PST:

This becomes complicated for no good reason. I like simple things, easy solutions. For example, when I use MediaCoder or QuickTimePro, the letterbox option is there, before my eyes. To do the same under Linux, I have to sell my soul to the devil and write regexp to parse terminal outputs. This just doesn’t do it for me, sorry. Either ffmpeg does the right way or prefer to continue using OSX/Windows to do my job.

John Moylan wrote on March 18th, 2007 at 12:52 PM PST:

The difference is that focus of ffmpeg is to incorporate as many codecs as possible through either
1.) reverse engineering
2.) clean room development from specifications.

They make these codecs available via the simple command line tools or via the more low level C . The API is incorporated into many other third party products .

I belive that the goals of MediaCoder or Quicktime are somewhat different.

The FFMPEG core developers hava made the tools available. And it will probably be up to other developers to use those tools to build a more user friendly GUI or provide a higher level api in python or perl etc.(This has already been done for PHP, although I don’t know how up to date it is).

You can’t compare FFMPEG with Quicktime because it’s like comparing apples and oranges.

This is the admin speaking...
Eugenia wrote on March 19th, 2007 at 7:00 AM PST:

Sorry, but this is not true. Both are encoders. I am not going to split hairs over this.

DavidW wrote on March 22nd, 2007 at 11:20 AM PST:

I know what you mean, it’s a valid complaint against ffmpeg. A pain in the ass. I use tovid with the ffmpeg flag and it autodetects everything including the aspect ratio. It also can do batches so you can just invoke it in one command and walk away. Oh and not useful for you, but it also has tools to generate menus, create the xml for dvdauthor, divide the title into chapters etc etc

I don’t think that ffmpeg was meant for end users also because the devs don’t believe in stable releases.

That being said I like ffmpeg, because it’s fast, and makes good output, but now I only like it when having tovid provide me with the interface.

Comments are closed as this blog post is now archived.

Lines, paragraphs break automatically. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

The URI to TrackBack this blog entry is this. And here is the RSS 2.0 for comments on this post.