Repository navigation
Conversation
Ship the ffmpeg preview service from nextcloud/server#65717 inside the imaginary container and configure the OC\Preview\MovieRemote provider automatically when imaginary is enabled. The service script gets synced from server via the imaginary-update workflow. Uploaded videos are buffered in a dedicated volume instead of a tmpfs to not use up RAM. ffmpeg is removed from the Nextcloud container as video previews are now generated by the imaginary container. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Simon L. <szaimen@e.mail.de>
Relates to nextcloud/server#65717 and nextcloud/all-in-one#8865 Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
Relates to nextcloud/server#65717 and nextcloud/all-in-one#8865 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Simon L. <szaimen@e.mail.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
Relates to nextcloud/server#65717 and nextcloud/all-in-one#8865 Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Simon L. <szaimen@e.mail.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
susnux
left a comment
There was a problem hiding this comment.
I do not think docker containers for deployment belong into the server repository.
And especially not into the build folder.
This would belong to either some dedicated ffmpeg preview app or at least the container should be handled somewhere else like docker-ci or even a new repository.
|
I am also a bit twisted on having this in the server repository tbh. But what I am wondering, isn’t there something prebuilt like this that we could use? |
|
szaimen
left a comment
There was a problem hiding this comment.
WIll try to make the implementation compatible with https://github.com/steelbrain/ffmpeg-over-ip going forward :)
Add the OC\Preview\MovieRemote provider which runs ffprobe and ffmpeg on an ffmpeg-over-ip server (https://github.com/steelbrain/ffmpeg-over-ip), similar to the Imaginary provider for images. It is configured with preview_ffmpeg_url and preview_ffmpeg_key; neither ffmpeg nor the ffmpeg-over-ip client is needed on the Nextcloud server. OC\Preview\FFmpegOverIpClient implements the client side of the protocol in PHP. The server tunnels all file access of the remote process back over the connection, so the video is streamed from any storage, including S3 and external storages. Only the video itself can be opened, read-only. Streams that cannot seek are copied to a temporary stream first. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
2ba7e52 to
6ca6cbe
Compare
Add the nextcloud-aio-ffmpeg container which runs the ffmpeg-over-ip server (https://github.com/steelbrain/ffmpeg-over-ip) and configure the OC\Preview\MovieRemote provider from nextcloud/server#65717 automatically when it is enabled. The container is enabled by default and can be disabled in the AIO interface. The ffmpeg-over-ip release gets pinned by its checksums and is kept up-to-date within the major version by the ffmpeg-over-ip-update workflow. ffmpeg stays in the Nextcloud container so that video previews keep working when the container is disabled. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
Relates to nextcloud/server#65717 and nextcloud/all-in-one#8865 Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
done :) |
- Only download the first 10 MB of videos on storages that cannot seek, using ProviderV2::getLocalFile() like the Movie provider, and send the real size of that file - Allow tls:// addresses with peer verification and reject http(s) urls with a clear error - Apply one configurable deadline (preview_ffmpeg_timeout) to all runs of a preview instead of 120 seconds per run - Fall back to non-HDR previews if ffprobe fails - Reject seeks that would overflow the file offset - Report the provider as unavailable without preview_ffmpeg_address - Rename preview_ffmpeg_url to preview_ffmpeg_address, as it is no url - Share the timestamps and ffmpeg arguments with the Movie provider Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
Addressed all your comments. Please check again :) |
Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
susnux
left a comment
There was a problem hiding this comment.
Some findings from a deeper review pass, roughly ordered by severity. Most of them were reproduced against a fake ffmpeg-over-ip server, the real SeekableHttpStream/Icewind wrappers and real ffmpeg 8.1.3.
AI-assisted review (Claude Code), findings checked by reproduction.
Should be adressed now. Please check again :) |
…client - Open the video on the storage, so it is not locked while the server works - Take the size from the opened stream instead of the filecache - Limit the data the server may read of videos on non-local storages to 20 MB, like the Movie provider - Track the stream position after failed seeks and report short reads as I/O errors instead of end of file - Send a cancel message when a run is aborted - Enforce the deadline while writing with non-blocking writes - Catch all errors and give up after the first failed connection - Report the reason of TLS errors, verify IPv6 literals and document the certificate bundle that is used - Register MovieRemote before Movie and log if no address is configured - Use the default timeout for values below 1 Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
8a9086e to
d18936a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Follow nextcloud/server#65717: rename preview_ffmpeg_url to preview_ffmpeg_address, document tls:// and unix: addresses, the preview_ffmpeg_timeout option and the read limits on non-local storages, and that MovieRemote is tried before Movie when both are enabled. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
|
@CarlSchwan would you mind having another look at this? :) |
Summary
Add the OC\Preview\MovieRemote provider which runs ffprobe and ffmpeg on an ffmpeg-over-ip server (https://github.com/steelbrain/ffmpeg-over-ip), similar to the Imaginary provider for images. It is configured with preview_ffmpeg_url and preview_ffmpeg_key; neither ffmpeg nor the ffmpeg-over-ip client is needed on the Nextcloud server.
OC\Preview\FFmpegOverIpClient implements the client side of the protocol in PHP. The server tunnels all file access of the remote process back over the connection, so the video is streamed from any storage, including S3 and external storages. Only the video itself can be opened, read-only. Streams that cannot seek are copied to a temporary stream first.
Checklist
3. to review, feature component)stable32)AI (if applicable)