K
K
Konstantin Khairov2017-09-09 14:59:30
Programming
Konstantin Khairov, 2017-09-09 14:59:30

Problem with nginx module ngx_http_mp4_module, how to fix?

Hello!
Installed the ngx_http_mp4_module module for pseudo-translation, on the server there are two disks on which mp4 files are located. The first disk is the main OS on it, nginx itself, etc. The second disk is additionally connected and mounted in the first one.
That is:
/var/www/sitename/public_html/video/Movie1/ #Files from the first disk are
here /var/www/sitename/public_html/video/Movie2/ #Files from the second disk
are here The problem is, if the video from the first disk they support rewinding in the Flash player, then on the second disk a 500 error is issued. Checking both through the player and through the link the name.mp4
?start=242
From the first disc, they are broadcast correctly from 242 seconds, but from the second disc, an error 500 comes out. Tried to increase buffer_size in nginx settings didn't help. I am not an expert in Linux, but there is an assumption that the problem may be that there are not enough rights. I want to note that the html player produces video from the 2nd disk and also rewinds calmly, the files themselves are available and downloaded from the second disk, but when rewinding, a 500 error appears.
Nginx config for the site

server {
        listen 80;
        server_name    sitename; # доменное имя, относящиеся к текущему виртуальному хосту
        root  /var/www/sitename/public_html/; # каталог в котором лежит проект, путь к точке входа

        index index.html;
        # add_header Access-Control-Allow-Origin *;

        # serve static files directly
        location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
                access_log off;
                expires max;
                log_not_found off;
       }


        location / {
            mp4;
            mp4_buffer_size 50m;
            mp4_max_buffer_size 100m;
            sendfile on;
            tcp_nopush on;
            tcp_nodelay on;
            expires max;
            directio 10m;
#            limit_rate 96k;
#            limit_rate_after 3m;
        }


    location ~ /\.ht {
                deny all;
        }
}

What could be the problem? Thank you in advance .

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
ddd329, 2019-05-22
@allaga

Well, of course, if you are a beginner, it is not entirely clear what he wanted from you. But it seems to me that the naming of variables is trite, to divide the logic into parts, i.e. to take out something in procedures/functions, well, etc. The most banal.
If you are an experienced programmer, then he rather wanted you to do a full-fledged refactoring of the code, plus covering it with unit tests.
Can you show me this little script? I think the society will be interested in it, and they will give good advice.

A
ApeCoder, 2019-05-22
@ApeCoder

Martin Fowler "Refactoring, improving the design of existing code"
Robert Martin "Clean code. Creation, analysis and refactoring"

N
Nurlan, 2017-09-20
@daager

Where and how do you convert video? Perhaps the fact is that the video meta-data is at the end of the file, and not at the beginning. Try using qt-faststart.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question