Closed jameskimmel closed 2 years ago
There's a lot more to it than codecs; bit rate ranges, profile levels, gop size all matter too. Even if a transcode itself isn't necessary we'd need a remux since nobody is uploading in HLS+fmp4.
Remux only would save a lot of CPU cycles. That alone would be a huge enhancement in my opinion. Also I see no hurt in mentioning it in the docs :)
As far as I can see, these are the only requirements to avoid transcodes and remux instead:
Codec: h.264 pixel format: yuv420p minimum FPS: 1 maximum FPS: 60 max Bitrate: 25mbit
Can someone find additional requirements?
I already mentioned gop size. And 25 megabits is much too high for most internet connections.
Could you be a little bit more specific about the gop size please? I could not find a min or max limit. 25mbit is perfectly fine in my opinion. Netflix recommends 25mbit for 4k content (Source: https://help.netflix.com/en/node/13444),
gop size will influence the segment sizes available for HLS streaming, and unnecessarily large gop sizes will make streaming and seeking slower. we usually try to keep it around 2 seconds.
25mbit may be acceptable for high end content but it's much too fast for most connections. it rarely makes sense to use a blanket bit rate irrespective of resolution or frame rate, since high end content like 4k also requires a high end internet connection.
Bear with me, I am not an English speaker and not a programmer. The only goal I have try to find out this: What format should users upload to avoid transcoding?
Why do I want to avoid transcoding? Unnecessary CPU cycles waste energy. I assume there are a lot of users on VPS with 1-2 cores. Another reason would be, that you want the best possible quality. If a user exports a video from Premiere in h.264 it is transcoded once. If a transcode happens again on peertube, the video was encoded twice and thous loses quality.
So I look through the code (remember not a programmer) and as far as I can see, peertube uses a class called CanDoQuickTranscode to determine if it can remux instead of reencode.
https://github.com/Chocobozzz/PeerTube/blob/c77fdc605b3ccc1ab6890f889d8200fbe9372949/server/helpers/ffprobe-utils.ts#L133
This is where I got the "requirements" I have listed from.
I now realise that the same goes for audio.
Codec: AAC
Channel layout: needs to be known?
Bitrate: 384kbit
If I have missed stuff like gop size, please understand it is not because of ignorance! I just don't know better :)
Hello,
Unfortunately we force transcoding when generating HLS playlists because we experienced issues with some web browsers, even if we could "quick transcode" the video. Therefore there is no supported format to avoid transcoding in PeerTube.
Describe the problem to be solved As a user or the admin of an instance, I am probably unaware, that there are some video profiles that do not need any transcoding nor remuxing.
I am not a coder, but as far as I understood the code, any video that is h.264 and AAC audio in a .mp4 container does not need additional transcoding.
Video editors could decide to export their movies matching the supported profiles to begin with.
Describe the solution you would like: Mention the supported profile without transcoding here: https://docs.joinpeertube.org/use-create-upload-video or / and mention it on the publish webpage.