Add transparent logo to an existing video #2380
smixp
started this conversation in
User Support
Replies: 1 comment 3 replies
-
Hi! Couple of things:
Adapted script, seemed to be working here with the latest url = url_stream
logo = single(url_logo)
s = playlist(url_playlist, mode="normal",reload=1, reload_mode="rounds")
def Add_Logo(~id=null(),logo,s) =
id = string.id.default(default="Add_Logo", id)
def mkfilter(graph)
background = ffmpeg.filter.video.input(graph, drop_audio(s))
logo = ffmpeg.filter.video.input(graph, logo)
v = ffmpeg.filter.overlay(graph,
background,
logo,
x="1150",
y="30"
)
v = ffmpeg.filter.video.output(graph, v)
# Remove when https://github.com/savonet/liquidsoap/issues/2384 is closed
a = ffmpeg.filter.audio.input(graph, drop_video(s))
a = ffmpeg.filter.anull(graph, a)
a = ffmpeg.filter.audio.output(graph, a)
(a, v)
end
let (a, v) = ffmpeg.filter.create(mkfilter)
mux_audio(id=id,audio=a,v)
end
s = Add_Logo(logo, s)
encoder = %ffmpeg(format="flv",
%audio.raw(codec="aac", b="128k", samplerate=48000, q=4),
%video.raw(codec="libx264", width=1280, height=720, b="3000k", r="29", g="48", "x264-params"="scenecut=0:open_gop=0:min-keyint=150:keyint=150", preset="veryfast")
)
output.url(fallible=true, url=url, encoder, s) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I would like to add a transparent logo to an existing video not to a static image.
this code adds the logo well but I lose the sound of the video.
Here is my current code
Erreur line 13 => v
Beta Was this translation helpful? Give feedback.
All reactions