FFmpeg 是一个开源软件套件,可促进多媒体数据处理。它包括一组用于转码、编辑和流式传输音频和视频文件的多功能库和程序。FFmpeg 支持一系列多媒体格式和编解码器,使其成为各种多媒体应用的首选工具。
在 Fedora 上安装 FFmpeg 39
步骤 1。在继续安装之前,请确保您的系统具有所有必要的依赖项。Fedora 39 使用 DNF 包管理器,使过程变得简单明了。打开终端并更新系统包:
<span class="pln">sudo dnf clean all sudo dnf update</span>
第2步。在 Fedora 上安装 FFmpeg 39.
更新系统存储库后,安装 FFmpeg 非常简单。在终端中,输入以下命令:
<span class="pln">sudo dnf install ffmpeg</span>
若要验证 FFmpeg 是否已成功安装,可以使用以下命令:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">version</span>
此命令将显示已安装的 FFmpeg 版本以及配置详细信息。如果您看到此信息,则表示 FFmpeg 已正确安装在您的 Fedora 39 系统上。
第 3 步。基本命令 FFmpeg。
FFmpeg 是一个功能强大的命令行工具,用于处理多媒体文件。在 Fedora 上,您可以通过终端使用它。以下是一些带有示例的基本命令:
要检查已安装的 FFmpeg 版本:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">version</span>
要将视频从一种格式转换为另一种格式(例如,从 MP4 转换为 AVI):
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input</span><span class="pun">.</span><span class="pln">mp4 output</span><span class="pun">.</span><span class="pln">avi</span>
要调整视频大小,请使用以下选项:-s
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">s </span><span class="lit">1280x720</span><span class="pln"> output</span><span class="pun">.</span><span class="pln">mp4</span>
要从视频中提取音频:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">vn </span><span class="pun">-</span><span class="pln">acodec copy output</span><span class="pun">.</span><span class="pln">mp3</span>
要从视频中剪切特定部分:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">ss </span><span class="lit">00</span><span class="pun">:</span><span class="lit">01</span><span class="pun">:</span><span class="lit">00</span> <span class="pun">-</span><span class="pln">t </span><span class="lit">00</span><span class="pun">:</span><span class="lit">00</span><span class="pun">:</span><span class="lit">30</span><span class="pln"> output</span><span class="pun">.</span><span class="pln">mp4</span>
要连接或合并视频:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input1</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">i input2</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">filter_complex </span><span class="str">"[0:v][1:v]concat=n=2:v=1:a=0[outv]"</span> <span class="pun">-</span><span class="pln">map </span><span class="str">"[outv]"</span><span class="pln"> output</span><span class="pun">.</span><span class="pln">mp4</span>
要为视频添加水印:
<span class="pln">ffmpeg </span><span class="pun">-</span><span class="pln">i input</span><span class="pun">.</span><span class="pln">mp4 </span><span class="pun">-</span><span class="pln">i watermark</span><span class="pun">.</span><span class="pln">png </span><span class="pun">-</span><span class="pln">filter_complex </span><span class="str">"overlay=10:10"</span><span class="pln"> output</span><span class="pun">.</span><span class="pln">mp4</span>
请记住,这些命令可以根据特定要求进行调整。请务必将 、 和其他文件名/扩展名替换为您的实际文件名和扩展名。此外,编解码器、质量和附加过滤器等选项可以根据您的需要进行调整。input.mp4
output.mp4
感谢您使用本教程在您的 Fedora 39 系统上安装 FFmpeg。有关其他 Apache 或有用信息,我们建议您查看 FFmpeg 官方网站。