<p>tunist:</p>

<p>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.</p>

<p>If you check here: <a href="http://nginx.org/en/docs/http/ngx_http_mp4_module.html" rel="nofollow">http://nginx.org/en/docs/http/ngx_http_mp4_module.html</a>  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.</p>

<p>--dan</p>

CC BY-SA 3.0
2015-08-05T17:20:21.110Z
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
CC BY-SA 3.0
2015-08-07T11:38:48.313Z
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: http://codesamplez.com/programming/php-html5-video-streaming-tutorial
tunist
CC BY-SA 3.0
2015-08-05T17:10:01.377Z
2015-08-05T17:10:01.377Z
Dan
<p>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 (<a href="http://codesamplez.com/programming/php-html5-video-streaming-tutorial" rel="nofollow">http://codesamplez.com/programming/php-html5-video-streaming-tutorial</a>) to the page and so far the streaming is working well in my tests :)</p>

CC BY-SA 3.0
2015-08-07T12:28:19.553Z
2015-08-07T12:28:19.553Z
tunist
<p>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.</p>

<p>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.</p>

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

<p>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.</p>

<p>the thread i already opened on serverfault is here: <a href="https://serverfault.com/questions/710304/why-is-partial-content-not-being-served-in-nginx-mp4">https://serverfault.com/questions/710304/why-is-partial-content-not-being-served-in-nginx-mp4</a></p>

<p>i am not longer using any mp4 specific directives in nginx.</p>

<p>anyone know what i am missing here?</p>

<p>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!?) <a href="https://www.ureka.org/file/play/17924/censored%20on%20google%202.mp4" rel="nofollow noreferrer">https://www.ureka.org/file/play/17924/censored%20on%20google%202.mp4</a></p>

<video><streaming>
what is preventing me from streaming video correctly with nginx?
tunist
# what is preventing me from streaming video correctly with nginx?

(Asked by: username_0 on 2015-08-05)

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>

**Tags:** video, streaming


---

## 2 answers

### Answer by username_1 on 2015-08-05. Score: 1

username_0:

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

> **Comments:**
> **username_0**: 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!  
> **username_0**: 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: http://codesamplez.com/programming/php-html5-video-streaming-tutorial  

---

### Answer by username_0 on 2015-08-07. Score: 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 :)


---

