随时随地将 MP3 文件转换为 (256,128,64 kbps) (PHP)
我有一个高质量的 .mp3 文件(512 kbps),现在根据用户的互联网连接,我希望以不同的质量流式传输文件,
例如: 具有高速互联网连接的互联网用户将以 256kbps 的速度进行流式传输,而具有慢速互联网连接的互联网用户将以低质量的 .mp3 文件进行流式传输
是否可以随时随地执行此操作(当文件进行流式传输时,而不是存储同一曲目的声音文件的不同质量)
谢谢
I have a high quality .mp3 file (512 kbps), now depending on the internet connection of the user, I wish to stream the files in different qualities
Eg:
A Internet user with a high speed internet connection would be streamed a 256kbps whereas a one with a slow internet connection would be streamed a low quality .mp3 file
Is it possible to do so on the go (while the file is streaming, instead of storing different qualities of sound files of the same track)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这当然是可能的,但我想说这种方法效率低下。除非您缓存将生成的各种文件,否则这种方法将导致每次发出请求时都会对文件进行转码。如果您缓存转码后的文件,但缓存版本不可用(尚未创建),则客户端将不得不等待转码文件所需的时间(根据长度,很容易达到 10 甚至 20 秒)文件的大小和服务器的速度)。
我宁愿只创建一个低质量版本,所有客户端都会提前收到,例如 112 kbps。这将是一个“一刀切”的解决方案。这些文件将具有足以满足大多数用途和大多数客户端的流媒体音质。然后我就可以下载高质量版本。
可能有更先进的解决方案,但您最终可能会为此付出相当多的代价,但不会获得太多收益。
It is certainly possible, but I'd say the approach is inefficient. Unless you cache the various files that will be produced, this approach would result in files being transcoded every single time a request is made. If you cache the transcoded files, but a cached version is not available (have not been created yet), the client would have to wait the time it takes to transcode a file (which can easily be 10 or even 20 seconds depending on the length of the file and the speed of the server).
I'd rather just create a low quality version which all clients would receive, say 112 kbps, in advance. It will be a "one size fits all" solution. The files will have a streaming sound quality good enough for most purposes, and most clients. Then I'd have the high quality version available for download.
There might be more advanced solutions out there, but you'll probably end up paying quite a bit for it without gaining too much.