流媒体视频文件? [英] Streaming video file?

查看:221
本文介绍了流媒体视频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要流flv文件。
流应该看起来像直播流。
和我他们应该是一个方法来更改目标文件。
对不起我的英文不好。

,flv-streaming不是真正的流媒体,但是这是一个正常的文件传输,即使文件没有被完全下载到客户端,Flash播放器也开始播放。时间寻找是以标准的HTTP方式实现的,具有文件下载偏移量 - 如果您在时间轴上半按滚动视频,并且尚未下载,则当前下载(经常)中止,并重新启动,偏移量 filesize / 2 字节。



所以,只要使用普通的 readfile() ,并用 header() 。但是,由于您需要查找,因此您需要解析HTTP请求,而不是 readfile(),请使用
> fpssthru()
,寻求合适的地方。

:避免在PHP端处理这个问题,让Apache(或者你选择的httpd)来处理这个。


I need to stream flv file. streaming should look like live streaming. and I their should be a way to change target file. sorry for my poor English.

解决方案

If by "streaming" you mean "showing a flash-video clip", flv-streaming isn't really streaming, but it's a normal file transfer, with the flash player starting playback even if the file isn't completely downloaded to the client. Time seeking is implemented in a standard HTTP way, with a file download offset - if you scroll the video halfway on the timeline and it hasn't downloaded yet, the current download is (most often) aborted, and restarted with an offset of filesize/2 bytes.

So, you could be fine with just using plain old readfile() and fixing the HTTP mime-type headers appropriately with header(). But, since you'd need seeking, you need to parse the HTTP request and instead of readfile(), use fpassthru(), seeking the right place, instead.

tl;dr: Avoid handling this on the PHP side, and let Apache (or the httpd of your choice) handle this instead.

这篇关于流媒体视频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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