FFmpeg - Overlay one video onto another video? -


i understand open ended question. have done initial reading ffmpeg, require guidance.

problem

  • i have video input.mov.
  • i overlay video on top of overlay.wov.
  • the result should single video (output.mov).

notes

thanks - c.

edits

  1. backend go/ruby. open using new language.
  2. the audio first video should kept.
  3. setting interval @ overlay starts great.

current solution

ffmpeg -i input.mov -i overlay.mov -filter_complex "[0:0][1:0]overlay[out]" -shortest -map [out] -map 0:1 -pix_fmt yuv420p -c:a copy -c:v libx264 -crf 18  output.mov 

this works, however:

  • overlay cut short though 2 videos (input.mov & overlay.mov) same length.
  • i cannot start overlay @ interval apart 0:00.

if want ffmpeg command, try

ffmpeg -i input.mov -i overlay.mov \ -filter_complex "[1:v]setpts=pts-10/tb[a]; \                  [0:v][a]overlay=enable=gte(t\,5):shortest=1[out]" \ -map [out] -map 0:a \ -c:v libx264 -crf 18 -pix_fmt yuv420p \ -c:a copy \ output.mov 

this starts overlay @ 5 seconds overlaid video start point being 00:15.

setpts=pts-10/tb setpts=pts+(overlay_delay-video_trim_in)/tb

overlay=enable=gte(t\,5) overlay=enable=gte(t\,overlay_delay)


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -