ffmpeg - 如何组合这些 FFMPEG 命令?
问题描述
添加徽标
ffmpeg -i mainVideo.mp4 -i logo.mov -filter_complex "[0:v]setpts=PTS-STARTPTS[v0];[1:v]setpts=PTS-STARTPTS+36/TB[v1];[v0][v1]overlay=eof_action=pass[out1]" -map [out1] -threads 5 -y main_with_logo.mp4
删除语音
ffmpeg -i main_with_logo.mp4 -c:v copy -an main_with_logo_s.mp4 -y
添加扬声器声音
ffmpeg -i main_with_logo_s.mp4 -i voice.mp3 -filter:a "volume=2.5" -vsync vfr -pix_fmt yuv420p -b:v 4400k -vf fps=25 -c:a aac -strict experimental main_with_logo_voice.mp4 -y -threads 5
添加背景音乐
ffmpeg -i main_with_logo_voice.mp4 -i bgm.mp3 -filter_complex amix=inputs=2:duration=first:dropout_transition=2 -y -threads 5 main_with_logo_voice_bgm.mp4
添加字幕
ffmpeg -i main_with_logo_voice_bgm.mp4 -vf "subtitles=main.srt:force_style='Fontname=jx,Fontsize=16'" -threads 5 -y main_with_logo_voice_bgm_srt.mp4
所有这些步骤都需要很长时间,我怎样才能将这些 cmd 组合成一两个?
解决方案
组合命令:
ffmpeg -i mainVideo.mp4 -i logo.mov -i voice.mp3 -i bgm.mp3 -filter_complex "[0:v]setpts=PTS-STARTPTS[v0];[1:v]setpts=PTS-STARTPTS+36/TB[v1];[v0][v1]overlay=eof_action=pass,subtitles=main.srt:force_style='Fontname=jx,Fontsize=16',format=yuv420p;[2:a]volume=2.5[voice];[voice][3:a]amix=inputs=2:duration=first:dropout_transition=2" output.mp4
推荐阅读
- vb6 - VB6 错误:对象变量或未设置块变量
- ios - iOS 13 后台上传错误:尝试将多达 500 张图像上传到 AWS 服务器
- python - Python列表索引超出范围 - 算法
- android - 使用 Serilizable 注释检查响应项的空白值
- machine-learning - 如何明确哪些模型层用于机器学习?
- reactjs - 重定向后反应状态数据未准备好
- python - 如何使用 Socks5 代理 scrapy 请求?
- java - 错误 java.lang.IllegalArgumentException: NamedQuery of name: Employee.findAll not found
- azure - 在 Azure Dev Ops 代理上安装 Az 2.8.0 Powershell 模块
- node.js - REST 命名约定 JOIN