top | item 36929499

Ffmprovisr – Making FFmpeg Easier

414 points| nice__two | 2 years ago |amiaopensource.github.io | reply

98 comments

order
[+] yard2010|2 years ago|reply
A bit off topic, IMO ffmpeg is one of the best software ever written. Fabian Fabrice (ff) is one talented engineer and people such as him are a gift to the FOSS community.

I used to work in a ~2 bil unicorn in which a big part of the products we worked on relied on ffmpeg.

[+] forgotpwd16|2 years ago|reply
>Fabian Fabrice

*Fabrice Bellard. Also creator of QEMU, TCC, QuickJS, and others.

[+] 9dev|2 years ago|reply
There are no people such as Him. There’s nobody else in his league, heck, there’s nobody even playing the same game as Fabrice Bellard :-)

In all seriousness though, the sheer amount of devices running code he wrote at any given moment is just ridiculous.

[+] cornstalks|2 years ago|reply
FYI the “FF” in “FFmpeg” stands for “fast forward.”
[+] 30nn|2 years ago|reply
I love ffmpeg, but its performance has got to improve on ARM!
[+] andrewstuart|2 years ago|reply
Fabian Fabrice has created many amazing software projects.

Comparable only to famous film director Alan Smithee who has credit for so many films.

[+] brucethemoose2|2 years ago|reply
Since ffmpeg CLI still makes me pull my hair out, even with excellent guides, I am going to plug vapoursynth:

https://www.vapoursynth.com/

Its optimized Pythonic video filtering... But also so much more: https://vsdb.top/

And Staxrip, which makes such good use of ffmpeg, vapoursynth, and dozens of other encoders and tools that I reboot from linux to Windows just to use it: https://github.com/staxrip/staxrip

[+] krick|2 years ago|reply
I would really appreciate just an ffmpeg wrapper with better CLI. It is unnecessarily convoluted, and while I don't know if there's a point of view from which it actually all makes sense, it is just inadequate in performing all sorts of extremely common tasks it is perfectly able to perform, if one knows which magic words it needs to hear. I probably have dozens of bash-aliases, that are nothing more than encoding 150-character ffmpeg commands into 2 simple words.

It is also incredibly stupid how 99% of time ffprobe is used without any arguments to just quickly see something as mundane as duration, resolution, framerate, MAYBE number of audio-tracks, yet 99% of its output is some completely irrelevant bullshit like compiling options.

[+] colecut|2 years ago|reply
I was looking for a ffmpeg UI recently and came across Shutter Encoder. It's open source, mac/windows, very good software.

I've finally started compressing my 15 year, 300GB personal video collection..

https://www.shutterencoder.com/

I'm compressing everything using, H.265 and videos are shrinking to sometimes 1/10th the size.. Is there who would give me reasons why I would not want to do this? I've read that it takes more processing power to watch these compressed videos, but not sure that will cause much trouble in the future...

[+] hsbauauvhabzb|2 years ago|reply
I tried this automated across a large video collection and the quality was subpar because my CRV settings were weak despite looking fine on the test videos. Consider that a word of warning, validate many videos before removing the masters.

But with 300gb, storage is cheap enough that you could just keep the masters.

[+] harrygeez|2 years ago|reply
One reason for me to still pick h.264 is many aging (or budget?) hardware doesn't have hardware decoding for h.265.

Also it's just easier on my homelab to use Plex without having to transcode

[+] mrob|2 years ago|reply
This guide recommends "yadif" as a deinterlacing filter. I find "w3fdif" looks better. Like yadif, it does not do motion tracking, so it's reasonably fast and avoids the distracting artifacts that motion tracking sometimes causes (I'd rather have consistently mediocre results than sometimes great and sometimes bad), but it considers three fields at a time instead of yadif's two, which lets it hide the interlacing artifacts better.
[+] Trixter|2 years ago|reply
As previously suggested, w3fdif has mostly been supplanted by bwdif. w3fdif can produce shimmering, whereas yadif does not, which is why bwdif operates like yadif but uses the better field matching of w3fdif.
[+] kierank|2 years ago|reply
"bwdif" is a hybrid of "yadif" and "w3fdif"
[+] Paianni|2 years ago|reply
Probably the biggest barrier to ffmpeg adoption is all the offline 'freemium' and web frontends, the host sites for which have been SEO'd for phrases people commonly put into Google like "avi to mp4", "mp3 to wav", etc..

It took me more time than I wish it did to become open to using CLI apps, the Windows world had taught me to expect a GUI for everything.

[+] Tactician_mark|2 years ago|reply
I thought most of those file conversion sites were just ffmpeg on top of nginx or something?
[+] Eisenstein|2 years ago|reply
People like to say that ffmpeg is complicated but when you make it into a nice gui it doesn't get any easier -- it is video compression itself that is complicated. No software could make it easier without making the decisions for you, like handbrake or some other click-through interface.

I'm not certain, but I highly suspect that if I sat down and learned about digital video encoding and compression on a granular enough level then figuring out how to do things in ffmpeg would be rather intuitive. Does anyone have experience doing this?

[+] legends2k|2 years ago|reply
I've written DirectShow filters around 17 years back for WindowsMobile (not Windows Phone) so I've a decent understanding of codecs and containers.

Formats like mkv or codecs like HEVC didn't exist back then but the concept of manipulating audio/video through a bunch of filters is a wonderful one and most (all?) a/v transforming software does it. When I started looking into FFmpeg's man pages I could connect the dots and start using it after a day of fooling around.

I'm a CLI lover and man page reader so perhaps it worked to my advantage.

[+] jmiskovic|2 years ago|reply
I use ffmpeg often because it's so powerful, but its api cannot fit in my head. It should have a LLM frontend.
[+] stilwelldotdev|2 years ago|reply
This is a great idea! Trying to get FFmpeg to do what I want it to do is always daunting. ChatGPT has been helpful, but not perfect. Thanks for this :)
[+] nirav72|2 years ago|reply
Chatgpt made lot of CLI tool args/options easy to use. I always had a hard time remembering OpenSSL options and arguments. Now I just use gpt
[+] mewpmewp2|2 years ago|reply
ChatGPT totally made ffmpeg very accessible to me. I think minor issues I have is intricacies between different operation systems.
[+] thentherewere2|2 years ago|reply
As someone who uses ffmpeg daily (mostly basic functions), I now rely on chatGPT to approximate the command and fine tune from there. Haven't used too many of the advanced features of ffmpeg so glad someone seems to be covering those use cases as most tutorials dont cover them.
[+] vorticalbox|2 years ago|reply
I had a whole folder of videos I wanted to convert to 720p, asked chatGPT and it gave me this:

find . -maxdepth 1 -type f -name "" -exec sh -c 'pv "$1" | ffmpeg -i pipe:0 -filter:v scale=720:-2 -c:a copy "${1%.}.mp4" 2> /dev/null' _ {} \;

Not sure if it can be improved but it works well

[+] giovannibonetti|2 years ago|reply
Related: I have a small library of personal videos, including from my wedding, and I'd like to compress it as much as I can to reduce its storage footprint. I don't care much about codec compatibility, as long as I can watch them on my (ARM) MacBook, it's good.

In the past (over 10 years ago), I used to work with H.264, but I remember fiddling with parameters was a pain. I wonder if nowadays there are some promising new codecs based on ML. Again, as long as it works in my machine it's good, so anything from GitHub, HuggingFace and so on is acceptable, as long as it doesn't need too much effort and specialized knowledge to run it.

[+] danjc|2 years ago|reply
I'd recommend not re-encoding as you'll have irrevocably lost data. Whatever it's size, in the future it won't be large.
[+] drewtato|2 years ago|reply
This depends on how much time you want to spend. If you want the transcode to take less time than the playtime of your videos, it'll probably be best to just use the best hardware encoder you have with high quality settings.

If you have more time, then AV1 is good. Read through the trac page [1] and do test encodes with 5-10 seconds of video to determine what settings give you your desired quality. Note that low `-cpu-used` or `-preset` values will give great quality but take incredibly long. Then, encode a few minutes of video with various settings to determine what settings give you your desired file size.

For human time usage, keep track of the commands and options you use and how those affect the output. If the job will take more than a few hours, write your script to be cancellable and resumable.

[1]: https://trac.ffmpeg.org/wiki/Encode/AV1

[+] frankplow|2 years ago|reply
There are some promising codecs based on neural networks, however they are all very much research projects and have major limitations. Additionally, the compression ratios are only marginally higher than state-of-the-art engineered codecs. I think for your use case a more modern engineered codec such as VVC (H.266) or AV1 is perhaps more suitable.
[+] fladd|2 years ago|reply
I am a bit confused. This seems to be about the command line programme "ffmpeg" that comes with the library, but not the library itself. That programme seems already very well documented, with a help option, a man page and everything. It is usually the library that no one knows how to properly use, due to a lack of documentation :-)
[+] Am4TIfIsER0ppos|2 years ago|reply
> Transcode to an H.264 access file

You use "access" several times but I don't know what you mean by it. I'm going to guess that is some non-english usage slipping in. Nothing else to complain about at this time. [EDIT] I should say "is used" and "they mean" because I don't know if the author is also the poster.

[+] jameskerr|2 years ago|reply
All Ive ever wanted was to convert mp4 to gif.
[+] toxik|2 years ago|reply
Nice idea, but needs a better name!
[+] 7373737373|2 years ago|reply
The navigation layout of this is not ideal yet.

Specific recipes that should be added:

Removing audio: ffmpeg -i $input_file -c copy -an $output_file

Halving resolution: ffmpeg -i $input_file -vf "scale=iw/2:ih/2" $output_file

[+] ChrisMarshallNY|2 years ago|reply
Great stuff!

ffmpeg is infrastructure-level important, and tools like this keep it going.

[+] chefandy|2 years ago|reply
Those anchors don't work on Firefox on Android. The author is losing... I dunno.... 1e-20% or whatever of the browser market share among my fellow Android FF users.
[+] boomboomsubban|2 years ago|reply
They do work, just poorly. The text opens, but it scrolls you down to the end of the text.