Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for -filter_complex and/or logo overlay #26

Open
Angels-group opened this issue Oct 13, 2019 · 4 comments
Open

Add support for -filter_complex and/or logo overlay #26

Angels-group opened this issue Oct 13, 2019 · 4 comments
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Milestone

Comments

@Angels-group
Copy link

Feature Request:
ffmpeg supports source overlay. It would be very nice to add this feature to Shaka-streamer.
This is very convenient for organizing branded broadcasting of a video stream (TV channel, presentation, broadcast of events, and so on)

Example:

ffmpeg -i video.mp4 -i logo.png \
-filter_complex "[0:v][1:v] overlay=64:64:enable='between(t,0,20)'" \
-pix_fmt yuv420p -c:a copy \
result.mp4

overlay=64:64 - means that we want to place the logo with a shift of 64px to the right and with a shift of 64px down, relative to the upper left corner (0:0)

enable='between(t,0,20)' - means we want to overlay the logo in the range from 0 to 20 seconds

[0:v][1:v] - means layer order. The first layer (0: v) is video.mp4, the next (1: v) is logo.png

I understand that this is not paramount. But it would be very good to have such an option in the future :)

@joeyparrish joeyparrish added type: enhancement New feature or request and removed needs triage labels Oct 13, 2019
@joeyparrish
Copy link
Member

Thanks for the request!

We already have a feature where you can specify FFmpeg filters, but nothing yet that would allow -filter_complex with an image as input. We'll give some thought to how this would be specified in a config file. We didn't plan for -filter_complex in general.

@joeyparrish joeyparrish changed the title [FRQ] Overlay logo Add support for -filter_complex and/or logo overlay Oct 13, 2019
@shaka-bot shaka-bot added this to the Backlog milestone Oct 13, 2019
@Angels-group
Copy link
Author

Angels-group commented Oct 13, 2019

but nothing yet that would allow -filter_complex with an image as input

I imagined that this could be done inside input_xxx_config.yaml
In the inputs section.

Something like:

- name: logo.png
    media_type: overlay
    position_x: 64
    position_y: 64
    start_time: 00:00:00
    end_time: 00:20:00
    z_index: 1

@joeyparrish
Copy link
Member

Yes, that could work. If we support overlays specifically, we could do something targeted like that.

If we don't find any other compelling use-cases for -filter_complex, then we might choose to support overlays directly as you suggested.

@gdub01
Copy link

gdub01 commented Dec 20, 2019

One more filter complex use case is burning in subtitles as an overlay on the video. ie.
-filter_complex "[0:v][0:s]overlay[v]" -map "[v]"
-filter_complex "[0:v][0:s]overlay"
https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo

@theodab theodab added the priority: P3 Useful but not urgent label Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants