本文介绍了使用ffmpeg Android将动态水印设置到视频中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  ffmpeg,我,inputVideoPath -  i,imageToOverlay
-filter_complex,overlay = 10:10, - strict,-2, - b:a,32k,
-r ,15, - preset,ultrafast,outputVideoPath

我们可以设置动态值进入overlay = x:y还有imageToOverlay,这是图像路径?

解决方案

尝试此命令

  // test with watermark.png 128x128,将其添加到/ sdcard / videokit / 
String [] complexCommand = {ffmpeg , - y, - i,/sdcard/videokit/in.mp4\",\"-strict\",\"experimental,-vf,movie = / sdcard / videokit / watermark.png [水印] ; [in] [watermark] overlay = main_w-overlay_w-10:10 [out], - s,320x240, - r,30,-b,15496k,-vcodec ,mpeg4, - ab,48000,-ac,2,-ar,22050,/sdcard/videokit/out.mp4};

更多信息检查链接



检查链接以及


I am using this command to overlay the image into the video.

ffmpeg",i", inputVideoPath,"-i", imageToOverlay,"
-filter_complex",overlay=10:10","-strict", "-2","-b:a" ,"32k",
"-r","15","-preset", "ultrafast",outputVideoPath

Can we set the dynamic values into the "overlay=x:y" also "imageToOverlay" which is image path?

解决方案

try this command

 //  test with watermark.png 128x128, add it to /sdcard/videokit/
String[] complexCommand = {"ffmpeg","-y" ,"-i", "/sdcard/videokit/in.mp4","-strict","experimental", "-vf", "movie=/sdcard/videokit/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]","-s", "320x240","-r", "30", "-b", "15496k", "-vcodec", "mpeg4","-ab", "48000", "-ac", "2", "-ar", "22050", "/sdcard/videokit/out.mp4"};

for more information check this link

check this link as well

这篇关于使用ffmpeg Android将动态水印设置到视频中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 13:41