In Praise of FFmpeg (drewdevault.com) 81
Drew DeVault, prolific FOSS blogger and hacker behind SourceHut, Sway, wlroots, and many other projects, writes in a blog post: I have relied on ffmpeg for many tasks and for many years. It has always been there to handle any little multimedia-related task I might put it to for personal use -- re-encoding audio files so they fit on my phone, taking clips from videos to share, muxing fonts into mkv files, capturing video from my webcam, live streaming hacking sessions on my own platform, or anything else I can imagine. It formed the foundation of MediaCrush back in the day, where we used it to optimize multimedia files for efficient viewing on the web, back when that was more difficult than "just transcode it to a webm."
ffmpeg is notable for being one of the first large-scale FOSS projects to completely eradicate proprietary software in its niche. Virtually all multimedia-related companies rely on ffmpeg to do their heavy lifting. It took a complex problem and solved it, with free software. The book is now closed on multimedia: ffmpeg is the solution to almost all of your problems. And if it's not, you're more likely to patch ffmpeg than to develop something new. The code is accessible and the community are experts in your problem domain.
ffmpeg is one of the foremost pillars of achievement in free software. It has touched the lives of every reader, whether they know it or not. If you've ever watched TV, or gone to a movie, or watched videos online, or listened to a podcast, odds are that ffmpeg was involved in making it possible. It is one of the most well-executed and important software projects of all time.
ffmpeg is notable for being one of the first large-scale FOSS projects to completely eradicate proprietary software in its niche. Virtually all multimedia-related companies rely on ffmpeg to do their heavy lifting. It took a complex problem and solved it, with free software. The book is now closed on multimedia: ffmpeg is the solution to almost all of your problems. And if it's not, you're more likely to patch ffmpeg than to develop something new. The code is accessible and the community are experts in your problem domain.
ffmpeg is one of the foremost pillars of achievement in free software. It has touched the lives of every reader, whether they know it or not. If you've ever watched TV, or gone to a movie, or watched videos online, or listened to a podcast, odds are that ffmpeg was involved in making it possible. It is one of the most well-executed and important software projects of all time.
Gstreamer anyone? (Score:3)
Re:Gstreamer anyone? (Score:4, Informative)
Gstreamer only because people inexplicably use it rather than ffmpeg directly. It's functionally useless until you have the ffmpeg-gstreamer plugin installed.
Re: (Score:2)
Gstreamer as it's the basis of the only really good UPnP audio renderer (gmediarender) available for headless linux based boxes. But ffmpeg is indeed superb and indispensable and a thing of wonder.
Re: (Score:2)
I'll bite.
Ffmpeg is for analyzing and extracting streams, or encoding and them and putting them in containers. It cuts, joins, rotates, crops, and applies arbitrary filters. It can encode down to a given bitrate, or applying specific preset techniques.
What is Gstreamer for? Realtime encoding (streaming)?
Just a guess: it does less than ffmepg but with better interoperability. Ffmpeg doesn't seem to have an API, since every frontend I know of just invokes the executable. The command invocation isn't even stra
Re:Gstreamer anyone? (Score:5, Informative)
FWIW I invented GStreamer in the first place.
Re: (Score:2)
Thank you, that helps clear up my ignorance! Indeed I can't imagine using ffmpeg for the sorts of things you described. Ffmpeg seems to be more of a pocket calculator--very easy to use for a relatively narrow use case.
Re: (Score:2)
How is this not modded +11 Extremely Informative?
patents (Score:2, Interesting)
I'd love to be able to use ffmpeg for video conversion, but since I'm in the US, I worry that I'd be infringing on patents, so with regret I use (licensed) Adobe stuff instead. (Yes, I know that no one will come after me for private non-commercial patent infringement. But my moral beliefs require obedience to the law when the law is not fundamentally unjust.)
Re:patents (Score:4, Insightful)
Moral qualms about patent infringement regarding your own personal use? That is out there.
Let's say somebody had a patent on some aspect of an electronic picture frame. If you implemented such a "picture frame" using a Linux box and an old display, would you say you have violated some moral code?
Re: (Score:1)
It depends. I might be willing to judge for myself that a picture frame patent is invalid on grounds of obviousness, and any courts that ruled the patent valid were just interpreting the law wrongly. But the compression algorithms for video are not obvious in the same way.
Almost two decades ago, I actually signed onto an MPEG LA license so I could legally use xvid for personal projects. The license requires no royalties under some number of encoder/decoder units (I think it's something like 10,000 or 100,00
Re: (Score:3)
Correct. A patent is effectively "a license to sue".
It is up to the patent holder to take a suit against anyone who infringes so in that regard it is more like a civil suit than a criminal offense.
Re: (Score:3)
Re: (Score:1)
I would recommend installing the update to your moral code that identifies software patents themselves as unjust law.
Yeah cool let's just pick and choose which laws we want to follow, the ones we don't like we'll just deem "immoral".
Re: (Score:3)
Re:patents (Score:5, Funny)
But my moral beliefs require obedience to the law when the law is not fundamentally unjust.
In this case, you have my permission, my son. I really couldn't be bothered to give a fflying ffuck about this.
Re:patents (Score:5, Insightful)
Re: (Score:3)
You believe that patenting mathematics is "not fundamentally unjust"!?
Seeing as how **anything** can be described with mathematics my threshold is likely different from yours. Do I think one-click shopping should be patentable? No. A novel video compression algorithm? Possibly. Do I think those being broken down to ones and zeroes matters in the slightest? No.
Re: (Score:2)
how **anything** can be described with mathematics
Except it's not about "describing X with mathematics". It's about certain things literally being mathematics.
Re:patents (Score:4, Insightful)
Yes, I know that no one will come after me for private non-commercial patent infringement. But my moral beliefs require obedience to the law when the law is not fundamentally unjust.
Patents exist to protect the commercial interests of the holder. There is nothing morally wrong about infringing patents privately (note I said Privately, not no-profit). Private patent infringement is insanely prolific and yet private people getting dragged to court is vanishingly rare (largely because the potential payout of private scale infringement is less than the cost of bringing a lawsuit in the first place).
If you support the suppression of private, non-commercial use of publicly published methods and designs, *that* my friend is morally apprehensible.
Re: (Score:2)
Re: (Score:2)
and anyone else is allowed to now copy that invention for personal use (not for profit of course).
False. Information is provided so you know what *not* to do. Legally personal use is still patent infringement, there is no language in patent law that applies it exclusively to commercial use or carves out exceptions for private use. The confusion is that practically it is simply not enforced.
Here's the exact language from Section 35 Code 154 (note the use of commas showing that "offers for sale" is not required, the clause applies simply for making something or using something):
makes, uses, offers for sal
Re: (Score:2)
Re: (Score:2)
Bro, patent and copyright law, as they are today, are fundamentally unjust. The social contract has long been broken.
Re: (Score:2)
How is that law not fundamentally unjust? It disproportionately rewards the owner of an idea and retards progress in the art simultaneously
Re: (Score:2)
> with regret I use (licensed) Adobe stuff instead ... my moral beliefs require obedience to the law
Adobe demanded Dmitry Sklyarov held in prison "for" describing their weak security, a blatant kidnapping conspiracy in violation of the First Amendment, the highest law in the land.
Paying Adobe is far more of a moral problem than wondering if ffmpeg violates any patents that should have been granted (despite a lack of prosecution).
Print 'em on the money (Score:1)
Re: Print 'em on the money (Score:2)
This might be a bit of an overstatement, (Score:4, Insightful)
Re:This might be a bit of an overstatement, (Score:4, Interesting)
It has certainly been used on all the render farms I've touched over the past 20 years. Love it or hate it - sometimes both at the same time - it's the most efficient way to process large volumes of frames and video automatically in a production environment.
I'm sure there are plenty of shops that don't use it at all, but then you find out that they sent half-a-dozen shots to an FX house for cleanup, and that shop didn't use ffmpeg directly on the footage, but they do happen to use Shotgrid for production management, which uses ffmpeg on the backend to generate web previews... and there you are, ffmpeg was involved in making it possible.
Re: (Score:2)
FFmpeg isn't just a CLI utility, it is a library with a CLI front-end.
Editing is just one step of the process. Trnsport including OTA broadcasting also involve compression in various forms.
Re: (Score:3)
I think the point the OP was making is that commercial software used in video production usually uses licensed codecs and libraries, not ffmpeg. Companies involved in broadcasting will definitely use hardware codecs which are licensed. Companies involved in streaming largely license codecs and write their own to suit their specific hardware in the name of efficiency (or in some cases even design their own hardware ASICs).
Same with playback software where most software and OSes ships with a subset of license
Re: (Score:2)
But it is used more than they think, as a linked library. For example, Adobe has it in their 3rd-party license notice for their products.
Re: (Score:2)
But it is used more than they think, as a linked library. For example, Adobe has it in their 3rd-party license notice for their products.
Indeed it's linked in quite a bit of 3rd party software. But the statement in TFS is not correct. Adobe may have ffmpeg in their 3rd party license notices, but Adobe Media Encoder does not use ffmpeg for any commonly used formats in favour of their own licensed codecs. Ffmpeg is largely used by AME to read non-standard material and convert it to something else. That's in Adobe's own manuals. Can't add a file to Premier? Open it in AME and convert it to raw or something really high bitrate.
But if you're a vi
Re: (Score:2)
That makes sense. Adobe's license statement has everything but the kitchen sink in it.
Re: (Score:1)
It's not an overstatement at all. Some of those tools turn to commercial codec manufacturers like MainConcept. Often better quality (visually and in compliance), faster and no OSS obligation, plus customer care services.
Re: (Score:2)
Re: (Score:1)
Doesn't prove anything. The commercial vendor (mentioned elsewhere) that provides AVC and HEVC codecs to Adobe isn't listed, yet you'll find their libraries if you dig through a Premier Pro or Lightroom installation for example. You have no idea how they're using FFmpeg either - perhaps only for ingest of certain lesser formats or demuxing (although not MXF based on the MOG reference). FFmpeg certainly won't be used for specialized professional camera cases that might include HEVC 4:2:2 for example, whic
article is not correct (Score:2)
This statement is not true at all: “Virtually all multimedia-related companies rely on ffmpeg to do their heavy lifting.“. These are the services that most companies that don’t do in-house / hardware encoding rely on.
Neither AWS Media Convert or Bitmovin use ffmpeg for encoding or packaging. ( Although it is used for decoding various input files. )
Re: (Score:2)
so you mean they're using it in a fundamental step in their business? tell us again about how they're not using it to do "heavy lifting"
Pff nevermind FFmpeg (Score:5, Funny)
Real power users do their video editing in Emacs.
Re: (Score:2)
Real power users do their video editing in Emacs.
I'm a *long* time Emacs user and have actually used it to edit strings in executables and the "magic" line various binary files ...
It's great for reducing screen recordings on Macs (Score:2)
If I record a 45 minute lecture on my Mac using the built-in recording application (I have a M1 air) I get a video in excess of 1 GB. ffmpeg reduces that by an order of magnitude, with a very simple terminal command. And I'm not an expert on video editing or using ffmpeg at all -- I bet others could do better.
Re: It's great for reducing screen recordings on M (Score:3)
Theres no such thing as an M1 Macbook Air, did you mean the Apple M1 Macbook Air?
Re: (Score:3)
Depends how heavy (Score:5, Informative)
Re: (Score:2)
Speed, HRD compliance, standards compliance, professional camera compatibility, OSS obligations, etc, all points where FFmpeg (or rather the codecs it uses) falls down to some degree. Some of the codecs like x264 have excellent quality, but aren't so fast, and others like x265 require a much higher bitrate to achieve the same quality as the commercial codecs. Need help tuning the codec or advice about a deployment or integration? Some of the commercial vendors have that too.
Re: (Score:2)
At my somewhat less profitable employer, we do not use ffmpeg in our end products. We write our own encoding algorithms, we have a barrage of picture processing mechanisms that enable a picture to just look better at a given bitrate. ffmpegs output does not come close to what we produce. You can throw it at a PSNR or SSIM or whatever metric you want, we will win.
ffmpeg is used on the dev side, and I use it to slice up video on my laptop, just because I don't always want our software on my laptop.. (I did
Re: Depends how heavy (Score:1)
Re: (Score:1)
Re: (Score:2)
Re:Depends how heavy (Score:4, Interesting)
Re: (Score:1)
And yet, they failed at naming (Score:1)
Hip Hip, Hooray (Score:3)
From a professional perspective, I've been using ffmpeg (and before that transcode and ffmpeg) to record audio/video in a medical school's 4 lecture halls in 30-minute segments, every day, for about 14 years straight and then later intermingling the recorded videos with the room scheduler to deliver automated videos of the lectures to medical students. With the exception of occasional video being lost (probably because of drivers locking up the feed), it has been pretty solid. Whatever the needs are (resizing, clipping, conversion, audio extraction, superimposing, etc), the winning factor is that EVERYTHING I need to do I can do on the command line and in an automated fashion. From that point, ffmpeg is what makes it a winner for me.
From a personal perspective, I played a lot more with it when I used to carry around an iPod 5, an Argos, and stuff from before. But any time I need to do something with a video or audio file, I usually start (end usually end) with ffmpeg. It is truly a great, versatile piece of FOSS.
Sure, there some ridiculous hyperbole there... (Score:3)
But, regardless, ffmpeg is certainly a great tool that makes a lot of my personal projects much easier (or maybe even possible at all).
Re: I never figured out how ffmpeg handle copyrigh (Score:2)
Re: (Score:2)
Who's "we?" And what exactly are these video technologies that were not developed?
Clearly the convenience of streaming video combined with draconian DRM backed by encryption has pretty much won the day. So I'd say video technologies have clearly developed and become incredibly robust and mature, and very much serve the interests of the copyright cartels. So I have no idea what you're going on about. If you rejected developing video technologies, you've clearly lost out.
Not really sure where you were goi
The whole video thing is a mess (Score:2)
Compare:
ffmpeg -f lavfi -i color=0x008000:s=400x576 -crf 0 -vcodec libx264 -t 5 -y out1.mp4
ffmpeg -f lavfi -i color=0x008000:s=400x578 -crf 0 -vcodec libx264 -t 5 -y out2.mp4
At least on my setup, the green is darker than it should brighter if the height is 578 or greater.
Makes the whole format look like a complete mess.
ffmpeg runs on Mars (Score:3)
According to an interview with one of the Ingenuity team members, ffmpeg is on the Ingenuity helicopter on Mars and is regularly used (via shell scripts uploaded from earth) to process image frames into compressed video sequences which are then downloaded to the Perseverance rover and eventually sent down to Earth. I assume that full frames get downloaded eventually as well. The ffmpeg videos are probably more for previewing the footage. Pretty neat how they utilize Linux and all the bundled utilities to great effect, including remote shell access.
Re: (Score:3)
Of course. When spending $2.4billion you don't want to waste needless dollars on an MPEG-LA license ;-)
Great... (Score:2)
Re: (Score:1)
ffmpeg is a program - not a format.
you can't rip a DVD to a program.
you can however use a program to rip a DVD.
no ffmpeg can't "rip" a DVD - just encode.
yes it can obviously encode to audio as well.
Re: Great... (Score:2)
danger (Score:2)
It's dangerous if everyone relies on the same single point of failure. Diversification is stability.
ffmpeg has nice software architecture (Score:1)
ffmpeg has nice software architecture and programming style.
Example alp.c
https://git.ffmpeg.org/gitweb/... [ffmpeg.org]