To tag a video in the lower right using ffmpeg

I found some answer here on the stack that really uses ffmpeg, but it gives me some error.

I ran it in a command window and the error is very similar to

"Cannot find suitable output format for 'ฮ“ร‡รดi' ฮ“ร‡รดi: Invalid argument."

my team is as follows

ffmpeg โ€“i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=(main_w-overlay_w-10)/2:(main_h-overlay_h-10)/2 [out]" outputvideo.mp4 

suggest some ideas.

+5
source share
3 answers

You can try them. Should work for you.

 /* * At top left watermark */ $mark = "ffmpeg -i ".$inputvideo." -i logo.png -filter_complex ". '"overlay=x=(main_w-overlay_w)/(main_w-overlay_w):y=(main_h-overlay_h)/(main_h-overlay_h)"'." ".uniqid()."topleft.mp4"; /* * At top right watermark */ $mark = "ffmpeg -i ".$inputvideo." -i logo.png -filter_complex ". '"overlay=x=(main_w-overlay_w):y=(main_h-overlay_h)/(main_h-overlay_h)"'." ".uniqid()."topright.mp4"; 
+3
source

Basically, the overlay property determines where your watermark image will be placed -

 main_w: video width main_h: video height overlay_w: overlay width overlay_h: overlay height. 

I think this should work fine.

  $mark = "ffmpeg -i ".$inputvideo." -i logo.png -filter_complex ". '"overlay=x=(main_w-overlay_w):y=(main_h-overlay_h)/(main_h-overlay_h)"'." ".uniqid()."topright.mp4"; 
+5
source

I tried with this command and it worked for me. hope this works for you too.

 $mark = "ffmpeg -i inputvideo.mp4 -i watermark.png -filter_complex 'overlay=x=(main_w-overlay_w):y=(main_h-overlay_h)' outputvideo.mp4"; exec($mark); 
+3
source

Source: https://habr.com/ru/post/1233231/


All Articles