memories icon indicating copy to clipboard operation
memories copied to clipboard

Autoplay lag

Open pulsejet opened this issue 2 years ago • 16 comments

Videos take time from loading to actually playing without any indication to the user. Bad UX

pulsejet avatar Nov 14 '22 15:11 pulsejet

yup, and sometime it doesn't load and show an error as "transcoder failed"

HyCore avatar Nov 15 '22 16:11 HyCore

  • it's showing this error, and not playing:

     Uncaught (in promise) DOMException: The play() request was interrupted because the media was removed from the document.  [/apps/memories/#v/19307/802695:1     ]
    

HyCore avatar Nov 15 '22 16:11 HyCore

yup, and sometime it doesn't load and show an error as "transcoder failed"

Please add the output from /tmp/go-vod.log of when this happens

pulsejet avatar Nov 16 '22 02:11 pulsejet

Here it is:

2022/11/16 10:17:32 df1sbrpng9o0-720p: stopping stream
2022/11/16 10:17:32 df1sbrpng9o0-720p: ffmpeg -loglevel warning -autorotate 0 -i /data/ncdata/__groupfolders/6/Film/The.Cabin.In.The.Woods.1080p.AC3.x264.mkv -copyts -vf scale=-2:720 -maxrate 1686666 -bufsize 3373332 -c:v libx264 -profile:v high -preset faster -level:v 4.0 -crf 24 -c:a aac -b:a 128k -avoid_negative_ts disabled -f hls -hls_time 3 -force_key_frames expr:gte(t,n_forced*3) -hls_segment_type mpegts -start_number 0 -hls_segment_filename /tmp/go-vod/df1sbrpng9o0-149556800/720p-%06d.ts -
2022/11/16 10:17:33 df1sbrpng9o0-720p: recv 720p-000000.ts
2022/11/16 10:17:33 df1sbrpng9o0-720p: recv 720p-000001.ts
2022/11/16 10:17:33 df1sbrpng9o0-720p: recv 720p-000002.ts
2022/11/16 10:17:34 df1sbrpng9o0-720p: recv 720p-000003.ts
2022/11/16 10:17:34 df1sbrpng9o0-720p: recv 720p-000004.ts
2022/11/16 10:17:34 df1sbrpng9o0-720p: recv 720p-000005.ts
2022/11/16 10:17:34 df1sbrpng9o0-720p: recv 720p-000006.ts
2022/11/16 10:17:35 df1sbrpng9o0-720p: recv 720p-000007.ts
2022/11/16 10:17:35 df1sbrpng9o0-720p: recv 720p-000008.ts
2022/11/16 10:17:35 df1sbrpng9o0-720p: goal satisfied: 8
2022/11/16 10:22:31 df1sbrpng9o0-720p: stopping stream
2022/11/16 10:27:16 df1sbrpng9o0-720p: stopping stream

I don't see any error but still get a "Transcoder failed / issue" image X-Matroska (for the file type) may be the issue ?

HyCore avatar Nov 16 '22 09:11 HyCore

At the total opposite, and other video file, with the same .mkv extension doesn't have this issue and play just fine with sound & all: image

2022/11/16 10:45:22 26bd4ch6noh0: new manager for /data/ncdata/__groupfolders/6/Film/08_La sirène du Mississippi.1969-x264-AC3.mkv
2022/11/16 10:45:29 26bd4ch6noh0-360p: stopping stream
2022/11/16 10:45:29 26bd4ch6noh0-360p: ffmpeg -loglevel warning -autorotate 0 -i /data/ncdata/__groupfolders/6/Film/08_La sirène du Mississippi.1969-x264-AC3.mkv -copyts -vf scale=-2:360 -maxrate 416666 -bufsize 833332 -c:v libx264 -profile:v high -preset faster -level:v 4.0 -crf 24 -c:a aac -b:a 64k -avoid_negative_ts disabled -f hls -hls_time 3 -force_key_frames expr:gte(t,n_forced*3) -hls_segment_type mpegts -start_number 0 -hls_segment_filename /tmp/go-vod/26bd4ch6noh0-1187505722/360p-%06d.ts -
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000000.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000001.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000002.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000003.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000004.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000005.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000006.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000007.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: recv 360p-000008.ts
2022/11/16 10:45:29 26bd4ch6noh0-360p: goal satisfied: 8
2022/11/16 10:45:32 26bd4ch6noh0-360p: resuming transcoding
2022/11/16 10:45:32 26bd4ch6noh0-360p: recv 360p-000009.ts
2022/11/16 10:45:32 26bd4ch6noh0-360p: recv 360p-000010.ts
2022/11/16 10:45:32 26bd4ch6noh0-360p: recv 360p-000011.ts
2022/11/16 10:45:32 26bd4ch6noh0-360p: recv 360p-000012.ts
2022/11/16 10:45:32 26bd4ch6noh0-360p: recv 360p-000013.ts
2022/11/16 10:45:33 26bd4ch6noh0-360p: recv 360p-000014.ts
2022/11/16 10:45:33 26bd4ch6noh0-360p: goal satisfied: 14
2022/11/16 10:45:37 26bd4ch6noh0-360p: resuming transcoding
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000015.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000016.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000017.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000018.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000019.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: recv 360p-000020.ts
2022/11/16 10:45:37 26bd4ch6noh0-360p: goal satisfied: 20

HyCore avatar Nov 16 '22 09:11 HyCore

Looks like transcoding is successful and videojs is even loading the video.

  1. Is there anything else in the console?
  2. What happens if you disable transcoding?

pulsejet avatar Nov 16 '22 10:11 pulsejet

Good idea to check some other stuff for the console, i got a few other one that didn't show up right away in the nextwork tab: here, we can see that everything should work fine, but we also got a notification saying that the transcoding failed: image Here is what we get in the error tab: Impossible to load: A worker services intercepted the request and got an unexpected error: inattendue. [service-worker.js:1:776] (https://host.chauvat.com/apps/memories/service-worker.js) Also this: image And this: Video.js: HLS stream could not be opened. /// VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) audio append of 38332b failed for segment #0 in playlist 2-720p.m3u8 Object { code: 3, message: "audio append of 38332b failed for segment #0 in playlist 2-720p.m3u8" }

HyCore avatar Nov 16 '22 13:11 HyCore

You can test by yourself here: https://host.chauvat.com/apps/memories/s/46RH4zoDGDYQ7ts You have 4 film, all in MKV, the only one that works well is the one on the middle right. (in french) All the other one get some issues.

HyCore avatar Nov 16 '22 13:11 HyCore

last thing, how to disable transcoding to test out again?

HyCore avatar Nov 16 '22 13:11 HyCore

So,

  1. Looks like the reason the playback fails is mkv is not supported in firefox at all (wth). So you can't play these videos with ff, but chrome should work fine.
  2. I'm still downloading one of the files to my dev environment. Apparently there's something wrong with the produced transcodes to get the failures. This might also be a firefox bug though :(

last thing, how to disable transcoding to test out again?

Just run occ memories video-setup again and answer the prompts.

pulsejet avatar Nov 16 '22 14:11 pulsejet

Okay I can reproduce the transcode error in both firefox and chrome. Regardless, falling back to non-transcoding can possibly work only in Chrome (doesn't seem to work right now either; probably mkv again).

pulsejet avatar Nov 16 '22 14:11 pulsejet

  1. yup, most mkv video seems to not work at all, but i wonder why this mkv video works: (the one in the middle right on the video folder link i sent u) image

  2. yeah both firefox & chrome have this issue. but i'm pretty sure that your transcoding thing can fix it, like plex was able to do ;D i've a great faith in your work

HyCore avatar Nov 16 '22 14:11 HyCore

also not having the name on the file while hovering it it's a bit tricky for movies when we have multiple time the same thumbnail (but that's a different issue)

HyCore avatar Nov 16 '22 14:11 HyCore

Transcoding these videos should be fixed in the next version. Basically the HLS stream doesn't like multiple audio streams, which these videos have.

  1. yup, most mkv video seems to not work at all, but i wonder why this mkv video works: (the one in the middle right on the video folder link i sent u)

No idea. Even that video doesn't play for me in firefox 🤷🏻

also not having the name on the file while hovering it it's a bit tricky for movies when we have multiple time the same thumbnail (but that's a different issue)

Well the bottom line is this isn't intended usage of Memories. I don't intend to make it a general-purpose media management suite; just focus on user-generated photos in particular. Personally I use Jellyfin for this and it works wonderfully.

pulsejet avatar Nov 16 '22 15:11 pulsejet

Thanks so much for Jellyfin, i just tried out and synced it with Nextcloud film folder, it's so fluid ! Would there be a way to integrate Jellyfin player to nextcloud to read video? or even the whole app as an extension? That would be dope !

HyCore avatar Nov 16 '22 16:11 HyCore

Thanks so much for Jellyfin, i just tried out and synced it with Nextcloud film folder, it's so fluid ! Would there be a way to integrate Jellyfin player to nextcloud to read video? or even the whole app as an extension? That would be dope !

Maybe. But that'll be a separate Nextcloud app ;)

pulsejet avatar Nov 17 '22 05:11 pulsejet