Skip to content
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

[BUG] Streaming video: on iphone it is only starting after complete download #363

Open
orgaralf opened this issue Jan 23, 2021 · 8 comments

Comments

@orgaralf
Copy link

Steps to reproduce

  1. Create a longer (100MB+) mp4 video
  2. Upload to your ownCloud and share the public link
  3. Use the link on your iPhone to view the video (in Safari by default)

Expected behavior

The video stream should start quickly (few seconds max on a fast network).

Actual behavior

It seems the client downloads the file completely.

Client

iOS version: 14.3

ownCloud app version: 11.4.5 build 182

Device model: iPhone 12 pro

Server configuration

Web server: Apache 2.4

Database: MariaDB 10.3

PHP version: 7.2.24

ownCloud version: 10.6

Storage backend (external storage): NFS mounted shares

Logs

Web server error log

Just shows a 200 on the request

I would expect the server to add the fast load info on the file, when I play longer movies inline (eg. qt-faststart) or make that configurable? https://stackoverflow.com/questions/50914503/fastest-way-to-add-movflags-faststart-to-an-mp4-using-ffmpeg-leaving-everythi

RPReplay_Final1611414336.MP4
@orgaralf orgaralf changed the title [BUG] Stream video on iphone only starting after complete download [BUG] Streaming video on iphone is only starting after complete download Jan 23, 2021
@orgaralf orgaralf changed the title [BUG] Streaming video on iphone is only starting after complete download [BUG] Streaming video: on iphone it is only starting after complete download Jan 23, 2021
@michaelstingl michaelstingl transferred this issue from owncloud/ios-app Jan 24, 2021
@michaelstingl
Copy link

@orgaralf you did not play the file in the iOS app, you played it in Safari browser, in a public link share?

I moved the issue to the files_mediaviewer repository…

@michaelstingl
Copy link

You can check if your web server is properly configured to support range requests:

% curl -I -H 'range: bytes=0-' https://stingl.cloud/s/YVCuDVvgDhVsmuH/download | grep 'content\|ranges'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 7203k    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
content-type: video/mp4
content-length: 7376049
x-content-type-options: nosniff
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
content-disposition: attachment; filename*=UTF-8''105606766-848bca80-5d9b-11eb-93a6-a6bf71d1e400.mp4; filename="105606766-848bca80-5d9b-11eb-93a6-a6bf71d1e400.mp4"
content-transfer-encoding: binary
accept-ranges: bytes
content-range: bytes 0-7376048/7376049

@michaelstingl
Copy link

You can also check if the video file is encoded in a way that allows streaming:

% mediainfo --fullscan /Users/mstingl_oc/Downloads/105606766-848bca80-5d9b-11eb-93a6-a6bf71d1e400.mp4 | grep IsStreamable
IsStreamable                             : No

In HandBrake for example, this setting needs to be activated:

CleanShot 2021-01-24 at 21 41 18@2x

@mmattel
Copy link
Contributor

mmattel commented Jan 30, 2021

@michaelstingl
I did a test. Having the same video in two flavours. One time an export directly from Adobe Premiere Elements (8.7GB) and one time a Web Optimized variant via Handbrake (2GB), both mp4 means playable by browsers directly. The webserver is nginx, I have to check if it support range requests.

  • On the iPad (IOS14.4), using the FileBrowser app, connecting to my storage via SMB and selecting the optimized video. Playing started a view seconds after clicking on it. The test was made from an external location with a 15mbit download line via vpn.
    Result: Streaming, no download ✔️
  • On the iPad (IOS14.4), using the FileBrowser app, connecting to ownCloud via WebDav and selecting the optimized video.
    Result: Starts downloading, no streaming ❌
  • On the iPad (IOS14.4), using Safari, connecting to ownCloud and selecting the optimized video
    Result: Starts downloading, no streaming ❌
  • Desktop (W10x64) Chrome, same web optimized video, using the files_mediaviewer app (1.0.4)
    Result: Starts downloading, no streaming. Even worse, interrupting the download by exiting to the files app, continued downloading and ownCloud stayed unresponsive ❌ Needed to restart php7.4-fpm on the server 🔥
  • IOS App (11.4.5), same web optimized video
    Result: "Fehler, Vorgang gestoppt" ❌

Conclusio:

  • Outside ownCloud, streaming works
  • The IOS app errors
  • Inside ownCloud, files_mediaviewer downloads and does not stop when interrupting by exiting the app. You have to close the browser window to stop downloading to the browser. But when reentering ownCloud, it was unresponsive, needed to restart php7.4-fpm on the server

NOTE
To check the behavior properly, you need a BIG file compared to the line that accesses the environment. GB vs Mbit. Only then you see if streaming starts or it downloads. Stremaing must start after view seconds.

@mmattel
Copy link
Contributor

mmattel commented Jan 30, 2021

This is the output of the curl test with nginx:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 2003M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
HTTP/2 200 
server: nginx
date: Sat, 30 Jan 2021 09:35:30 GMT
content-type: video/mp4
content-length: 2100668044
set-cookie: oct7bkicorxf=prbsl513ap0i0a9duidkrll6eq; path=/; secure; HttpOnly
set-cookie: oc_sessionPassphrase=cWKwvvP7c0PIzsse3SOJZOuXEj84nrqV7rRFh3ZFqxMqsNFregRlqQtFx7cc78yd3GSX5L3rbu%2Fhp4ck2UH2u5%2FF7vDLrFp7nd5loXtjNJhcJ7I%2FOY53yVTqDFdPLBXt; path=/; secure; HttpOnly; SameSite=strict
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
content-disposition: attachment; filename*=UTF-8''xyz.optimiert.mp4; filename="xyz.optimiert.mp4"
content-transfer-encoding: binary
pragma: public
expires: 0
cache-control: no-cache, no-store, must-revalidate, post-check=0, pre-check=0
x-robots-tag: none
strict-transport-security: max-age=15768000; must-revalidate; includeSubDomains; preload;
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-download-options: noopen
x-permitted-cross-domain-policies: none

@michaelstingl
Copy link

@mmattel this issue is about the mediaviewer app, which is a pure web player. So only issues in desktop or mobile browsers are in scope.

For issues with the ownCloud iOS app, please open in iOS app repo.

For issues with 3rd party apps accessing via WebDAV, please open in the server core repo.

@mmattel
Copy link
Contributor

mmattel commented Jan 30, 2021

I have collected the tests made to have an overview.
Will file an issue in the IOS repo.
It is possible that there is a common underlaying issue with webdav and files_mediaviewer. Will file an issue in core too.

@mmattel
Copy link
Contributor

mmattel commented Jan 31, 2021

Here are more results from further testing.
The question was: is there an issue with the webserver or with owncloud (+files_mediaviewer)

Setup

Result
It streams as expected ✔️
Monitoring the up/download figures both on the client and the server clearly identifies streaming

Conclusio
The issue is definitively in ownCloud and/or the files_mediaviewer app.

@micbar after diving into that issue, files_mediaviewer is not able to stream a streamable video file. There is no webserver or client issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants