Hello Everyone,
I have a huge list of video files (mp4) to transcode to the same format but with an animated logo burned in.
What's the best/fastest way to do it?
I want to avoid having to open each individual video on an video editor software and paste the animated logo over and over and over again.
Looking forward for your help.
Best
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 11 of 11
Thread
-
-
You can use ffmpeg for this - source called in main script loop and animated logo invoked trough https://ffmpeg.org/ffmpeg-filters.html#movie-1 in filter section then overlay (if you are interested in some alpha channel transparency then things are slightly more complicated bout still doable).
How to process many files in loop - example here: https://forum.videohelp.com/threads/392195-Extracting-FPS-from-multiple-files#post2542544 by principle is same.
Bellow example if ffmpeg syntax (working so excuse parameters) how to use alpha embedded in file source:
Code:@ffmpeg.exe -hide_banner -v 32 -stats -strict -1 -i %filename% -an -filter_complex "[0:v]scale=773:439:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:interl=-1:out_range=full,pad=1920:1080:990:224[a0];movie=bg.png,premultiply=inplace=1[b0];[a0][b0]overlay=0:0:alpha=premultiplied,scale=960:-2,format=pix_fmts=yuv420p" -c:v ffv1 -vsync 0 -f NUT - | ffplay.exe -hide_banner -loglevel 32 -autoexit -i -
-
-
You need to provide more details? for example source resolution, logo overlay position etc.
My example can be divided on few main groups:
- common part where filename is your source - should be modified accordingly to loop processing
Code:@ffmpeg.exe -hide_banner -v 32 -stats -strict -1 -i %filename%
- first video (source video) is processed by:
Code:[0:v]scale=773:439:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:interl=-1:out_range=full,pad=1920:1080:990:224[a0]
I assume you will not resize your source video and perhaps no need to pad thus this can be significantly modified (or even removed)
- secondly alpha channel source (in this case it was image with embedded alpha) is invoked and made to be present on pin [b0]
Code:movie=bg.png,premultiply=inplace=1[b0]
- third in this particular case transparent (trough alpha) image is overlayed on top of video (your case is very similar only logo will be smaller than video)
Code:[a0][b0]overlay=0:0:alpha=premultiplied,scale=960:-2,format=pix_fmts=yuv420p
Additionally you need to configure video codec (and audio - didn't covered audio path at all).
Not sure if this helpful... it is difficult to create script for unknown usage case. -
Thank you so much for such dedication trying to help me, really appreciated!
Now, yesterday after digging, testing, reading documentation (and with your help), I was able to come up with this script:
Code:for %%A in (*.mp4) do ffmpeg -i "%%A" -filter_complex "[0:v]scale=1920:1080:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:interl=-1:out_range=full,pad=1920:1080:990:224[a0];movie=filename=FTV_BUG_GENERIC.mov:loop=0, setpts=N/(25*TB),premultiply=inplace=1[b0];[a0][b0]overlay=0:0:alpha=premultiplied,scale=1920:-2,format=pix_fmts=yuv420p" -an "exported\%%A"
what is this? pad=1920:1080:990:224
what encoding options is it doing?
(frame rate, Bit rate, etc..) The same as source?
Thanks again for your effort.
Best Regards -
what is this? pad=1920:1080:990:224
For more details read: https://www.ffmpeg.org/ffmpeg-all.html#pad-1users currently on my ignore list: deadrats, Stears555 -
padding already answered by Selur (sorry Selur, my apologies) (i think you can safely remove it from command line, not sure if your intention is resize all source files to 1920x1080)
encoding options are "setup parameters" for selected video and audio codecs, so video/audio codec, bitrates, encoding option encoding options
Bellow removed from your cmdline pad and last scale (it had functionality accordingly to my needs but not necessary for you).
I've highlighted '-an' command - this disabling audio - not sure if this is your goal - to disable (remove) audio and process all source files only video
Code:for %%A in (*.mp4) do ffmpeg -i "%%A" -filter_complex "[0:v]scale=1920:1080:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:interl=-1:out_range=full[a0];movie=filename=FTV_BUG_GENERIC.mov:loop=0, setpts=N/(25*TB),premultiply=inplace=1[b0];[a0][b0]overlay=0:0:alpha=premultiplied,format=pix_fmts=yuv420p" -an "exported\%%A"
https://trac.ffmpeg.org/
https://trac.ffmpeg.org/wiki/EncodingForStreamingSites -
-
NP, IMHO best loop for animated logo is endless (infinite) loop (remove uncertainty related to unknown duration of the source).
For https://ffmpeg.org/ffmpeg-filters.html#movie-1 ':loop=0' means infinite loop -
-
add to main command line (not filter) '-shortest' - should fix problem.
https://ffmpeg.org/ffmpeg-all.html
-shortest (output)
Finish encoding when the shortest input stream ends.
Similar Threads
-
Converting MKV and AVI video files into regular DVD without watermark/logo
By peripatein in forum Authoring (DVD)Replies: 8Last Post: 16th Jan 2019, 17:45 -
Unexpected watermark in timelapse from my 80D - do you know the logo?
By larioso in forum Video ConversionReplies: 7Last Post: 27th Dec 2017, 09:06 -
Drop Shadows effect on watermark logo?
By TheCage in forum EditingReplies: 6Last Post: 8th Apr 2016, 06:13 -
Video Production: video overlay in real time over existing video
By tobyoneknobi in forum Newbie / General discussionsReplies: 4Last Post: 6th Feb 2015, 08:11 -
Add logo or watermark quickly without affecting video file size or quality
By MGadAllah in forum EditingReplies: 29Last Post: 27th Jul 2014, 09:38