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

Transcoding not used for external storage #598

Open
drhirn opened this issue Apr 21, 2023 · 21 comments
Open

Transcoding not used for external storage #598

drhirn opened this issue Apr 21, 2023 · 21 comments
Labels
bug Something isn't working priority: high Higher priority
Milestone

Comments

@drhirn
Copy link

drhirn commented Apr 21, 2023

As the Memories config page states, transcoding will not be used for external storage. Why?

And what to do, if i have local files and files on a remote storage? If I enable transcoding, all videos on the external storage can't be played anymore.

@pulsejet
Copy link
Owner

As the Memories config page states, transcoding will not be used for external storage.

To transcode a file, you need download the whole file locally first. This is problematic for large video files on external storage, so it is explicitly disabled.

If I enable transcoding, all videos on the external storage can't be played anymore.

That's possibly a bug. Do you get any error?

@drhirn
Copy link
Author

drhirn commented Apr 21, 2023

Nothing in the logs (debug). Nextcloud just tells me "The media could not be loaded, either because the server or network failed or because the format is not supported." and "Transcoding failed, check the logs".

@pulsejet
Copy link
Owner

Can you play if you set the quality of the video as "Direct"?

@drhirn
Copy link
Author

drhirn commented Apr 21, 2023

Doesn't change anything.

@drhirn
Copy link
Author

drhirn commented Apr 21, 2023

Trying to play from a read-only SMB-share

@pulsejet
Copy link
Owner

Does your browser support the video to begin with? A simple test would be to disable transcoding and try playing the same video.

@drhirn
Copy link
Author

drhirn commented Apr 21, 2023

Yes. No problems when disabling transcoding.

@pulsejet pulsejet added the bug Something isn't working label Apr 21, 2023
@pulsejet
Copy link
Owner

Are you 100% sure? Disabling transcoding and setting quality to direct are exactly the same thing in the code ...

@drhirn
Copy link
Author

drhirn commented Apr 21, 2023

Hehe. I assumed the same. But yes, I'm 100% sure. Just double-checked.

This is what the developer tools show when playing with enabled transcoding (quality: direct):

SW registered:  
ServiceWorkerRegistration { installing: null, waiting: null, active: ServiceWorker, navigationPreload: NavigationPreloadManager, scope: "https://example.com/apps/memories", updateViaCache: "imports", onupdatefound: null, pushManager: PushManager }
memories-main.js:2:3177869
Source map error: Error: request failed with status 404
Resource URL: https://example.com/custom_apps/memories/js/memories-main.js?v=808481ed-0
Source Map URL: memories-main.js.map?v=0b6b2008f363bc70e4b7
Will-change memory consumption is too high. Budget limit is the document surface area multiplied by 3 (2045952 px). Occurrences of will-change over the budget will be ignored. 04
VIDEOJS: WARN: The element supplied is not included in the DOM memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2:371545
VIDEOJS: WARN: videojs.mergeOptions is deprecated and will be removed in 9.0; please use videojs.obj.merge instead. memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2:371545
XHRGET
https://example.com/apps/memories/api/video/transcode/vdlsaebzm600/423453/index.m3u8
[HTTP/2 403 Forbidden 27ms]

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported. 
Object { code: 4, message: "The media could not be loaded, either because the server or network failed or because the format is not supported." }
memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2:371545
PsVideo: Direct video stream could not be opened. memories-main.js:2:3016916
PsVideo: Trying HLS stream memories-main.js:2:3016985
XHRGET
https://example.com/apps/memories/api/video/transcode/vdlsaebzm600/423453/index.m3u8
[HTTP/2 403 Forbidden 28ms]

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported. 
Object { code: 4, message: "The media could not be loaded, either because the server or network failed or because the format is not supported." }
memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2:371545
PsVideo: HLS stream could not be opened. memories-main.js:2:3016620
Uncaught (in promise) DOMException: The media resource indicated by the src attribute or assigned media provider object was not suitable. memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2
Source map error: Error: request failed with status 404
Resource URL: https://example.com/custom_apps/memories/js/memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js?v=1de1918b548ccbfe9249
Source Map URL: memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js.map?v=1de1918b548ccbfe9249
MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead. memories-vendors-node_modules_plyr_dist_plyr_min_js-node_modules_plyr_dist_plyr_css-node_modules_video-6ca800.js:2:380951

@pulsejet pulsejet added the priority: high Higher priority label Apr 21, 2023
@pulsejet pulsejet added this to the 5.1 milestone Apr 21, 2023
@gymnae
Copy link

gymnae commented Apr 21, 2023

I'm transcoding videos from an external storage, both playing in auto and direct mode just fine.
My external storage is an rclone volume mounted as local external storage into a docker volume. It even has to decrypt the file and it works

@drhirn
Copy link
Author

drhirn commented Apr 22, 2023

You're right. If I mount the smb-share locally and use "local external storage", it's working fine.

@vitis586
Copy link
Sponsor

I encountered this on my testing instance but @drhirn was faster to issue it. Is there going to be a way to enable transcoding for SMB storage? Is transcoding disabled only for SMB storage? I am running Nextcloud in Docker and mounting user data as external SMB storage with authentication even though the storage is local. This way I have the correct owner on the files that I write through Nextcloud and I can also access the files directly. It was working fine for me so far.

I can understand that the poor performance can affect the experience in case of WebDAV or Amazon S3 as these are usually not on the same machine as the Nextcloud/Memories instance.

@pulsejet
Copy link
Owner

Not right now. ffmpeg works best when the file is locally available; to support anything else we probably need another wrapper.

@pulsejet pulsejet modified the milestones: 5.1, 5.2 Apr 29, 2023
@ChildLearningClub
Copy link
Sponsor

ChildLearningClub commented May 16, 2023

Are you 100% sure? Disabling transcoding and setting quality to direct are exactly the same thing in the code ...

I do think there is something going on as well, I was able to see no noticeable difference between any of the 3 settings within the admin panel for ffmpeg transcoding. My very rough test consisted of disabling transcoding, reloading the page, having the video play in original quality, then repeating the process of disabling and refreshing the page between changing settings.

It would go from the native resolution to what appeared to be the same transcoded resolution even with the transcoding enabled, and Direct (without transcode) option set.

Video Reference

@pulsejet
Copy link
Owner

The admin settings only define the default quality. The user can still select whatever quality they desire, and that will be persisted per-user.

@ChildLearningClub
Copy link
Sponsor

ChildLearningClub commented May 16, 2023

The admin settings only define the default quality. The user can still select whatever quality they desire, and that will be persisted per-user.

I apologize as this is now irrelevant to the current issue, but for the life of me I can’t find that user setting?

@pulsejet
Copy link
Owner

Bottom right during video playback:
image

If this is not visible, that likely means the video isn't transcoding to begin with. There might be errors in the go-vod logs (/tmp/go-vod/<instance-id>.log) or some permissions errors (in the memories admin interface).

@ChildLearningClub
Copy link
Sponsor

@pulsejet thank you, I see it on desktop now.

iOS Safari on the other hand only displays captions and speed. Logs show no error and it is clearly being transcoded.

IMG_7120

Unless I’m missing something else I will open a new ticket for this?

@pulsejet
Copy link
Owner

@ChildLearningClub the iOS player doesn't support switching quality, but indeed it's a bug that there's no way to switch between transcoded and direct video. I opened a tracker at #650

@pulsejet pulsejet modified the milestones: 5.2, 5.3 Jun 30, 2023
@pulsejet pulsejet modified the milestones: 5.3, 5.4 Aug 20, 2023
@pulsejet pulsejet removed this from the 5.5 milestone Oct 3, 2023
@pulsejet pulsejet added this to the 5.6 milestone Oct 3, 2023
@ChildLearningClub
Copy link
Sponsor

I apologize for getting everyone of topic, but I think this can be closed? transcoding does work for external storage, and looks like it was just an issue with how to storage was being mounted?

You're right. If I mount the smb-share locally and use "local external storage", it's working fine.

Is anyone else still having this issue?

@pulsejet
Copy link
Owner

Well not really. The way go-vod works is by picking up files from the filesystem directly. To fully support external storage, we need to access the filesystem through Nextcloud, which will e.g. also allow transcoding files on S3

@pulsejet pulsejet modified the milestones: 6.0, 6.1 Oct 20, 2023
@pulsejet pulsejet modified the milestones: 6.1, 6.2 Nov 15, 2023
@pulsejet pulsejet modified the milestones: 6.2, 6.3 Jan 10, 2024
@pulsejet pulsejet modified the milestones: 7.0, 7.1 Mar 20, 2024
@pulsejet pulsejet modified the milestones: 7.1, 7.2, 7.3 Apr 3, 2024
@pulsejet pulsejet modified the milestones: 7.3, 7.4 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high Higher priority
Projects
None yet
Development

No branches or pull requests

5 participants