使用 PHP 和 curl 获取远程 FLV
我想知道是否可以获取远程 flv 文件并使用 PHP 和 exec 函数对其进行“流式传输”。我的环境中有“curl”,所以我想要类似的东西:
exec ('curl http://myhosts.com/myflv.flv', $out);
print $out;
问题是 $out 作为数组返回;我想输出curl返回的“原始”流。
I want to know if it's possible to get a remote flv file and have it 'stream' using PHP and exec function. I have 'curl' in my environnement so i want something like :
exec ('curl http://myhosts.com/myflv.flv', $out);
print $out;
Problem is that $out is returned as an array; i want to output the 'raw' stream returned by curl.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 fpassthru() ,尽管它将用户重定向到正确的 URL 可能会更好。
或者重定向:
想一想,您甚至应该能够使用 readfile( )
无论如何,如果您可以简单地重定向用户,那就这样做。这效率更高。
You should be able to use fpassthru() for that, although it would probably be better to just redirect the user to the proper URL instead.
Or redirect:
Come to think of it, you should even be able to use readfile()
At any rate, if you can simply redirect the user, do that. It's way more efficient.