Skip to content

Frontend requests multiple video resolutions at playback start #1560

@executed

Description

@executed

Describe the bug

When streaming video using Memories and nextcloud-go-vod (with HW acceleration on Intel), starting playback in the player (requesting 1080p resolution) causes two ffmpeg transcoding processes to start: one for max resolution and one for 1080p. This results in high load and buffering at the start of playback. Once the max resolution transcoding finishes, only the 1080p transcoding continues and video playback proceeds smoothly. The first transcoding process is not always max—it can be 480p or 720p (adapts to net speed?). It appears the frontend is requesting multiple resolutions at startup, not the backend.

Steps To Reproduce

I was lucky to reproduce this because my backend is fast enough to transcode 1080p 60fps h.264, but given additional thread of 480/720/2k/4k its compute is not enough and it generates chunks for too long. Your backend might be more capable and this is why you probably won't be able to reproduce, but at least you'll see 2 ffmpeg process spawning & 2 different resolutions mentioned in go-vod logs.

  1. Go to a video in Nextcloud Memories and start playback in the player;
  2. Request 1080p (or any specific resolution) in the player;
  3. Exit, wait for previous transcoding to finish on backend and start the video again;
  4. Observe in process overview that two ffmpeg processes are started (e.g., max and 1080p).
  5. Notice buffering at the start of the video until only the requested resolution process remains.

Platform

- OS: Linux (Docker)
- Browser: Firefox
- Memories Version: (latest)
- Nextcloud Version: (30)
- go-vod (latest, Docker)

Screenshots

No response

Additional context

  • No errors in JS console except for normal player initialization.
  • ffmpeg logs: Overread end of atom 'stsd', libva init failed (but transcoding continues).
  • Backend is nextcloud-go-vod with HW acceleration enabled.
  • Integrated videocard is being used.
  • Relevant frontend code: PsVideo.ts initializes videojs with HLS, but does not specify initial quality. HLS seems to request multiple qualities at start.
  • Maybe the culprit is useNetworkInformationApi: true (PsVideo.ts): This allows the player to incorporate the browser's Network Information API into its bandwidth estimation. But it presumabely causes 2 different resolutions transcodings to happen at the same time which is not acceptable in terms of performance impact or should be at least configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions