-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video playback on link share page #604
Comments
Being able to play video files is completely dependent on whether your browser feels like it or not |
As long as we don't analyse every video file which is uploaded to extract some metadata, there is no way to prevent this behaviour. |
So isn’t this something we should maybe do? ;) Sharing videos is arguably a big usecase. |
We won't be able to play the video anyway as long as the browser doesn't support it |
The only workaround is to transcode the videos on the server. And you don't want to do this in PHP -.- And it even could take very long. I also thought about this a lot. Maybe something for a nice app, because I had in mind to also transcode videos to a smaller size (depending on the network connection). But I guess this is a bigger task. Even big companies invested a lot of time to get this right and flawlessly :( The only way is to upload one of the following video files (container format, video codec, audio codec):
https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility |
WebM support on IE and Safari depends on a to be installed codec
AAC is not supported in Chromium MP4, H264, MP3, AAC on Firefox:
|
@jancborchardt As you see: To play a video file in all available browsers you need at least the video available in 2 different containers, with 2 different audio codecs and 2 different video codecs. |
I just gave this another try (because I have another use case for myself). And somehow the files aren't played even if they are MP4 with H264 and MP3. I will give this tomorrow another try and hopefully get this sorted out. |
I ran into #463. @jancborchardt Did you also use PHP7? Maybe check the server logs and test with the linked PR ;) |
We discussed video handling before in a different context (showing videos in the gallery) and there are several possible solutions, but they all have drawbacks.
Maybe another solution is setting up an FAQ page that explains the situation and tells the user in simple steps how to encode videos that can be played by all browsers and linking to that whenever a video can't be played. ℹ️ |
I like that 👍 |
Short term the FAQ link seems to be the best ratio of improvement to effort. Longer term though, I'd say that sharing videos and having them play back is an important enough use case that it would be worth working towards having it work. It's a more complex system, but I'd suggest:
|
I'm open to help out here (especially for the first steps with showing a FAQ on error, but if somebody wants to do this: feel free :) I will assign me once I start working on it. |
We've considered that in the other issue I linked. The problem is that real-time transcoding requires quite decent hardware. It would need to encode at 25+ FPS, even for full HD (and in the future 4k), and while we have no hardware statistics, we can assume that many users run Nextcloud on low-powered media boxes, virtual servers etc. I have an i7 and depending on the video content, resolution and encoding options, I can't even reliably hit 25 FPS with that. Transcoding automatically in the background can be configured to be easier on the hardware, but requires a lot of disk space. Either way, it will only solve the problem for a few users, but maybe it's a nice feature to have anyway. When it's implemented, we could also offer on-demand transcoding for single videos and that would give users some good options. |
Maybe it would also be nice to have specific app that transcode in a background job and places the file then in a "cache" directory. Then when requested this pre-transcoded files could be used and would also allow to transcode to a smaller version (360p, 480p, 720p, 1080p for example). |
We can't do any FFMPEG background transcode processes invoked by the same PHP process. That is totally insecure. What you could do is having an app that runs on another server and there invokes some docker magic to securely transcode the videos in a container. |
https://habrahabr.ru/company/mailru/blog/274855/ has a good example of why we can't use ffmpeg in a trusted environment on untrusted user data. Basically: it's defined behaviour of ffmpeg to not use it on untrusted data. |
At least #463 fixes, for my Nextcloud, the problem. Well, the patch doesn't apply (Hunk 1 out of 1 failed) but manually changing 'split' to 'explode' on line 191 of the lib/private/files.php makes videos play properly in a share. |
I have the same problem. |
Got the same issue... Is it fixed in master? |
Using Docker would be nice, it can even run a transcoding web service on the same machine - but is it really an option? Docker can be quite difficult to set up on some systems. For the realistic short-term improvement, an FAQ page, what would it include and how would it be implemented (local page, link to documentation)? I suggest a link to a list of supported browser formats (1 [1], 2, 3) and a program that can transcode videos and is easy to use (Handbrake is probably the best open source, cross-platform option). [1] The data from caniuse.com is available as JSON so it could be presented in a more compact form for all required formats. |
If the videoplayer app installed, it works fine in my testing. |
When trying to play a regular mp4 from the share link page, there was this error:
We should really be able to play these files, no? cc @oparoz @Instagit @LukasReschke
The text was updated successfully, but these errors were encountered: