Choppy video / apache / mp4

Choppy video / apache / mp4

by daniel gallardo acosta -
Number of replies: 9

Hi, this is moodle 3.4.1 and last releases centos + apache + local mp4 files; if I choose a decent resolution (720 or + ), visualization goes quite choppy; if I render directly the mp4 file from URL (outside of moodle), it runs fine ... tried Edge, Chrome & firefox without success. Any hint or something I can try? thanks

Average of ratings: -
In reply to daniel gallardo acosta

Re: Choppy video / apache / mp4

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I can think of three things to try.

1) It might still be that your video is "big." I like to open my mp4 in Quicktime, then Window, then Movie Inspector.  My target data rate is under 2 Mbits/sec.

2) It could be that your server is too busy taking care of other tasks.  Try moving the video to another server, ideally a video server, and then link to it in Moodle.  See what happens.

3) Have you checked your Internet speed? (www.speedtest.net)

You can try downloading my video, move it to your server, and see if it plays.  This one is around 600 Kbit/sec.  Here on moodle.org, it is a link to my video on my universities video server.  Trying to play this might also tell you something about your ISP bandwidth.


In reply to Rick Jerz

Re: Choppy video / apache / mp4

by daniel gallardo acosta -

Hi Rick! Thx for your advice; I'll try that 600kb/s movie. I have shrinked mine as much as I could  with ffmpeg, but no cigar yet  sad

Cheers

In reply to daniel gallardo acosta

Re: Choppy video / apache / mp4

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I use Techsmith Camtasia and Adobe Premiere to control the size of videos.  Both of these products can produce .mp4s, and both allow control for both quality and size.  We always want the very highest quality along with the smallest file size, but these two factors are inversely proportional, unfortunately. So it's a balancing act.

In reply to Rick Jerz

Re: Choppy video / apache / mp4

by daniel gallardo acosta -

Hi again, the choppy video was produced indeed in Camtasia, it's a 720 one, not really big, something like 20 mb

In reply to daniel gallardo acosta

Re: Choppy video / apache / mp4

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

At this point, it would seem that your web server where Moodle is located cannot supply the necessary bit rate for your video.

What is the exact bit rate for your video, and what is the exact bit rate that your server says it can provide?

In reply to Rick Jerz

Re: Choppy video / apache / mp4

by daniel gallardo acosta -

Well, I dont know exactly the bit rate, but have found a (partial) solution: removing apache and installing nginx makes the video much more viewable and smooth; in 720p is 100% continuous, with HD it goes so-so

Thanks loads!


In reply to daniel gallardo acosta

Re: Choppy video / apache / mp4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Daniel Gallardo

Interesting! You have a case where Nginx can deliver certain videos from Moodle whereas Apache can not. Everything else being the same. Would you post the Nginx site config here?

What are the specifications of the server, (virtual) hardware, type of network, software stack?
In reply to Visvanath Ratnaweera

Re: Choppy video / apache / mp4

by daniel gallardo acosta -

The nginx,conf is the stock one plus the fastcgi configuration:

 location ~ [^/]\.php(/|$) {

 fastcgi_split_path_info  ^(.+\.php)(/.+)$;

 fastcgi_index            index.php;

 fastcgi_pass             127.0.0.1:9000;

 include                  fastcgi_params;

 fastcgi_param   PATH_INFO       $fastcgi_path_info;

 fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

location /dataroot/ {

    internal;

    alias /var/www/moodle/moodledata/; # ensure the path ends with /

}

This is a RHEL 7.4 vmware server with 1.12 nginx, 5.1 mariadb, 3.4 moodle, 8G RAM and two core virt processor

In reply to daniel gallardo acosta

Re: Choppy video / apache / mp4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Thanks for those details. If someone could reproduce this, that'll make a clear case for Nginx. I will try if time permits.