FFMPEG-PHP 修剪 MP3 文件的代码示例
我在这里和网上搜索过。并且还没有找到明确的 PHP 示例来获取单个 MP3 文件并将其修剪为较小的文件(删除开始和结束部分并仅保留指定开始时间和结束时间之间的内容)..
我正在尝试要做的是将开始时间、结束时间和 mp3 文件名传递给 PHP 脚本,然后使用 FFMPEG-PHP 有效地修剪或连接该原始文件。无需重新编码(并保留所有原始文件元数据,等等)
如果你提供一个如何在一个 PHP 文件中处理 MP3 文件的示例,它将有很大帮助!我正在尽力帮助我们的教会,但我对 FFMPEG-PHP 的了解还不足以单独解决这个问题..:)
谢谢!
I've searched here and online,. and have not found clear PHP examples for taking a single MP3 file, and trimming it to a smaller file (removing both beginning and end portions and retaining only the content between a specified start time and end time)..
What I'm trying to do is pass the start time, end time and mp3 file name to a PHP script, that will then use FFMPEG-PHP to effectively trim or concat that orig file.. without re-encoding it (and retaining all the orig. file metadata, etc.)
If you provide an example of how to process an MP3 file like this, within one PHP file, it will help a lot! I'm trying my best to help out our church, and simply don't know FFMPEG-PHP enough to sort this out solo.. :)
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通常使用 Sox 进行音频编辑,它是一个免费的命令行工具,您可以将其与 php 和 exec() 一起使用;
裁剪音频文件的命令:
其中 0 是起点,10 是终点。至于保留元数据,您必须尝试一下并让我知道。
http://www. thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/
I usually use Sox for my audio editing, it is a free command line tool that you can use with php with exec();
The command to crop an audio file:
where 0 is the start point and 10 is the end. As far as retaining meta data, you will have to try it and let me know.
http://www.thegeekstuff.com/2009/05/sound-exchange-sox-15-examples-to-manipulate-audio-files/