News for hackers. Stuff that matters.
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by est on Friday October 23, 2020 @02:29AM (#24866563)
My experience with fmpeg is like a DSL embedded into another DSL. It's very powerful yet confusing at times. I saved a ton of ffmpeg one-liners in a notebook just in case.
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by antihero on Friday October 23, 2020 @05:05AM (#24867373)
FWIW when I asked about doing something on IRC (splitting a stream, process one, and overlay it over the existing one at 20%), they were quite helpful.

It was: `split[a][b];[b]lut3d=${path}[c];[a][c]blend=all_mode=overlay:all_opacity=${opacity}`

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by demomode on Friday October 23, 2020 @06:20AM (#24867876)
I find gstreamer (using gst-launch)[1] a more pleasant experience than ffmpeg.

You can't use some expresions on the command line like `x=(w-text_w)/2:y=(h-text_h)` but it can be workaround with some scripting using python bindings for example.

Some (simple) text overlay can be acomplished with:

  gst-launch filesrc location=sample.mp4 \
    ! decodebin \
    ! videoconvert \
    ! textoverlay text="Hello" font-desc="Sans Bold 150px" y-absolute=0.5 \
    ! autovideosink

1. http://manpages.org/gst-launch
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by kingosticks on Friday October 23, 2020 @09:16AM (#24869138)
They also have very cool support for HTML overlays: https://base-art.net/Articles/web-overlay-in-gstreamer-with-...
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by potench on Friday October 23, 2020 @11:28AM (#24870476)
Looks like BBC’s Brave project was the inspiration for this: https://github.com/bbc/brave (specifically the gst-WebRenderSrc) Brave is a real-time remote video/audio editing app. Looks neat.

Unrelated but wow, BBC has quite a bit of interesting and relevant open source projects. Simorgh, their react SSR framework, caught my eye “used on some of our biggest websites”. Encouraging for those looking to build out performance react/amp platforms https://github.com/bbc/simorgh

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by iso1210 on Friday October 23, 2020 @01:17PM (#24871705)
I used CasparCG[0] to do live html overlays with a major broacaster out of Singapore about 5 years ago, still going strong. The actual on air graphics that were used rather tame compared with the sample ones I did to prove the system.

[0] https://github.com/CasparCG/

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by dylan604 on Friday October 23, 2020 @11:45AM (#24870708)
Why do you say you can't do expressions like that on the command line? I do it all of the time. You have to escape the parentheses, but other than that it is totally doable.
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by demomode on Friday October 23, 2020 @01:59PM (#24872101)
You can't use expressions like that (from ffmpeg cmld) in gst-launch.

As far as I know in gst-launch you can't access properties from one element (video stream width) in other elements.

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by iso1210 on Friday October 23, 2020 @06:46AM (#24868056)
Yes, and the best part is everything is turned into command line arguments.

ffmpeg of 15 years ago was confusing, but now it's so simple - to compile, to add your own filters, and to use, they've done a great job.

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by pfortuny on Friday October 23, 2020 @02:39AM (#24866613)
Yes, same here. The big problem is that the filters DSL is probably too complex because it uses too many short expressions.

It is unbelievably powerful though.

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by ponderingfish on Friday October 23, 2020 @02:41AM (#24866624)
Very true. And, the parameters change over time, but, the stackoverflow answers using the old parameters remain on top. This IMO adds to the confusion :)
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by _Gyan_ on Friday October 23, 2020 @03:20AM (#24866832)
Yes, the stackexchange (implicit) model contributes to this. It assumes once a Q has been asked and answered, the issue is resolved. Due to the non-duplicates policy, any corrections or updates are supposed to be added to the same thread. But the original accepted answer will have a tick mark next to it and likely a high score. So naive users don't read further and the obsolete answers remain heeded.

Some sort of deprecation or salience decay needs to be added.

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by madeofpalk on Friday October 23, 2020 @05:46AM (#24867627)
You can edit the accepted answer!
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by _Gyan_ on Friday October 23, 2020 @06:12AM (#24867810)
I don't like to mix voices - that's inorganic when the changes are more than minor and can lead to parts of the 'answer' being at odds with itself.

Except for typos, syntax..etc, I don't edit someone else's answer; I leave a comment and let the original respondent edit.

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by emarsden on Friday October 23, 2020 @06:31AM (#24867955)
Indeed. I use libraries such as MoviePy* that wrap ffmpeg and allow you to implement effects on each frame.

* https://zulko.github.io/moviepy/index.html

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by modernlearner on Friday October 23, 2020 @09:06AM (#24869050)
Seems like everyone has a notebook of ffmpeg commands: https://hhsprings.bitbucket.io/docs/programming/examples/ffm...
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by raverbashing on Friday October 23, 2020 @03:26AM (#24866863)
Yes

And the worse part is everything is turned into command line arguments

It would be easier if you could specify it in something more human readable like (sigh) yaml

Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by est on Friday October 23, 2020 @04:41AM (#24867244)
someone need to make a GPT-3 to ffmpeg commands converter
Re:FFmpeg Drawtext Filter for Overlays, Scrolling Text, Time... by Hamuko on Friday October 23, 2020 @03:40AM (#24866947)
I wrote a small Python front-end for ffmpeg just so I can do some of my most common video encoding tasks done without Google.