Live data from Hacker News

FFmpeg 4.3

ffmpeg.org

101–110 of 226 posts

Re: FFmpeg 4.3

#101
post #60
post #58

Somewhat related. Anyone have a good utility for downloading youtube videos?

https://ytdl-org.github.io/youtube-dl/index.html is the gold standard.

It should be noted that despite the name it supports a lot of different websites, not just Youtube. It's great to capture hls streams for instance.

Re: FFmpeg 4.3

#102
post #37

As a little side project, I've been trying to automate creation of those "1 second everyday" style videos [1], and used FFmpeg to achieve this. For things like trimming and concatenating videos, one thing that surprised me was that it was slower than using a tool like ScreenFlow. Note, we're talking about hundreds of gigabytes worth of 4K videos. slower = When I say slower, I mean, if I manually performed the same op…

Most likely you are transcoding the video instead of copying the raw stream. A lot of more complicated stuff requires that but things like trimming can be done the fast way by simply cutting of the irrelevant pieces in the raw encoded data itself which is much faster. It’s kind of a sport to find the exact string of flags that has the correct effect without transcoding :)

The reason it often fails is that ffmpeg can do so many things that any time you are using some curious combination of flag A, B and C is likely that no one else has ever done that and there are some side effects ;)

Anyway, some of it can be avoided by learning how containers en codecs work, what I-frames are and all the other nitty gritty details of the world of video where there is so much to learn!

Here’s a great intro to get started for anyone who got curious: https://github.com/leandromoreira/digital_video_introduction

Re: FFmpeg 4.3

#104
post #85
post #37

As a little side project, I've been trying to automate creation of those "1 second everyday" style videos [1], and used FFmpeg to achieve this. For things like trimming and concatenating videos, one thing that surprised me was that it was slower than using a tool like ScreenFlow. Note, we're talking about hundreds of gigabytes worth of 4K videos. slower = When I say slower, I mean, if I manually performed the same op…

> The slow way is free of quirks, whereas the fast way introduces something unexpected to the video, like a half a second of a black screen with audio continue playing like normal. The reason here is the the "fast way" and the "slow way" work very differently behind the scenes. The "fast way" looks only needs to look at the container, the bits of metadata that tell a player which bits of data need to be given to the…

This is a great explanation thank you! Makes much more sense now.

Will indeed read into the all-intra format.

Re: FFmpeg 4.3

#105
post #32

In case you didn't know, you can use FFmpeg to convert Audible aax files to DRM-free MP3/AAC/whatever [0] (scroll down for FFmpeg instructions). This is useful if for some reason you want to archive them or play them in an app that doesn't constantly change its UI and bombard you with ads. [0]: https://www.kylepiira.com/2019/05/12/how-to-break-audible-dr...

The amount of time I spent on correcting wrong chapter marks (like the first four books of the Wheel of Time) is masochistic. But I am absolutely happy that I have the possibility of doing so after the conversion :)

Re: FFmpeg 4.3

#106
With so much video processing research using neural networks now I hope ffmpeg gets better support for it. They have some filters that use them, like sr[0] for super resolution and dnn_processing for general processing, but the user experience isn't great. They need a model file that's not included, and you need to train one yourself since there doesn't seem to be any included. Hopefully they add better support in the future, together with more dnn filters.

[0] https://ffmpeg.org/ffmpeg-filters.html#sr

Re: FFmpeg 4.3

#108
post #71

Earlier quoted context omitted.

If you're converting .aax files you should consider using .m4b as the output, since it preserves chapters and remembers your last listened timestamp [0]: > Audiobook and podcast files, which also contain metadata including chapter markers, images, and hyperlinks, can use the extension .m4a, but more commonly use the .m4b extension. An .m4a audio file cannot "bookmark" (remember the last listening spot), whereas .m4b…

I don't think that's quite accurate. There's no functional difference between a .m4b file and a .m4a file. Both use the MP4 container so adhere to the same specification, so support all the same features (including bookmarks). FFmpeg even uses the same muxer and demuxer for both "formats". The only difference is a non-standard convention used by certain software (like iTunes) to write autiobook-related metadata only…

Wait, so an m4b stores playback position in the file itself? As in, the checksum will change and file syncers like Syncthing will re-upload every time I hit pause?

Re: FFmpeg 4.3

#109
FFmpeg is hands down one of the most powerful and feature-packed tools I've used out there.[0] The associated complexity is also daunting, but thankfully there's a lot of documentation out there and it reflects the low level nuances of audiovisual formats.

I highly recommend anyone struggling to utilize it to write wrapper scripts around it so you only need to figure out things once. Here are some things I've done with it by that approach:

* Extracting any embedded subtitle files from MKVs. Nice if I want to search them or make changes.

* Back when GIFs were more popular, I converted any that were over 3MB to video to save space. If the output wasn't small enough, it would do a second pass with different settings to get it more compact. Not needed that much these days.

* "Barcodes" for videos, that is, it takes every second converted to a vertical sliver and combined you get an overview of how the average color of the film changes through its duration.

* A tool for creating video excerpts that lets me specify a start time and end time in more flexible timestamp formatting, and other things like a simple parameter for the output width.[1] It also allowed specifying a target filesize and did the math so the right bitrate would be chosen. I even include metadata so I know which original file it was made from and the parameters specified.

* Thumbnail previews. A lot of file sharing sites will include a file that includes some timestamped screenshots in a grid with encoding information at the top. This is good for movies so you see a high-level overview. The best part about doing this myself is that I could make it highly configurable, like choosing exactly how many images I want, the interval, whether I want timestamps, etc.

Note, for some of these, I also needed ImageMagick.

Also, when compiled with the right flags and libraries, FFmpeg has some really neat features: things like embedding subtitles, stabilizing video, hiding logos, etc. I recommend looking into the filters.

Thank you for all the manpower that goes into the project!

[0]: Two other ones that are also powerful are ImageMagick and Pandoc.

[1]: I initially wrote this in Bash, but later converted the code to Python to better handle command line arguments and allow things like using config files.

Re: FFmpeg 4.3

#110
post #47

I wanted to create a slideshow a couple weeks ago and came across this article [0] on creating a Ken Burns Effect Slideshow. Very cool and is a great demo of some of ffmpeg's functionality. However, the final command is a little crazy: ffmpeg -i 1.jpg -i 2.jpg -i 3.jpg -filter_complex "color=c=black:r=60:size=1280x800:d=10[black];[0:v]format=pix_fmts=yuva420p,crop=w=2*floor(iw/2):h=2*floor(ih/2),zoompan=z='if(eq(on,1…

That's awesome. Every section on the command is simple, but taken as a whole, it is pretty thorny. I find that MoviePy (https://zulko.github.io/moviepy/) is a great tool for more complex operations like the aboce. A lot of MoviePy's functionality is derived from an FFMPEG wrapper, but it is just easier to split things up into a small script.
Post reply on HN