PHP Extract audio from video(PHP 从视频中提取音频)
问题描述
我需要一种方法来从一些视频中提取音频(在 PHP 中).我有来自 YouTube 的视频流,所以如果它是实时流媒体,我真的很喜欢它,而不是我必须将它保存到临时目录并在那里处理它(尽管这是可以接受的.)谢谢,艾萨克沃勒
更具体地说,我有一个 MP4,我希望它是 MP3.
I need a way to extract the audio from some video (in PHP). I have the video streaming in from YouTube, so I would really like it if it were on the fly streaming, not I have to save it to a temp directory and process it there (though that is acceptable.) Thanks, Isaac Waller
to be more specific, I have a MP4 and I want it to be a MP3.
推荐答案
你会想要使用类似 ffmpeg 并使用 php 的 exec 命令调用它.如果您在文档中环顾四周,我相信您可以找出仅用于获取音频的标志.
You're going to want to use something like ffmpeg and call it using php's exec command. If you look around in the docs, I'm sure you can figure out what flag to use to only get the audio.
我之前在一个视频实时转码项目中使用过这个应用程序,效果非常好.只需确保您的服务器已正确安装.
I've used this app before on a project for live transcoding of video, works like a charm. Just make sure your server has it correctly installed.
这篇关于PHP 从视频中提取音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP 从视频中提取音频


- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01