[edit] mp4_max_buffer_size

Syntax: mp4_max_buffer_size size
Default: 10M
Context: http
server
location
Reference: mp4_max_buffer_size


Sets the maxium buffer size used for processing mp4 file. If the meta data exceeds this size Nginx will return a 500 status code and log an error resembling the following:

"/video/file.mp4" mp4 moov atom is too large:
12583268, you may want to increase mp4_max_buffer_size

[edit] Notes

This module does not as of 1.3.4 support seeking through embedded subtitle tracks. Though this is a forced limitation and it works fine without it. There is a patch to enable this functionality.

Update: This is now fixed in 1.3.5 and no longer required.

--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -1842,14 +1842,6 @@ ngx_http_mp4_read_stsd_atom(ngx_http_mp4
                    ngx_mp4_get_32value(stsd_atom->entries),
                    4, stsd_atom->media_name);
 
-    /* supported media format: "avc1" (H.264) and "mp4a" (MPEG-4/AAC) */
-
-    if (ngx_strncmp(stsd_atom->media_name, "avc1", 4) != 0
-        && ngx_strncmp(stsd_atom->media_name, "mp4a", 4) != 0)
-    {
-        return NGX_DECLINED;
-    }
-
     trak = ngx_mp4_last_trak(mp4);
 
     atom = &trak->stsd_atom_buf;

Please note that to avoid excessive seeking time the MP4 files have to use sample based interleaving of the media tracks and hint tracks. MP4Box provides this functionality through the -tight parameter.

For reference please see the following bug report: http://trac.nginx.org/nginx/ticket/194

[edit] References

Please see the following page for more details: http://nginx.org/en/docs/http/ngx_http_mp4_module.html


Module: HttpMp4Module