使用纯PHP将.mp4转换为.mp3 [英] Convert .mp4 to .mp3 using pure PHP

查看:376
本文介绍了使用纯PHP将.mp4转换为.mp3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不浪费大量资源的情况下,使用PHP将视频(.mp4)从外部网站(例如:youtube.com)转换为.mp3?与 http://youtube-mp3.org/类似,他们可以非常轻松地进行转换.

How do I convert a video (.mp4) from an external site (ex: youtube.com) to an .mp3 using PHP without wasting a lot of resources? So similar to http://youtube-mp3.org/, they are able to convert it very easily.

谢谢.

推荐答案

您可以通过shell命令将其转换,例如[*]

you can convert it by shell-command eg [*]

  <?php 
      exec('ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3');
  ?>

  • 如果您的操作系统是Unix并且已安装ffmpeg
  • 这篇关于使用纯PHP将.mp4转换为.mp3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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