1

i am running nginx v.1.9.3 here to serve my website and also video files for streaming. i am seeing that the mp4 files are always served with a code of 200 and that partial content requests are ignored. sometimes videos are able to be 'seeked' in browsers and sometimes not. i have used various file formats and the results vary from ok-ish to fatally bad.

i have now ensured that all MP4 files have had heir moov atom relocated to the beginning of the file and that has not resolved the problems, in general - since most of the video files were ok in that regard anyway.

i used curl -I to view the return data from nginx and saw that there was no mention of the server accepting byte-ranges.

i asked about this in several places already, but so far no-one has found the solution and i have been forwarded to this video part of stackexchange on the premise that the video format may be the cause. however, i do not think that is the case because there are numerous formats involved and they all exhibit problems.

the thread i already opened on serverfault is here: https://serverfault.com/questions/710304/why-is-partial-content-not-being-served-in-nginx-mp4

i am not longer using any mp4 specific directives in nginx.

anyone know what i am missing here?

this is an example of an MP4 file that i am having problems seeking with in browsers (except strangely i am finding that firefox in fedora 22 works most of the time!?) https://www.ureka.org/file/play/17924/censored%20on%20google%202.mp4

2 Answers 2

1

tunist:

You've gotten pretty close to getting this going - nice that you did the curl to determine that the byte-range was not being honored. I had done exactly that in the past when setting this up.

If you check here: http://nginx.org/en/docs/http/ngx_http_mp4_module.html You may find what you're looking for - it is unclear whether you're using this module or not already, so perhaps this is what you need.

--dan

2
  • i did originally use the mp4 module, but i see that is only relevant for flash players and i am doing what i can to avoid flash. i am using video.js as a front end player, which does have a flash fallback mode, but the problems are occurring when flash is not being used.. so one of the nginx devs already pointed me to the reality that the mp4 module is not going to help here. i did notice in the mp4 mod notes that the ?start=0 is needed - which i have never added.. so i'll bare that in mind for flash compatibility if i ever get that far!
    – tunist
    Aug 5, 2015 at 17:20
  • oh, so it seems likely that i need to add extra logic into the PHP page that handles the video stream to support range requests - as detailed here: codesamplez.com/programming/php-html5-video-streaming-tutorial
    – tunist
    Aug 7, 2015 at 11:38
1

the cause of the problem was the lack of range handling in the PHP page i am using for streaming the files. i forgot that that is a requirement of the process! i have added the videostream class (http://codesamplez.com/programming/php-html5-video-streaming-tutorial) to the page and so far the streaming is working well in my tests :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.