ffmpeg各种操作处理

1.去水印

ffmpeg -i /full/37089f471e1db3797767a5e8fd322c9eb2f409ce.mp4 -b:v 2272k -vf delogo=x=608:y=1213:w=100:h=50 -c:a copy /full/a1.mp4

-b:v:视频源的码率

x,y,w,h:logo相对视频左上角的坐标及长宽

 

2.增加水印

https://blog.csdn.net/liuzehn/article/details/83062043

https://www.cnblogs.com/zxqstrong/p/4595413.html

另一种加水印方式:

ffmpeg -i input.mp4 -vf "movie=logo.png,colorkey=black:1.0:1.0 [wm]; [in][wm]overlay=30:10[out]" output.mp4

colorkey:背景色

overlay=logo图片位置(图片大小根据你裁剪的宽高设定)

black:设置背景色尽量和原视频颜色一致(注:图片原有颜色会被过滤)

 

增加文字水印:

ffmpeg  -i input.mp4  -vf "drawtext=fontsize=100:fontfile=/System/Library/Fonts/Apple Braille.ttf:text='文字':x=0:y=0:fontcolor=white:shadowy=2"  -y output.mp4
drawtext的各种参数请参看官方文档!fontfile为该类型文字的系统所在位置!

https://blog.csdn.net/weixin_33920401/article/details/87380124

 

3.视频文件截图

https://blog.csdn.net/psh18513234633/article/details/79175423

ffmpeg -i 本地视频 -y -ss 00:00:15 -t 0.001 图片名.jpg

4.视频解析过程中出现的异常

[h264 @ 0x58c8900] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x58e4dc0] Invalid NAL unit size (805262716 > 41).
[h264 @ 0x58e4dc0] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x59013c0] Invalid NAL unit size (805262304 > 137).
[h264 @ 0x59013c0] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x591dbc0] Invalid NAL unit size (-2078889831 > 1024).
[h264 @ 0x591dbc0] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x593a300] Invalid NAL unit size (-259707567 > 676).
[h264 @ 0x593a300] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x5956b00] Invalid NAL unit size (-259568828 > 14771).
[h264 @ 0x5956b00] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x5973300] Invalid NAL unit size (1243754111 > 353).
[h264 @ 0x5973300] Error splitting the input into NAL units.
Error while decoding stream #0:0: Invalid data found when processing input
Too many packets buffered for output stream 0:1.
[h264 @ 0x598fa80] Invalid NAL unit size (805262716 > 41).
[h264 @ 0x598fa80] Error splitting the input into NAL units.
Conversion failed!

看视频源文件,发现视频源文件打不开,问题在于视频本身的问题!

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值