pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
3.14k stars 83 forks source link

[Feature Request] Choose the default playback quality / bitrate ? #188

Closed EVOTk closed 1 year ago

EVOTk commented 1 year ago

Hello,

Would it be possible to propose to Memories users to choose the default playback quality for videos in the settings? image

Currently, the video always starts on Auto, for users with a weak connection it could be interesting to force this pre-selection directly. image

Also, I take advantage of the fact that we are talking about quality but not bitrate, however for a remote reading, I think that it is more interesting to propose a limitation of resolution but also of bitrate.

Jellyfin example : image

Thanks

pulsejet commented 1 year ago

With the stable update, the quality you select will be persisted the next time you play a video. That should be equivalent to this.

EDIT: unfortunately there's no easy way to select the bitrate without potentially increasing the server load significantly (also the player doesn't support it, so probably need a lot of ugly patchwork). It's easier for jellyfin because AFAIK they don't do adaptive streaming, but only let the user select a bitrate.

EVOTk commented 1 year ago

It's perfect thanks :)

For Jellyfin, there is an "Auto" setting but I don't know how it works "behind", but this was just an example.

pulsejet commented 1 year ago

I'm not sure either, should be interesting to find out.

Closing this for now anyway.

EVOTk commented 1 year ago

Hello, strangely I had this error : image

ls -alh exiftool-bin                                                                                                                                                                                     root@citrouille [09:08]
total 40M
drwxr-sr-x 3 docker users 4,0K 14 nov.  08:59 .
drwxr-sr-x 9 docker users 4,0K 14 nov.  08:59 ..
drwxr-sr-x 6 docker users 4,0K 14 nov.  08:59 exiftool
-rw-r--r-- 1 docker users 6,9M 14 nov.  08:59 exiftool-aarch64-glibc
-rw-r--r-- 1 docker users 8,5M 14 nov.  08:59 exiftool-aarch64-musl
-rw-r--r-- 1 docker users 7,2M 14 nov.  08:59 exiftool-amd64-glibc
-rw-r--r-- 1 docker users 8,6M 14 nov.  08:59 exiftool-amd64-musl
-rw-r--r-- 1 docker users 4,4M 14 nov.  08:59 go-vod-aarch64
-rw-r--r-- 1 docker users 4,6M 14 nov.  08:59 go-vod-amd64

chmod +x exiftool-bin/go-vod-amd64 resolve issue, Now it works


Also I take advantage of it because I see something else:

I have set the playback to 360p. when I go to another video, the playback then starts in 1080p, only to be killed and started in 360p. Is this the normal behavior?

2022/11/14 08:13:21 4mtajd2m9dh0-1080p: ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -autorotate 0 -i /VID_20221009_183902.mp4 -copyts -vf scale_vaapi=w=1920:h=1080:force_original_aspect_ratio=decrease -maxrate 3480k -bufsize 3480K -c:v h264_vaapi -profile:v high -low_power 1 -c:a aac -b:a 192k -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/4mtajd2m9dh0-215787600/1080p-%06d.ts -
2022/11/14 08:13:21 ffmpeg-error: [h264_vaapi @ 0x7fe1e8eec080] No quality level set; using default (20).
2022/11/14 08:13:21 ffmpeg-error: [h264_vaapi @ 0x7fe1e8eec080] Buffering settings are ignored in CQP RC mode.
2022/11/14 08:13:21 4mtajd2m9dh0-1080p: recv 1080p-000000.ts
[...]
2022/11/14 08:13:26 4mtajd2m9dh0-1080p: recv 1080p-000007.ts
2022/11/14 08:13:26 4mtajd2m9dh0-360p: stopping stream
2022/11/14 08:13:26 4mtajd2m9dh0-360p: ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -autorotate 0 -i /VID_20221009_183902.mp4 -copyts -vf scale_vaapi=w=640:h=360:force_original_aspect_ratio=decrease -maxrate 483k -bufsize 483K -c:v h264_vaapi -profile:v high -low_power 1 -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/4mtajd2m9dh0-215787600/360p-%06d.ts -
2022/11/14 08:13:26 ffmpeg-error: [h264_vaapi @ 0x7feff4495080] No quality level set; using default (20).
2022/11/14 08:13:26 ffmpeg-error: [h264_vaapi @ 0x7feff4495080] Buffering settings are ignored in CQP RC mode.
2022/11/14 08:13:26 4mtajd2m9dh0-1080p: recv 1080p-000008.ts
2022/11/14 08:13:26 4mtajd2m9dh0-1080p: goal satisfied: 8
2022/11/14 08:13:26 4mtajd2m9dh0-360p: recv 360p-000000.ts
[...]
2022/11/14 08:13:28 4mtajd2m9dh0-360p: recv 360p-000008.ts
2022/11/14 08:13:28 4mtajd2m9dh0-360p: goal satisfied: 8
pulsejet commented 1 year ago

Good catch. Filed in #193 The initial quality switch is a known bug. I'm still trying to find a fix for it.

EVOTk commented 1 year ago

Ok ! Thanks for the answer !