如何使用 ffmpeg 只提取 30 秒的音频 [英] How can you only extract 30 seconds of audio using ffmpeg

查看:33
本文介绍了如何使用 ffmpeg 只提取 30 秒的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ffmpeg 进行音频转换.我正在使用这个命令:

I am using ffmpeg for audio conversion. I am using this command:

ffmpeg -i file.mp3 file.wav

这很好用.但是我只想让我的输出文件包含最多 1 分钟的音频.我怎样才能使用 ffmpeg 做到这一点?

This works fine. However I only want to my output file to contain maximum 1 minute of audio. How can I do that using ffmpeg?

推荐答案

使用以下命令:

ffmpeg -ss 0 -t 30 -i file.mp3 file.wav

  • -ss 0 - 从 0 秒开始
  • -t 30 - 捕获 30 秒(从 0 开始,所以 0:00 - 0:30).如果您想要 1 分钟的音频,请使用 -t 60.
  • file.mp3 - 输入文件
  • file.wav - 输出文件
    • -ss 0 - Start at 0 seconds
    • -t 30 - Capture 30 seconds (from 0, so 0:00 - 0:30). If you want 1 minute of audio, use -t 60.
    • file.mp3 - Input file
    • file.wav - output file
    • 这篇关于如何使用 ffmpeg 只提取 30 秒的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆