- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
基本上我搜索了很多,解决方案建议应用一些 PNG 掩码或不提供所需的解决方案。
我发现了什么。
ffmpeg -i main.mkv -i facecloseup.mkv
-filter_complex "[1]trim=end_frame=1,
geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':128:128,
loop=-1:1,setpts=N/FRAME_RATE/TB[mask];
[1][mask]alphamerge[cutout];
[0][cutout]overlay=x=W-w:y=0[v];
[0][1]amix=2[a]"
-map "[v]" -map "[a]" out.mp4
command = "-i " + this.video1Path.getPath() + " -i " + this.video2Path.getPath() + " -filter_complex [1]trim=end_frame=1,geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3)," + (this.mZoomLayout.getZoomedWidth()/2) + "*" + (this.mZoomLayout.getZoomedWidth()/2) + "),255,0)':128:128,format=gray,loop=-1:1,setpts=N/FRAME_RATE/TB[mask];[1][mask]alphamerge,format=rgba,lutrgb=a=if(gte(val\\,16)\\,val)[cutout];[0][cutout]overlay=" + this.mZoomLayout.getCircleX() + ":" + this.mZoomLayout.getCircleY() + ":enable='between(t,0," + this.videoTwoDuration + ") -c:v libx264 -crf 24 -preset ultrafast " + videoPath.getPath();
所以我试图从他们那里提取需要的东西,但我不明白我到底需要怎么做,我这样做了:
ffmpeg -i video.mp4 -filter_complex "[0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001f761dd8e40] Invalid stream specifier: mask.
Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.
ffmpeg -i video.mp4 -filter_complex "[0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge" out.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001bfd9218e80] Invalid stream specifier: mask.
Last message repeated 1 times
Stream specifier 'mask' in filtergraph description [0]geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),pow(min(W/2,H/2),2)),255,0)':H:W; [0:v][mask]alphamerge matches no streams.
再一次,伙计们,如果您要发布一些“准备好的图像蒙版”解决方案 - 离开吧,问题是关于在空中创建蒙版。
最佳答案
您可以使用以下图像复制您的“ 最终结果 ”:
height
的值变量应与源文件的高度匹配。在这种情况下,它是 600 像素。
red="red.png"
blue="blue.png"
height=600
ffmpeg \
-loop 1 -i "${red}" \
-loop 1 -i "${blue}" \
-filter_complex "\
[1]format=yuva444p,geq=lum='p(X,Y)':a='st(1,pow(min(W/2,H/2),2))+st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),ld(1)),255,0)'[circular shaped video];\
[circular shaped video]scale=w=-1:h=${height}[circular shaped video small];\
[0][circular shaped video small]overlay" \
-filter_complex_threads 1 \
-c:v libx264 \
-preset ultrafast \
-t 5 \
"final_result.mp4"
您只需要
-loop 1
使用图像时输入前面的选项。
in="blue.png"
vignette_color="red"
ffmpeg \
-loop 1 -i "${in}" \
-filter_complex "\
[0]setsar=1:1,format=yuva444p,drawbox=color=${vignette_color}@1:t=fill[vignette];\
[0]format=yuva444p,geq=lum='p(X,Y)':a='st(1,pow(min(W/2,H/2),2))+st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),ld(1)),255,0)'[circular shaped video];\
[vignette][circular shaped video]overlay" \
-filter_complex_threads 1 \
-c:v libx264 \
-preset ultrafast \
-t 5 \
"result.mp4"
1 个视频自动平方
in="snowboarder.mp4"
vignette_color="black"
# edge of vignette can be jagged.
# use value between 1 - 2 (e.g. 1.2). 1 doesn't do anything.
anti_aliasing=2
ffmpeg \
-i "${in}" \
-filter_complex "\
[0:v]crop=ih:ih[video square];[video square]split=2[video square 1][video square 2];\
[video square 1]setsar=1:1,drawbox=color=${vignette_color}@1:t=fill[vignette];\
[video square 2]scale=w=iw*"${anti_aliasing}":h=iw*"${anti_aliasing}",format=yuva444p,geq=lum='p(X,Y)':a='st(1,pow(min(W/2,H/2),2))+st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),ld(1)),255,0)'[scaled up circular shaped video];\
[scaled up circular shaped video]scale=w=iw/"${anti_aliasing}":h=iw/"${anti_aliasing}"[circular shaped video];\
[vignette][circular shaped video]overlay" \
-filter_complex_threads 1 \
-c:v libx264 \
-c:a aac \
-preset ultrafast \
"result_square.mp4"
圆形视频(带透明度的方形视频)
in="snowboarder.mp4"
# edge of vignette can be jagged.
# use value between 1 - 2 (e.g. 1.2). 1 doesn't do anything.
anti_aliasing=2
ffmpeg \
-i "${i}" \
-filter_complex "\
[0:v]crop=ih:ih[video square];\
[video square]split=3[black canvas][white canvas][video square];\
[black canvas]setsar=1:1,drawbox=color=black@1:t=fill[black background];\
[white canvas]scale=w=iw*"${anti_aliasing}":h=iw*"${anti_aliasing}",format=yuva444p,geq=lum='p(X,Y)':a='st(1,pow(min(W/2,H/2),2))+st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),ld(1)),255,0)',drawbox=color=white@1:t=fill[scaled up white circle];\
[scaled up white circle]scale=w=iw/"${anti_aliasing}":h=iw/"${anti_aliasing}"[white circle];\
[black background][white circle]overlay[alpha mask];\
[video square][alpha mask]alphamerge,format=yuva420p" \
-filter_complex_threads 1 \
-c:v libvpx -auto-alt-ref 0 \
-c:a libvorbis \
-preset ultrafast \
"result_square.webm"
关于ffmpeg - 如何在不对视频应用图像蒙版的情况下创建圆形视频(视频顶部的透明区域)效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66710672/
从开发者的角度来看,Mac 版 Safari 和 Windows 版 Safari 有何不同? 我认为可以归结为评估两者之间的差异(如果我遗漏了什么,请更正): - 布局渲染 - Javascript
正如标题所说:Android 版 Chrome 和 iOS 版 Chrome 有什么区别。 我对两者进行了一些研究,但找不到关于该主题的任何最新信息。进行这项研究的原因是因为我正在研究某些 Web A
我有以下脚本可以获取您的地理位置并重定向您到 Google map : (function(){ navigator.geolocation.getCurrentPosition(function(p
我负责修复导航栏显示比应有的低 1 像素的问题。 查看网站后,我无法找到所报告的问题,直到我在 Mac 上进行了检查。 Firefox、Safari 等在 Mac 上运行良好,但 Chrome 是导致
我是典型的 .NET 开发人员(C# 是我的第一语言),几年前转向 ASP.NET MVC。现在是我职业生涯发生重大变化的新时期。如果我们看看 Web 开发的前景,我们可以看到新技术如何占领世界,而其
Grails 2.0 项目目前带有资源插件 1.1.5,它似乎有几个依赖问题(例如,参见 this post 的答案)。我正在使用 IntelliJ,虽然我将 BuildConfig.groovy 更
我有一个支持 android 2.3.3 的 android 项目。 但它也支持 sdk 版本 17。当我创建一个新 Activity 时,它会创建一个特定于版本 17 的 Activity 。 如何
有没有人有在 Android 设备上使用 pjsip 的经验?我看到几个非商业/测试项目使用它,所以我假设它可以完成,但没有一个有很好的记录。我认为 pjsip-jni 项目是一个不错的起点,但基本上
谁能告诉我在 Xcode (iPhone) 中执行以下操作的最佳方法是什么。 我有一个主导航屏幕,上面有一些按钮。当用户单击任何按钮时,他们将被带到带有更多选项按钮的子导航屏幕。在这里,他们单击任意一
我正在使用 JBoss Embedded beta3.SP10 版本,我正面临一个应该在某些 Hibernate 版本中修复的持久性错误。可悲的是,我不知道我的 JBoss Embedded 中使用的
我想在 android 中使用简单的 snmp get。我找到了 java 的代码并尝试在 android 中使用它。我还附加了 snmp4j.jar 文件用于 android。但是我得到了 Null
我的实现目标是: 可以通过一个或多个关键词搜索到文章。 可以通过文章的关键词列表查询到其相关文章。 查询到的结果依据相关程度降序排列。 查询速度要够快。(理论上关键词检索比全文检索要快很多的
我正在尝试创建一个允许我将视频从 iPhone 流式传输到服务器的应用程序。我目前关于如何做到这一点的理论是创建一系列 FFMpeg 文件并将它们发送到服务器。据我所知,我已经编译了 FFMpeg图书
这个问题在这里已经有了答案: Login failed in github for window (5 个回答) 7年前关闭。 当我安装 GitHub 时,我无法使用我的帐户凭据登录。 我收到错误 L
我需要在我的 iPad 项目中使用 Three20。我想知道 iPhone 版本的 Three20 项目是否可以直接在 iPad 上使用,还是应该等待这个时间线完成: http://three20.i
有人能做到吗 http://www.surina.net/soundtouch/适用于 iPhone? 简单的 Xcode 演示会很有帮助。 我只想通过一些音调操作来播放音效。谢谢克里斯 最佳答案 使
如何在iPhone中使用“speex”进行音频编码/解码?我没有在项目中添加框架。 最佳答案 这个blog entry: Compile Speex For iPhone克利夫顿·克雷格(Clifto
我想知道bonjour是公共(public)API还是私有(private)API?我们可以直接在我们的应用程序中使用它吗? 最佳答案 Bonjour 由 NSNetServices 和 CFNetS
••••• 已解决•••••该应用程序可用。只是花了一些时间才出现。我之所以将其视为测试版,是因为我的 Google 帐户用于 alpha 测试。如果您遇到同样的问题,只需从测试人员中删除您的帐户并等
我是 Android 编程初学者。 我在使用 Android 下载文件时遇到问题 我使用了 Httpost、Httpget 和 hhtpurlconnection前两个根本不起作用第三个两次无法下载
我是一名优秀的程序员,十分优秀!