Guide to FFmpeg
img.ly
img.ly
Someone should do a gui for common tasks it can do line there used to be the Zenmap gui for nmap.
(Learning how to do those sorts of simple guis quickly in python of something is another holiday todo, if anyone has suggestions on that - all my tools thus far are gui based and I need to make sure as many folks as possible use them.)
Here's the script I cobbled together from various internet searches for the video-to-gif one, it works well enough for that purpose and all you have to do is remove the video-to-PNG bits at the start.:
https://gist.github.com/JobLeonard/5f99b712ba77b7aa82696c136...
The goal is gonna be to have something where I can give it units of time as arguments and do clips. So for example, you could give it a dot mkv and say from 30 seconds in to 300 seconds in, take that into stills then create a GIF... or an aPNG but... I'll take a look, play around, I need to learn to read undocumented code better this will be a good exercise since it's not some possibly zero day malware that didn't get past noscript like the last time I did that...
(But to swing it back to graphics: there a reason people don't use apng more? The reason I got ages ago is PNG is more for line drawings, not raster images like what you'd normally use a JPEG format for, but it's my understanding you can play with settings and get a similar level of compression without the patent encumberment of things like GIF with aPNG, and that it's supported by pretty much every browser except for... [checks wikipedia] Internet Explorer[1]?)
Anyways TL;DR: sorry to wall of text you, I'm pounding caffeine and reading the news and jumping between several projects at once -- thanks for the code, I'm going to take a look later -- right now gotta switch locations in ~10 minutes like I'm a Tor circuit ;-)
"HandBrake uses FFmpeg under the hood and generally can open whatever FFmpeg will, in addition to disc-based formats like DVD and Blu-ray." Via
https://handbrake.fr/docs/en/1.3.0/technical/source-formats....
Shameless plug: a while ago I wrote a simple Python script to remove silent parts from video using ffmpeg, which AFAIK it doesn't do out of the box:
https://github.com/bambax/Remsi
It might be helpful to others.
As soon as that worked I wanted more - mostly just really wanted the process to be interactive and real-time, instead of the run-check-tweak-repeat cycle of using a script.
So I ended up down the rabbit hole of building a video editor instead of making screencasts, and now Recut exists (https://getrecut.com).
It’s basically an interactive silence remover. I still haven’t finished those screencasts but now I have an editor haha. While it’s pretty basic, it’s saving folks a bunch of time, and there’s lots more cool stuff I want to add between automations and basic manual editing features.
Your're a hacker role model.
It's for videos you make yourself, to remove silent parts automatically. In interviews for example, it's useful to simply remove silences.
I mostly interpret this as ‘see me see me - I’m good!’ in stead of ‘let me try to educate you about this subject’.
All the natural pauses between sentences gives a much better and natural flow.
This also includes ‘oups I made a mistake .. and fixed it like this…’
Just like the line breaks in this comment serves a purpose;-)
One great example of a really good tutorial is Eivind Fonn’s Spacemacs ABC videos: https://youtu.be/2y9NLIbNf_I
Here’s my worst example of how not to teach: https://youtu.be/qtIqKaDlqXo
This series is also bad as there is way too much zoom in and out (which distract all but the presenter!)
A bunch of non-breaking quick cuts is of course jarring and could be better, but what you describe with "mistakes and all" is too far down the other end in my mind. I would not want to sit through someone having to backpedal like that.
But to each their own, we all learn differently.
> Feedback is very much appreciated.
Nothing about captions that I could find quickly, which seems like an oversight.
proof: they've had plenty of time, and even browsers that claim to be public services can't even keep the APIs stable for cookie/storage control.
To get rid of the cookie consent in this case,
curl https://img.ly/blog/ultimate-guide-to-ffmpeg/|sed 's/<div class=\"cke-overlay\">/<!--&/;s/<main class=\"main u-relative \">/-->&/' > 1.htm
firefox ./1.htm
Another way is to use the AMP URL: links https://img.ly/blog/ultimate-guide-to-ffmpeg/amp/
AMP actually looks great in a text-only browser such as links.It may also be possible to remove a <div>-based cookie consent using a browser Add-On like uBlock Origin.
If it were up to me, cookie consents would be done via HTTP headers. The user could simply set their client to send an HTTP header indicating no consent. Something like
Cookie-consent: False
I use a localhost-bound forward proxy to selectively send cookies where they are actually needed. Thus it is not browser-specific. It works with any client, e.g., netcat.(MOV in fact does support this, but ffmpeg doesn't play it back properly.)
Can't repro here.
Commands:
ffmpeg -ss X -i INPUT -c copy -t 10 test.mp4
ffplay test.mp4
where X is not a KF time. Plays from X with audio in sync for 10 secs.As far as feedback goes, I noticed when running through the guide that the following command is missing an -i flag: ffplay -vf "drawtext=text='HELLO THERE':y=h-text_h-10:x=(w/2-text_w/2):fontsize=200:f
I've already learned a lot from the ffmpeg concepts section. Appreciate it.
Slightly off topic, but the guide does suggests reading time. It's interesting that people keep using read estimates for technical/scientific/professional documentation. This one says it's a 58 minute read. Not 1 hour, not 59 minutes, but spot on 58 minutes.
Now, I'm not a novice in using ffmpeg and I think I'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.
But, a brilliant guide. I'm definitely going to use it to expand my ffmpeg knowledge.
I agree the reading time does not really convey too much useful info, the blogging platform is designed for simpler and shorter posts. Maybe a replacing it with a wordcount would be better.
if (mins < 4) return "a couple of minutes"
if (mins < 8) return "five minutes"
if (mins < 12) return "ten minutes"
if (mins < 18) return "quarter of an hour"
if (mins < 25) return "20 minutes"
if (mins < 40) return "half an hour"
if (mins < 50) return "45 minutes"
if (mins < 70) return "about an hour"
if (mins < 100) return "hour and a half"
if (mins < 250) return "a couple of hours"Also, is the "couple of hours" estimate being off by more than a factor of 2 a typo, or are you just trolling at that point?
I wonder if that is a purposely value, trying to use the same psychology as Supermarkt prices, where they say "0.99" rather than ""1.00"?
In my opinion the right approach however is to have a clean layout, where my scrollbars gives me a good estimate on the length, so I can make my estimate based on my reading speed and experience. But yeah, ads and other stuff make that of course impossible.
And it's definitely better than "number of words" or "A4 pages", since I have no idea how fast average person reads.
One can simply look at the right-hand-side of their browser window and see the scrollbar height to gauge "accurately enough" whether it's long or short.
More to the point, I would expect anything purporting to be an "ultimate" guide to ffmpeg to be a massive time sink that simply can't (and shouldn't) be ingested in one sitting. It's either going to be incredibly dense or it's going to leave out innumerable details, leaving many things implicit. Don't get me wrong, there is nothing wrong with those approaches, but it means that "how long" it takes to read will depend on the reader and what they actually end up reading.
If you're on a desktop computer then the top right has a floating grey "On this Page" which lists the section headers.
There's no numbering or sigils, which might make it hard to use effectively as a TOC.
I believe the way all of these reading time estimates are calculated is a simple `wordCount / averageWordsPerMinute`.
As of recently, I finally landed on a solution I feel very comfortable with:
- Write templated one-liners (could be longer scripts too), automatically replacing which files to apply them to.
- Wrap the one-liners with a tiny elisp function with a meaningful name.
- 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.
You can see an ffmpeg example in a recent post https://xenodium.com/seamless-command-line-utils
Not affiliated, just a happy user
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: https://imgur.com/a/0SZRSTw . As noted in the screenshot, the five various buttons to accept, reject, save, etc. do not work to dismiss the notice.
And don't get me started on that time I had modify the FFmpeg libs to provide support and implement an H264 encode/decoder on a custom architecture!!
I've found the ffmpeg documentation does a good job as a technical reference. The problem is that most people reading it are actually expecting a 'what options will fix my video' how-to guide.
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.
This is perhaps not a huge deal since we'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.
That's not really a knock on it, ffmpeg has some pretty reasonable defaults all around. However, there's a billion codecs and use cases that make it's job challenging.
How do I take a sequence of 5000 pngs, apply a 5 frame crossfade between each one, and then output the resulting mp4 ?
I spent days on trying to figure it out, and in the end I had to generate the xfade frames with imagemagik, then I had to split the rendering into separate mp4s and stitch them together.
I just couldn't get it to slurp in a big list of files and do the filter all in one go. I can't exactly remember what went wrong when I tried to ask it to render the ~25000 frame from imagemagik.
I guess this fits your definition of "not do it out of the box".
This will take longer obviously but a two step process where you export to an image sequence (like say 16 bit tiff) is a pretty fool proof way to retain colour information. And true pro industries like the VFX industry pretty much exclusively use image sequences (because they are just superior in everyway). Although they would be using either DPX or EXR sequences.
I thought "codec" was a portmanteau of coder & decoder. A coder and encoder are the same thing.
Like you, it used to be just a handy tool to convert stuff.
But being able to process video straight inside the browser literally blew my mind
I think there's really not much more to add here, because eventually you'll be deep in the rabbithole that is FFmpeg, and you'll be browsing mailing lists, visiting Stack Exchange, etc. to get help.
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.
Sometime ago I bought a book "FFMPEG Zero to Hero" by Nick Ferrano-- I recommdend that instead. The book contains more practical info tahts immeditely useful, but not always easy to find online
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't have scripted.
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.
Sun May 30 11:16:00 CEST 2010 Call for developers Transcode, like any opensource project, is always in need of contributions, but the situation has reached crisis point in recent weeks.
Despite a rich roadmap and plenty of ideas and proposals, the project is short of developers and close to stall. Moreover, one of the main developers (myself) has suspended its contribution to the development and maintainance for lack of time.
If you are interested in partecipating, bring it on! This is the right time! Join the development mailing list: transcode-devel at exit1 dot org (don't worry, the traffic is very low) and learn how you can contribute to the project.
Transcode needs you!
PLEASE NOTE! Transcode does'nt need hardware or money donations!
Posted by fromani | Permanent link | File under: general, devnote, transcode, announce
There's only one way to manage that, and that is to hide some options and functionality. Then it stops being an ffmpeg GUI, it starts becoming a "video transcoding application" (or an "audio grabber application "or a "subtitle insertion application") with ffmpeg as its backend.
See a similar thing for openssl here: https://smallstep.com/blog/if-openssl-were-a-gui/
Maybe someone can build a very specific AI that generates ffmpeg commands for you, based on its man page and what you input as free text?
Also one thing I did last year was add floating text to videos with ffmpeg's drawtext plugin, something I think people often want to do. For example adding reactions, or subs. I'd very much appreciate more guides on how to do that.
Something which is worth of interest: AMD is supposed to have published AV1 hardware encoding/decoding ffmpeg code (this one is "oooof!" too... if it is cross-platform, or at least elf/linux).
Actually I created a GUI to do exactly that, calling the ffmpeg executable.
So? It doesn'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's not the point.
If you cut a stream in the middle, it takes many frames before there's enough information to be displayed.
(The solution would be to re-encode up until the first discrete "keyframe"... and I don't know how to do that with ffmpeg.)
Looks like the ordering of the parameters makes a difference.
In the previous link there are a couple of solutions that might work. One is "recoding", that's somehow ambiguous: could be understood as changing the codec, but also making a new compression from the decompressed frames.
I have the program in another computer so I can't test it now, but I certainly will.
>Also note this important point from that page: "If you use -ss with -c:v copy, the resulting bitstream might end up being choppy, not playable, or out of sync with the audio stream, since ffmpeg is forced to only use/split on i-frames."
> This means you need to re-encode the video, even if you want to just copy it, or risk it being choppy and out of sync. You could try just -c copy first, but if the video sucks you'll need to re-do it.
From the link.
-----
edit: if it aids understanding, I think i-frame means "interpolated frame" i.e. frame that depends on the previous and next frames.
edit2: and "-c:v copy" means don't transcode (or "recode" as you say) the video, but simply copy it.
If ffmpeg needs more information, it should take it. That's what the logic in the parameters say. Instead of that it forces me to include some seconds that I don't want in the clip or blackening the video, both of them useless results.
But I legitimately don't know why that would happen otherwise. Usually it defaults to re-encoding when I use it.
It works pretty well.
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).
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...
I thought it was the wrong link at first. Clicking reject all does nothing.
It looks great, bookmarked.