PeerTube icon indicating copy to clipboard operation
PeerTube copied to clipboard

Multiple transcode from original file to cut down time to publication from synchronization

Open emansom opened this issue 3 years ago • 5 comments

Describe the problem to be solved

I run a PeerTube instance that mirrors a YouTube channel that publishes content on a timely basis.

This content is long in length and thus takes a significant window of time to publish, and vast resources to transcode. Publication usually laggs behind a few hours compared to other platforms.

Describe the solution you would like

I would like PeerTube to first transcode the original import using -preset ultrafast to reduce the initial publication time to an absolute minimum.

(and possibly the following options as well -vf mpdecimate -fps_mode vfr -r 30 -profile:v high -level 4.0 -tune film to have a balance between file size and quality, while drastically reducing transcode time)

Then after that, enqueue a high quality transcode from the original import; and delete the fast transcoded version once the high quality version has been successfully transcoded.

emansom avatar Dec 01 '22 00:12 emansom

Should be behind a configurable toggle in the admin panel, as likely not all instances would want to show a low quality version to their subscribers first.

As well as a visual indicator towards the viewer that this video is a low-quality fast pass, and that a higher quality version will be available later.

emansom avatar Dec 01 '22 01:12 emansom

Do you have some insights about time saved with this double transcoding?

Chocobozzz avatar Dec 05 '22 07:12 Chocobozzz

Do you have some insights about time saved with this double transcoding?

With manual testing on my box, it yields a 10x transcoding speed improvement. This cuts publication time down from a few hours to about fifteen minutes on a long vodcast.

That's when running on an AVX enabled high-core amount Xeon running the ZEN kernel (Higher resolution scheduling, Maple Tree patches, MGLRU), YMMV.

emansom avatar Dec 05 '22 12:12 emansom

Do you have some insights about time saved with this double transcoding?

My use case is outside of the norm but in my situation if I could publish the first transcode with ultrafast h264 and then transcode the final version in VP9 or AV1.. depending on the length of the video it could cut down the publish time by hours.

Edit: And this is with a 24 core 3900x. I'd imagine most users using VPS with 2-4 cores would see huge benefits even with just h264.

SimplyCorbett avatar Dec 08 '22 18:12 SimplyCorbett

Wondering if there are any updates on the status of this.

vid-bin avatar Feb 20 '24 04:02 vid-bin