# Nginx and pseudo-streaming

**URL:** <https://www.ruby-forum.com/t/nginx-and-pseudo-streaming/244106>\
**Category:** NGINX\
**Created:** [February 21, 2016, 5:41pm UTC](https://www.ruby-forum.com/t/nginx-and-pseudo-streaming/244106 "2016-02-21T17:41:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [February 21, 2016, 5:41pm UTC](https://www.ruby-forum.com/t/nginx-and-pseudo-streaming/244106/1 "2016-02-21T17:41:12Z")

</div>

I use this modules for compiling nginx for streaming videos on my web  
site  
by these options :

nginx version: nginx/1.8.1  
built by gcc 4.9.2 (Debian 4.9.2-10)  
built with OpenSSL 1.0.1k 8 Jan 2015  
TLS SNI support enabled  
configure arguments: --sbin-path=/usr/sbin/nginx  
–conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error.log  
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi  
–http-log-path=/var/log/nginx/access.log  
–http-proxy-temp-path=/var/lib/nginx/proxy  
–http-scgi-temp-path=/var/lib/nginx/scgi  
–http-uwsgi-temp-path=/var/lib/nginx/uwsgi  
–lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid  
–with-http\_dav\_module  
–with-http\_flv\_module --with-cc-opt=‘-O2 -g -pipe  
-Wp,-D\_FORTIFY\_SOURCE=2  
-fexceptions  
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic’  
–with-http\_geoip\_module  
–with-http\_gzip\_static\_module --with-http\_image\_filter\_module  
–with-http\_realip\_module  
–with-http\_stub\_status\_module --with-http\_ssl\_module  
–with-http\_mp4\_module  
–with-http\_sub\_module  
–with-http\_xslt\_module --with-ipv6 --with-sha1=/usr/include/openssl  
–user=www-data --group=www-data  
–without-mail\_pop3\_module --without-mail\_imap\_module  
–without-mail\_smtp\_module --with-http\_stub\_status\_module  
–with-http\_spdy\_module --with-md5=/usr/include/openssl --with-mail  
–with-mail\_ssl\_module  
–with-http\_secure\_link\_module --add-module=naxsi-master/naxsi\_src/  
–with-http\_gunzip\_module --with-file-aio  
–with-http\_addition\_module --with-http\_random\_index\_module  
–add-module=ngx\_cache\_purge-2.3/  
–with-http\_degradation\_module --with-http\_auth\_request\_module  
–with-pcre  
–with-google\_perftools\_module  
–with-debug --http-client-body-temp-path=/var/lib/nginx/client  
–add-module=nginx-rtmp-module-master/  
–add-module=headers-more-nginx-module-master  
–add-module=nginx-vod-module-master/  
–add-module=/home/user/M/ngx\_pagespeed-release-1.9.32.2-beta/  
and also i buy jwplayer for serving video on my site,

and this is my configuration on Nginx for pseudo streaming on nginx.conf  
:

location videos/ {  
flv;  
mp4;  
mp4\_buffer\_size 4M;  
mp4\_max\_buffer\_size 10M;  
limit\_rate 260k;  
limit\_rate\_after 3m;  
#mp4\_limit\_rate\_after 30s;}  
but when i do this : [http://172.16.1.2/videos/a.mp4?start=33](http://172.16.1.2/videos/a.mp4?start=33)

video started from beginning , whats wrong in my configuration? what  
should  
i do ?

Posted at Nginx Forum:

> **[Nginx and pseudo-streaming](https://forum.nginx.org/read.php?2,264691,264691#msg-264691)**
>
> I use this modules for compiling nginx for streaming videos on my web site by these options : nginx version: nginx/1.8.1 built by gcc 4.9.2 (Debian 4.9.2-10) built with OpenSSL 1.0.1k 8 Jan 2015 TLS SNI support enabled configure arguments:...

---

<div class="post-metadata">

**Author:** ![maziar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@maziar](https://www.ruby-forum.com/u/maziar)\
**Post date:** [February 22, 2016, 5:51pm UTC](https://www.ruby-forum.com/t/nginx-and-pseudo-streaming/244106/2 "2016-02-22T17:51:39Z")

</div>

Hi Maziar,

On 21/02/16 16:40, maziar wrote:

> but when i do this : [http://172.16.1.2/videos/a.mp4?start=33](http://172.16.1.2/videos/a.mp4?start=33)
> 
> video started from beginning , whats wrong in my configuration? what should  
> i do ?

Have you done “?start=0” first to read the metadata? From the manual:

> **[Module ngx\_http\_mp4\_module](http://nginx.org/en/docs/http/ngx_http_mp4_module.html)**

“To start playback, the player first needs to read metadata. This is  
done by sending a special request with the start=0 argument.”

## Kind Regards

Andrew H. (LinuxJedi)  
Technical Product Manager, NGINX Inc.
