Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.05k stars 1.5k forks source link

Respect current video resolutions when replacing the video file #6662

Open EricGuic opened 2 weeks ago

EricGuic commented 2 weeks ago

Describe the current behavior

Hi, When Peertube is set to do only HLS transcoding by default, we can still manually trigger a web-video transcoding too. (I use it on some video when we need to embed the stream in H5P interactiv object, which doesn't support well HLS stream).

But when I replace the video by a new version, all HLS resolution are transcoded as expected, but all pre-existing web-video resolutions are deleted (leaving the H5P interactive object with missing stream error).

BEFORE I upload a new version (with manually triggered web-video resolutions) : hls by default with manually triggered webvideo BEFORE replacement

AFTER I've uploaded a new version (new HLS version, but all web-video have been deleted) : hls new version without any webvideo AFTER replacement

Steps to reproduce

1.set Peertube to do only HLS resolutions 2.upload a video 3.manually trigger webtorrent transcoding of the video 4.upload a new version of the video 5.see that all web-video resolutions have been deleted

Describe the expected behavior

On an Peertube server with only one type of transcoding activated by default, I expect to see the "upload new version" process to check if any alternative transcoding (HLS or Web-video) already existed at the time of the replacement, and if so, it triggers the same transcoding.

So in my case, only HLS is set by default. But if Peertube "see" that web-video already existed for a video, it will trigger also this web-video transcoding during this replacement, in addition to the default HLS.

Additional information

EricGuic commented 1 week ago

And to add a precision : I also expect in my case that the new web-video transcodings stay reachable behind the same url as the original one, so previous use of it (in my case in H5P object) still works after the replacement.

If it's usefull, in H5P, I'm setting as the source the download url of the web-video file, for example : https://tube.reseau-canope.fr/download/web-videos/e96d8847-4b3b-4201-8cbd-a1a7258bb7f0-480.mp4 So if there isn't a better url to use, I would like this one to stay valid even after the replacement of the video, and the automatic trigger of the new web-video transcodings.

I hope I'm clear :-)

Chocobozzz commented 3 days ago

Hi,

I also expect in my case that the new web-video transcodings stay reachable behind the same url as the original one

I would break cache invalidation. I suggest to create a dedicated issue to discuss about an endpoint that can redirect to the latest video file URL