VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    I'm on a windows 7 box using FFmpeg version: 20170223-dcd3418 and would like to control the fade in timing of my logo watermark independent of the fade already built in to my video.

    This code is working OK but I can't work out how to fade the watermark without also fading my input video stream.

    Code:
     ffmpeg -y -i mainvideo.mp4 -i watermarklogo.png -filter_complex "[0:v]overlay=W-w-10:H-h-10, fade=in:0:20[tmp_overlay]; [tmp_overlay]subtitles=ep1.srt[out]" -map [out] -map 0:a -codec:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -c:a aac -strict -2 output.mp4
    I've tried a number of combinations but am out of my depth with FFMPEG's -filter_complex command so any help would be appreciated.

    Please let me know if I can provide further information.
    Quote Quote  
  2. Originally Posted by EasyFeet View Post
    I'm on a windows 7 box using FFmpeg version: 20170223-dcd3418 and would like to control the fade in timing of my logo watermark independent of the fade already built in to my video.

    This code is working OK but I can't work out how to fade the watermark without also fading my input video stream.

    I've tried a number of combinations but am out of my depth with FFMPEG's -filter_complex command so any help would be appreciated.

    Please let me know if I can provide further information.
    Use alpha channel.
    Quote Quote  
  3. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    If you can use AVISYNTH with ffmpeg you can control all aspects of fadein and fadeout by number of frames and the script is easier than the overlay used by ffmpeg alone. The following avisynth script allows srt (ssa also will work) subtitles as well as an overlay of a second video.

    Code:
    LoadPlugin("C:\Users\Bud\Desktop\VSFilter.dll")
    v1 = Directshowsource("C:\Users\Bud\Desktop\[dp]Manjandani-1.mp4").ConvertToRGB32.Lanczosresize(864, 368)
    v1=v1.textSub("C:\Users\Bud\Desktop\Wham.srt")
    img1 = DirectShowSource("C:\Users\Bud\Desktop\Wham!Last Christmas.mp4", pixel_type="RGB32", fps=23.976).converttoRGB32.LanczosResize(160,90)
    img2 = DirectShowSource("C:\Users\Bud\Desktop\Wham!Last Christmas.mp4", pixel_type="RGB32", fps=23.976).converttoRGB32.LanczosResize(160,90)
    img3 = DirectShowSource("C:\Users\Bud\Desktop\Wham!Last Christmas.mp4", pixel_type="RGB32", fps=23.976).converttoRGB32.LanczosResize(160,90)
    img4 = DirectShowSource("C:\Users\Bud\Desktop\Wham!Last Christmas.mp4", pixel_type="RGB32", fps=23.976).converttoRGB32.LanczosResize(160,90)
     \
    clip1 = v1.trim(0, -101).Overlay(img1.assumefps(23.976).trim(0,-101).fadein(60).fadeout(60), 100, 100,Opacity=1.0, img1.ShowAlpha()) \
     ++ v1.trim(101, -99) \
     ++ v1.trim(200, -101).Overlay(img2.assumefps(23.976).trim(200,-101).fadein(60).fadeout(60), 150, 150,Opacity=1.0, img2.ShowAlpha()) \
     ++ v1.trim(301, -99) \
     ++ v1.trim(400, -101).Overlay(img3.assumefps(23.976).trim(400,-101).fadein(60).fadeout(60), 200, 200,Opacity=1.0, img3.ShowAlpha()) \
     ++ v1.trim(501, -99) \
     ++ v1.trim(600, -101).Overlay(img4.assumefps(23.976).trim(600,-101).fadein(60).fadeout(60), 250, 250,Opacity=1.0, img4.ShowAlpha()) \
     ++ v1.trim(701, 0)
    return clip1
    The above is a little overkill but shows 4 logos (img) fading in and out from black in different locations. The opacity can be set from 1.0 (Opaque) to 0.0 (Transparent). The fps of the img is set to the fps of the main video. The dot "." filters (assumefps, fadein, fadeout, etc.) follow each item that you wish to control. The below image may help to clarify the script:

    Click image for larger version

Name:	logos.jpg
Views:	204
Size:	95.1 KB
ID:	41632
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!