Nginx MP4 streaming

Status
Not open for further replies.

AmN

Active Member
342
2009
41
185
Have problem with mp4 streaming, flv working fine and can seek in player, but when i try seek mp4 in firebug have internal 500 error...

here is my nginx.conf
Code:
location ~* \.(png|jpg|jpeg|gif)(\?ver=[0-9.]+)?$ {
    root /home/xxx/public_html/media;
    access_log off;
    log_not_found off;
    expires 30d;
}
location ~\.mp4$  {
    secure_link $arg_st,$arg_e;
    secure_link_md5 segredo$uri$arg_e;
        if ($secure_link = "") {
            return 403;
        }
        if ($secure_link = "0") {
            return 403;
        }
    gzip off;
    root /home/xxx/public_html/media;
    limit_rate_after 10m;
    limit_rate 400k;
    #internal; 
    mp4;
    mp4_buffer_size     1m;
    mp4_max_buffer_size 5m;
}

location ~ \.flv$ {
    secure_link $arg_st,$arg_e;
    secure_link_md5 segredo$uri$arg_e;
        if ($secure_link = "") {
            return 403;
        }
        if ($secure_link = "0") {
            return 403;
        }
    gzip off;
    root /home/xxx/public_html/media;
    limit_rate_after 10m;
    limit_rate 400k;
    #internal; 
    flv;
}

In log im found only this 2013/07/05 01:16:50 [error] 2224#0: *481 start time is out mp4 stts samples in "/home/xxx/public_html/media/videos/0613/2808363858/06132808363858.mp4",
Any idea where is problem? im aslo try same video to stream via apache, video is working fine, so its not corrupted!
 
6 comments
You have compiled this module (ngx_http_mp4_module) i guess,

Increase the buffer, it should be fixed when the buffer value is appropriate.
 
Yes
Code:
[root@server1 ~]# nginx -V
nginx version: nginx/1.4.1
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-54)
TLS SNI support disabled
configure arguments: --sbin-path=/usr/local/sbin --with-http_flv_module --with-http_mp4_module --with-http_ssl_module --with-http_secure_link_module

Also im try with
Code:
mp4_buffer_size     5m;
mp4_max_buffer_size 10m;

But error is still there
 
Buffer increasing it not help me, and in log also always same errors
start time is out mp4 stts samples

have you idea whats this means ?
 
Ignor had a patch made for version 1 of Nginx

Code:
--- src/http/modules/ngx_http_mp4_module.c (revision 4303)
+++ src/http/modules/ngx_http_mp4_module.c (working copy)
@@ -1899,7 +1899,7 @@
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
"count:%uD, duration:
", count, duration);

- if (start_time < count * duration) {
+ if (start_time < (uint64_t) count * duration) {
start_sample += (ngx_uint_t) (start_time / duration);
count -= start_sample;
ngx_mp4_set_32value(entry->count, count);

Src : http://forum.nginx.org/read.php?2,218451,218735#msg-218735

Try using that and see if it helps (it might be already applied) ., also take buffer to a very high value and see if it works.
 
Status
Not open for further replies.
Back
Top