當前位置:
首頁 >
ffmpeg各种操作处理
發布時間:2024/3/12
36
豆豆
生活随笔
收集整理的這篇文章主要介紹了
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 圖片名.jpg4.視頻解析過程中出現的異常
[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!看視頻源文件,發現視頻源文件打不開,問題在于視頻本身的問題!
?
?
總結
以上是生活随笔為你收集整理的ffmpeg各种操作处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 100行代码实现最简单的基于FFMPEG
- 下一篇: 端口号是什么以及常见端口号