douqian1835
2011-03-08 22:15 阅读 52
已采纳

使用PostgreSQL附带的Apache / PHP服务器向iOS设备提供视频

I am developing a system in which a server will serve a video to a device (iDevice or otherwise) and then ask the user to rate the video. I had decided to use PostgreSQL for my database, and let it install an Apache and PHP server to work against (as found here http://www.enterprisedb.com/products-services-training/pgdownload).

It seems, however, that this server isn't configured quite like a typical Apache/PHP install. When an iDevice attempts to download a video from the server, the iDevice gives this error:

Cannot play movie—The server is not correctly configured

I've done some research, and learned that iDevices require byte-range request functionality, so I checked my server's access logs and found this:

xx.xx.xx.xx - - [08/Mar/2011:11:45:56 -0700] "GET temp.mp4 HTTP/1.1" 206 2
xx.xx.xx.xx - - [08/Mar/2011:11:45:56 -0700] "GET temp.mp4 HTTP/1.1" 200 17760579

(where "17760579" was the exact size in bytes of the particular file)
They should look something like this:

xx.xx.xx.xx - - [07/Mar/2011:18:04:11 -0700] "GET temp.mp4 HTTP/1.1" 206 2
xx.xx.xx.xx - - [07/Mar/2011:18:04:11 -0700] "GET temp.mp4 HTTP/1.1" 206 25947357
xx.xx.xx.xx - - [07/Mar/2011:18:04:11 -0700] "GET temp.mp4 HTTP/1.1" 206 60637
xx.xx.xx.xx - - [07/Mar/2011:18:04:11 -0700] "GET temp.mp4 HTTP/1.1" 206 25880928

So, I know that my server isn't dealing with some byte-range requests properly. However, using curl to check for this functionality returns a proper result:

curl --range 0-99 http://url/temp.mp4 -o /dev/null
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                               Dload  Upload   Total   Spent    Left  Speed
  0   100    0   100    0     0   8574      0 --:--:-- --:--:-- --:--:-- 10000

I've ensured that the video MIME types are properly configured.

I'm not sure where to go from here. Something, somewhere, is misconfigured in this server.

Update: Here are appropriate version numbers:

Server version: Apache/2.2.16 (Unix)
Server built: Oct 7 2010 00:26:09
PHP version 5.3.3
PostgreSQL 9.0.2 on x86_64-apple-darwin

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • 已采纳
    dongxueji2838 dongxueji2838 2011-03-25 20:43

    I couldn't figure out how to fix this problem. I had initially used the PostgreSQL/Apache/PHP install package found at the site in my comment on the question because it was a way to install all three and make sure they worked without hassle. Obviously, since the resulting server didn't provide the functionality I needed, I had the option of installing everything from scratch. I used the instructions found here to achieve this result. The instructions are a bit out of date, but the process worked.

    点赞 评论 复制链接分享
  • drrhr20884 drrhr20884 2011-03-09 00:39

    iOS Devices use a streaming service called "HTTP Live Streaming", it was developed when apple released the Quicktime Streaming Server (QSS).

    Unless your server is configured to do live streaming, your videos will simply download, and then play. Not play on demand.

    Another option is RTSP streaming, but I'm not sure how the rating system comes into play with all of this. That sounds like a job for an iPhone / iOS app.

    点赞 评论 复制链接分享
  • douna4762 douna4762 2015-04-23 05:00

    Apache needs mod_h264 installed and enabled to properly handle mp4's with the byte range requests. Have you checked for the presence of this mod?

    点赞 评论 复制链接分享

相关推荐