How can I get video to stream from my NC [SOLVED]?

Hi all,

I’ve setup up NC12 on Nginx 1.12 and PHP7.1-fpm.
After uploading a 278M video I noticed it’s getting downloaded completly before the video player play. That’s true in the File manager and via Link sharing.

Everybody think it’s just not working.

Is it possible to get video to stream instead of downloaded?
I installed FFMPEG but I’m pretty sure it has nothing to do with streaming.

It’s probably an nginx config, since it doesn’t have anything to do with PHP either.

Can anyone advice?

Thanks

It look like the Movie player is kinda streaming.

It look like the FileSharer use /download to push the video into the player, thus downloading the whole file.
I feel like the file sharer simply doesn’t support streaming at all.

I personally use the webdav url for streaming videos.

on Android:
I use a webdav browser (ES File Explorer) to browse to my file then click and open with a external player (VLC). This however all on mobile (Android 6.0) have not tried on PC yet as i MirrorCast it to my TV.

hope his helps you in anyway solving your issue.

Hum. I see.

This is probably way to complicated for my mom who want to watch vids of my kids :wink:

I’d like the embeded video player to stream correctly. I’ll look into it later. Haven’t fond anything yet.

not too hard if she owns a tablet you can set it up with shortcuts on the homescreen and automaticly open it with VLC.

Also I tried using the build in player but it has limited support on video files. What worked for me are .MP4 videos but .MKV was a unsupported mime type and .AVI was directly forced to download didn’t even opened the build in player.

the MP4 streamed flawless as seen below.

the build in player probably only supports the .mp4 and webm videos more on this on the link below.

Supported media types

If you like to know how to easily setup webdav for you mom let me know I can give you a picture to picture setup if you like.

1 Like

Don’t know if you have found a solution, but this is what we did to get progressive playback to work on nginx.

In your server node for your nextcloud site in nginx, add this node (adapt to your liking, this is a straight copy from one of our configs)

location ~ \.mp4$ {
more_clear_headers "Date";
more_clear_headers "Last-Modified";
more_clear_headers "Cache-Control";
more_clear_headers "Vary";
more_clear_input_headers "Accept-Encoding";
more_set_headers "Cache-Control: no-store";
more_set_headers "Last-Modified: $date_gmt";
if_modified_since off;
etag off;
gzip off;
mp4;
mp4_buffer_size 30M;
mp4_max_buffer_size 200M;
send_timeout 10m;

proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;

fastcgi_buffering off;
fastcgi_keep_conn on;
fastcgi_force_ranges on;
fastcgi_read_timeout 10m;

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache MYAPP;
fastcgi_cache_valid 200 1d;
}

You need to make sure you have the mp4 module compiled into your Nginx, and you may have to specify your own cache settings and fastcgi php handler. So this won’t work straight-off-the-bat until you’ve customised it to your environment. The key setting is simply the command ‘mp4;’, you will know if it works or not by just putting it into a test location section and restarting nginx, if no errors, then you are good to go, otherwise as specified earlier, you will need to include the module in the nginx build or alternatively source a build from a repo which already includes it.

Hope the above helps you @akeif.

1 Like

Wow. Thanks! I’ll give it a go when I have a few free hours.

Streaming is now kinda working, without chaning the config. It may have something to do with browser or server package updates.

I did try the config you sent me but I didn’t notice any changes.

As of now, I can’t start playing anywhere else than the start of the video. But at least it start playing and buffering the video without downloading the whole thing. It wasn’t the case before.

Thanks for the help.

Hi @V-Support,

Does your nginx config still work with Safari on iOS ? I tried it and unfortunately i’m not able to stream videos from the Safari web browser on an iPhone or iPad (WebUI).

I make my tests with the Nextcloud.mp4 default video.

The streaming works with no issue on windows from various browsers, and with byte range-requests enabled - Only fails on iOS.

Any idea?