ffmpeg使用xfade的转场特效

ffmpeg使用xfade的转场特效

1. 介绍

参考文档
ffmpeg是一个音视频编辑工具,具体的。。。。我才搞接触,所以不懂。
xfade是一种视频转场滤镜,用于在两个视频片段之间创建平滑的过渡效果。xfade的转场效果入口
但是我有需求!!!我的需求是实现翻页的效果。
我理解就是这样的效果。结论是xfade自带的效果没有这个,不过它可以自己实现,然而我不会哦,所以。。。。我的需求这个方法gg了。
在这里插入图片描述

2. ffmpeg里面的xfade

官网文档里面少了还挺多。
抄下来:

The filter accepts the following options:

transition
Set one of available transition effects:

‘custom’
‘fade’
‘wipeleft’
‘wiperight’
‘wipeup’
‘wipedown’
‘slideleft’
‘slideright’
‘slideup’
‘slidedown’
‘circlecrop’
‘rectcrop’
‘distance’
‘fadeblack’
‘fadewhite’
‘radial’
‘smoothleft’
‘smoothright’
‘smoothup’
‘smoothdown’
‘circleopen’
‘circleclose’
‘vertopen’
‘vertclose’
‘horzopen’
‘horzclose’
‘dissolve’
‘pixelize’
‘diagtl’
‘diagtr’
‘diagbl’
‘diagbr’
‘hlslice’
‘hrslice’
‘vuslice’
‘vdslice’
‘hblur’
‘fadegrays’
‘wipetl’
‘wipetr’
‘wipebl’
‘wipebr’
‘squeezeh’
‘squeezev’
‘zoomin’
‘fadefast’
‘fadeslow’
‘hlwind’
‘hrwind’
‘vuwind’
‘vdwind’
‘coverleft’
‘coverright’
‘coverup’
‘coverdown’
‘revealleft’
‘revealright’
‘revealup’
‘revealdown’
Default transition effect is fade.

duration
Set cross fade duration in seconds. Range is 0 to 60 seconds. Default duration is 1 second.

offset
Set cross fade start relative to first input stream in seconds. Default offset is 0.

expr
Set expression for custom transition effect.

The expressions can use the following variables and functions:

X
Y
The coordinates of the current sample.

W
H
The width and height of the image.

P
Progress of transition effect.

PLANE
Currently processed plane.

A
Return value of first input at current location and plane.

B
Return value of second input at current location and plane.

a0(x, y)
a1(x, y)
a2(x, y)
a3(x, y)
Return the value of the pixel at location (x,y) of the first/second/third/fourth component of first input.

b0(x, y)
b1(x, y)
b2(x, y)
b3(x, y)
Return the value of the pixel at location (x,y) of the first/second/third/fourth component of second input.

每种效果可以到前面的网址进入,这里粘贴一些过来。
在这里插入图片描述

3. 使用

ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=revealup:duration=2:offset=5 output.mp4
  • 使用first.mp4 second.mp4合成一个2s的转场视频,从第一个视频的第5s开始合并。合并的特效是revealup
  • 示意图:
|=offset=|
         |<==duration==>|
AAAAAAAAAAAAAAAAAAAAAAAA
         BBBBBBBBBBBBBBBBBBBBBBBBBBB
         
         ||
AAAAAAAAA===revealup====BBBBBBBBBBBB
  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值