Page 1 of 1

Delayed watermark

Posted: Wed Dec 25, 2019 11:23 pm
by Transferred
Good afternoon
Is there any way to delay the entry of a watermark?
I need the first five seconds of the video to be without the watermark and then appear and continue until the end.
Any ideas?
Thank you

Re: Delayed watermark

Posted: Thu Dec 26, 2019 8:27 am
by emcodem
Hey Transferred!
Welcome to the forum and thank you for using ffastrans!

nice first question. The best way to do this that comes to my head is using a "custom avisynth script" processor (from category Filters).
We can e.g. use the avisynth "Conditional Filter", in the example below it checks for framenumber > 20.

Code: Select all

m_clip = ConvertTo8Bit(m_clip)
LoadPlugin("%s_ffastrans_dir%\processors\ffmpeg\x64\plugins+\ImageSeq.dll")
m_clip = ConvertToRGB32(m_clip)
watermark = ImageSource("C:\Users\bussi\Pictures\ffas\app_full.jpg", start=20, end=m_clip.FrameCount, pixel_type = "rgb32")
watermark_clip = Layer(m_clip, watermark, "add", 257, x=Round(0), y=Round(0))
m_clip = ConditionalFilter(m_clip, watermark_clip, m_clip, "current_frame", ">", "20")
m_clip = ConvertToYUV444(m_clip)
Return m_clip 
Don't forget to replace the path to your image in the ImageSource function and look up the settings for the "Layer" function here:
http://avisynth.nl/index.php/Layer

Re: Delayed watermark

Posted: Thu Dec 26, 2019 8:15 pm
by Transferred
Thank you very much for your response emcodem
I tried with your custom avisynth script, but there is an error:

Job ended with error on H.264@OLD: Encoding failed - No video or audio found in media.

The avisynth script is:

Code: Select all

m_clip = ConvertTo8Bit(m_clip)
LoadPlugin("%s_ffastrans_dir%\processors\ffmpeg\x64\plugins+\ImageSeq.dll")
m_clip = ConvertToRGB32(m_clip)
watermark = ImageSource("C:\IN\logo.png", start=125, end=m_clip.FrameCount, pixel_type = "rgb32")
watermark_clip = Layer(m_clip, watermark, "add", 257, x=Round(0), y=Round(0))
m_clip = ConditionalFilter(m_clip, watermark_clip, m_clip, "current_frame", ">", "125")
m_clip = ConvertToYUV420(m_clip)
Return m_clip
The workflows have:

Monitor folder - A/V Media - ChannelMapper - Custom AviSynth script - Encode H.264 - Deliveries folder

I submit a *.avi file codec:MPEG-4 Video (Xvid)

Thanks for your time

Re: Delayed watermark

Posted: Fri Dec 27, 2019 2:23 pm
by emcodem
Hey,
unfortunately i cannot reproduce your problems, but i have 2 things:
Change start=125 to start=0 (read about what start means for imagesource function here: http://avisynth.nl/index.php/ImageSource)

Code: Select all

watermark = ImageSource("C:\IN\logo.png",start=125, end=m_clip.FrameCount, pixel_type = "rgb32")
And could you try with another sourcefile than an .avi file please?
If it still does not work, please disconnect the h264 encoding node and connect the output of the custom avisynth filter with the deliver node.
In the output folder that you did set in the deliver node, you find a .avs file then, please upload the contents here. (you may need to rename the file to .txt before uploadig here)

Thanks!

Re: Delayed watermark

Posted: Sat Dec 28, 2019 10:03 pm
by Transferred
This is amazing, thanks for your help.
It works very well. The delay time can be set in the last argument, changing "XX" to the number of delay frames:

Code: Select all

m_clip = ConditionalFilter (m_clip, watermark_clip, m_clip, "current_frame", ">", "XX")
I have submitted several types of files (* .avi, * .mov, * .mxf) and everything has been processed correctly.

I'm very grateful!