TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Guide to FFmpeg

985 pointsby buss_janover 2 years ago

37 comments

buss_janover 2 years ago
FFmpeg is powerful technology, yet approaching it can be very daunting. So we decided to create an approachable guide for intermediate devs. Feedback is very much appreciated.
评论 #33772730 未加载
评论 #33771863 未加载
评论 #33773420 未加载
评论 #33774040 未加载
评论 #33771800 未加载
评论 #33777985 未加载
评论 #33810972 未加载
评论 #33778347 未加载
评论 #33784330 未加载
评论 #33772122 未加载
评论 #33771738 未加载
ranting-mothover 2 years ago
Not to criticize the guide, it&#x27;s brilliant! If asked for improvements, I&#x27;d suggest adding a table of contents.<p>Slightly off topic, but the guide does suggests reading time. It&#x27;s interesting that people keep using read estimates for technical&#x2F;scientific&#x2F;professional documentation. This one says it&#x27;s a 58 minute read. Not 1 hour, not 59 minutes, but spot on 58 minutes.<p>Now, I&#x27;m not a novice in using ffmpeg and I think I&#x27;m at least an average person. I can tell you that it would take me a _lot_ longer to read this guide in a meaningful manner.<p>But, a brilliant guide. I&#x27;m definitely going to use it to expand my ffmpeg knowledge.
评论 #33771961 未加载
评论 #33773238 未加载
评论 #33772516 未加载
评论 #33775361 未加载
评论 #33772074 未加载
mickael-kerjeanover 2 years ago
Wow are you the guy from: &quot;Interview with FFMPEG enthusiast in 2022&quot;: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=9kaIXkImCAM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=9kaIXkImCAM</a> ? :)
评论 #33773277 未加载
aargh_aarghover 2 years ago
There&#x27;s a myriad of ffmpeg examples on the web so I wish there was something like <a href="https:&#x2F;&#x2F;explainshell.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;explainshell.com&#x2F;</a> specifically for ffmpeg (including parsing filters). I can imagine it could even include visualization, e.g. a two-way mapping between CLI parameter and on-screen rectangle for picture-in-picture&#x2F;watermark removal coordinates, cut marks in video timeline, tree of input&#x2F;output streams, tree of filters... so a CLI parser+generator.
评论 #33772683 未加载
xenodiumover 2 years ago
While, I’ve been collecting useful one-liners for some time, there was always friction to apply them: search my notes, copy, paste, edit, etc.<p>As of recently, I finally landed on a solution I feel very comfortable with:<p>- Write templated one-liners (could be longer scripts too), automatically replacing which files to apply them to.<p>- Wrap the one-liners with a tiny elisp function with a meaningful name.<p>- From Emacs, I can now easily apply these wonderful one-liners to either the current file or a list of them, without having to remember details nor tweak the commands. Fuzzy searching to apply commands works great.<p>You can see an ffmpeg example in a recent post <a href="https:&#x2F;&#x2F;xenodium.com&#x2F;seamless-command-line-utils" rel="nofollow">https:&#x2F;&#x2F;xenodium.com&#x2F;seamless-command-line-utils</a>
评论 #33772967 未加载
stefanvdw1over 2 years ago
I can only recommend this tool to help you build pipelines in a visual way: <a href="https:&#x2F;&#x2F;ffmpeg.guide" rel="nofollow">https:&#x2F;&#x2F;ffmpeg.guide</a><p>Not affiliated, just a happy user
milesover 2 years ago
Thanks so much for crafting and sharing this guide.<p>Echoing some of the cookie comments[0], another issue with the popup is that in macOS Safari 16.1 with an adblocker extension enabled, the page looks like this: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;0SZRSTw" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;0SZRSTw</a> . As noted in the screenshot, the five various buttons to accept, reject, save, etc. do not work to dismiss the notice.<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33774040" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33774040</a>
评论 #33778125 未加载
scouttover 2 years ago
A guide like this is always welcome. My biggest struggle with FFmpeg was to find clear documentation, tutorials and examples about API usage. All the guides out there (including this one) is for the command line version, or if the tutorial focuses on the API, it&#x27;s probably outdated. Every time I have to go back and do something with FFMPEG I have to just plainly read the code of FFPlay to &quot;catch-up&quot; with the workflow.<p>And don&#x27;t get me started on that time I had modify the FFmpeg libs to provide support and implement an H264 encode&#x2F;decoder on a custom architecture!!
评论 #33772424 未加载
评论 #33772363 未加载
djha-skinover 2 years ago
I&#x27;m on a project right now where I&#x27;m using FFMPeg.<p>It turns out that for the Apple stuff it loses a lot of color information. Compressor captures this color information by using ICC profiles that it generates from (the quick time headers of?) a .mov file in non obvious ways. Gamma, contrast, and chroma are lost in transit.<p>This is perhaps not a huge deal since we&#x27;re dealing with a proprietary file format anyway, but it does mean I had to stop using FFMPeg in the project, which was a shame.
评论 #33774370 未加载
评论 #33778146 未加载
hugsover 2 years ago
&#x27;The term &quot;codec&quot; is a mix of the words &quot;coder &amp; encoder&quot;. Those are the magic parts before and after the &quot;decoded frames&quot;.&#x27;<p>I thought &quot;codec&quot; was a portmanteau of <i>co</i>der &amp; <i>dec</i>oder. A coder and encoder are the same thing.
评论 #33796124 未加载
DrBazzaover 2 years ago
Using ffmpeg to stream for gaming: <a href="https:&#x2F;&#x2F;drewdevault.com&#x2F;2022&#x2F;10&#x2F;12&#x2F;In-praise-of-ffmpeg.html" rel="nofollow">https:&#x2F;&#x2F;drewdevault.com&#x2F;2022&#x2F;10&#x2F;12&#x2F;In-praise-of-ffmpeg.html</a>
评论 #33772177 未加载
评论 #33775875 未加载
slhckover 2 years ago
This is a very comprehensive guide with actually reasonable examples and suggestions!<p>I think there&#x27;s really not much more to add here, because eventually you&#x27;ll be deep in the rabbithole that is FFmpeg, and you&#x27;ll be browsing mailing lists, visiting Stack Exchange, etc. to get help.<p>Cross-referencing the FFmpeg wiki wherever possible would be good, as there is so much outdated information on the Internet, and at least the wiki is a somewhat up-to-date reference.
blueflowover 2 years ago
This is a brilliant way for people to avoid reading the official ffmpeg manpages.
评论 #33772581 未加载
shantnutiwariover 2 years ago
Sorry, I didnt find the guide very useful-- too much info, it looks like its written for PhD students rather than averge users.<p>Sometime ago I bought a book &quot;FFMPEG Zero to Hero&quot; by Nick Ferrano-- I recommdend that instead. The book contains more practical info tahts immeditely useful, but not always easy to find online
评论 #33777830 未加载
bool3maxover 2 years ago
Slightly off-topic: Recently I needed a way to add chapter information to 200 or so local MP4 video files of varying codecs (though mostly H264). It wasn&#x27;t hard to get the job done with FFmpeg, though I was very surprised that adding such simple metadata to an MP4 container, with `-codec copy`, takes a surprisingly long time (around 5 or so minutes for an ~8GB file). I don&#x27;t know why that is, as I am unfamiliar with the MP4 container format&#x27;s internals, though I do assume that no re-encoding&#x2F;transcoding was done (again, due to -codec copy). And it most certainly wasn&#x27;t a simply copy-paste of the video data into a new file either, as that would&#x27;ve been way quicker. Nevertheless I just let the script do its thing overnight.
评论 #33781549 未加载
filmgirlcwover 2 years ago
I really appreciate this guide. I use FFmpeg on the daily and still frequently have to glance at guides and whatnot (for things I haven&#x27;t scripted), to the point that I needed to find a good frontend. The best I have come across, for macOS anwyay, is ffWorks [1].<p>I bought it earlier this year and it has been a game-changer for me when I need to do certain types of conversions that are just cumbersome for me to look up or that I don&#x27;t have scripted.<p>So as much as I appreciate the guide, for anyone (on Mac) looking for a front-end, ffWorks is what you want. Well worth the money for heavy users.<p>[1]: <a href="https:&#x2F;&#x2F;www.ffworks.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ffworks.net&#x2F;</a>
apocalyptic0n3over 2 years ago
I haven&#x27;t read through this entire thing (yet), just skimmed it to get a feel for it. I&#x27;ve been incorporating ffmpeg into projects and using it for personal homelab use for over a decade now and this has to be the most complete guide I&#x27;ve seen on the subject. It&#x27;s extremely thorough but seems to be written in a way that a beginning could pick up and use. Massive props to the author(s) here; this was no easy task and developers everywhere will benefit from it. I&#x27;ve shared it with my team in the hopes that it will make future projects easier.
cyborgx7over 2 years ago
This is all very interesting, but I don&#x27;t want to know all of this information, and I don&#x27;t want to have to know it. What I need is some kind of wrapper with sane defaults, such that when I perform some kind of operation on a video file, I only have to specify the parameters that matter to me. The last time I tried to work like that, the bitrate was unusable afterwards. I don&#x27;t want to have to think about the bitrate to create a clip of a video.
评论 #33772922 未加载
评论 #33772846 未加载
评论 #33842691 未加载
评论 #33772816 未加载
评论 #33772793 未加载
评论 #33772797 未加载
INTPenisover 2 years ago
Hey I love your effort. Unfortunately ffmpeg is not a tool that can be properly demystified in one post. Other&#x27;s have already suggested this but on a desktop browser this guide desperately needs a more visible ToC.<p>Also one thing I did last year was add floating text to videos with ffmpeg&#x27;s drawtext plugin, something I think people often want to do. For example adding reactions, or subs. I&#x27;d very much appreciate more guides on how to do that.
sylwareover 2 years ago
ooof! That&#x27;s really good work. As suggested, a link to a navigation index would be nice. Would make it a separate html page with a big fat link at the start of your guide, or use an html table as layout and no, html table as layout are _not_ harmful.<p>Something which is worth of interest: AMD is supposed to have published AV1 hardware encoding&#x2F;decoding ffmpeg code (this one is &quot;oooof!&quot; too... if it is cross-platform, or at least elf&#x2F;linux).
asicspover 2 years ago
See also: <a href="https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;FFmpeg" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;FFmpeg</a>
naragover 2 years ago
The ultimate guide for me would include how to extract a short clip from a longer video specifying the start time in (minutes:)seconds and the duration or, alternatively, stop time.<p>Actually I created a GUI to do exactly that, calling the ffmpeg executable.<p>So? It doesn&#x27;t work as it should. Depending in what point you start, you will find a very noticeable interval with black video. I do understand why it happens, but that&#x27;s not the point.
评论 #33773024 未加载
评论 #33778788 未加载
评论 #33773279 未加载
评论 #33773014 未加载
评论 #33773018 未加载
jokoonover 2 years ago
I wrote two scripts for ffmpeg, one to concatenate reddit video of different formats, with or without audio, and another to create a 2 by 2 mosaic video with xstack.<p>It works pretty well.<p>Only limitation is caused by python and windows, because my command line is too long (a lot of video paths, and a lot of filters).
oleg_antonyanover 2 years ago
Is there similar guide but for developers, describing how to use libav, up-to-date example audio player, etc?
tartoranover 2 years ago
What I use FFmpeg for is to chop large videos and I love it for that, it’s very fast. But Im no expert so I just created a user friendly batch file to set the in and outs and file input and output and a simple help with examples when I forget the params.
elAhmoover 2 years ago
Maybe slightly unrelated, but I really like the presentation, fonts and design of your website. Could you share more about that?
c120over 2 years ago
Get introduction to ffmeg, but it misses a lot of pro use cases.<p>Mine would be to find out, if ffmpeg can create a chunked stream as an output (basically one like most TV stations use nowadays) which outputs parts and a updates m3u8 playlist with it...
rjzzleepover 2 years ago
Not really related to the guide, but does anyone know how to handle audio pitch when speeding up when using FFmpeg libraries instead of the cli tool?
NaturalPhallacyover 2 years ago
Anyone else get five whole screens (1440p) of nothing but cookie shenanigans?<p>I thought it was the wrong link at first. Clicking reject all does nothing.
Yeahsureokover 2 years ago
Could I recommend a table of contents?<p>It looks great, bookmarked.
评论 #33771797 未加载
frog360over 2 years ago
I recently had to use ffmpeg, and I ended up scrapping it in favor of sounddevice in python. Thanks for the helpful info
nintendo1889over 2 years ago
FFmpeg has the longest man page in existence by far.
zeropover 2 years ago
Is it possible to have FFmpeg in browser (A JS port)?
评论 #33774174 未加载
zeropover 2 years ago
Is there a good FFmpeg front end?
评论 #33774369 未加载
评论 #33778834 未加载
评论 #33774080 未加载
sfmikeover 2 years ago
is there currently a way to remove floating watermarks with ffmpeg?
truth_seekerover 2 years ago
well written blog. thanks for sharing
nuberoover 2 years ago
That article is a far longer joke than the two word classic “Desktop Linux”. Seriously though: good software has a user interface.
评论 #33786493 未加载