Hacker News new | ask | show | jobs
by craigc 1887 days ago
> It’s really simple

Have you ever written a stateless transcoder like this? Of course it can be done, but saying “you could simply encode those chunks” and “It’s really simple” is pretty misleading especially if you are changing frame rates or sample rates or audio codecs during the encoding process.

That said, if there is someone that could do this at scale it would be Facebook.

Also this would mess up ABR streaming at least for the first people to watch the video which would not really guarantee “the perfect encoding always”.

1 comments

I have written such a transcoder [0] and while it is definitely not "simple," it has definitely never been easier to achieve than today.

If the input video source has been prepared properly (i.e., constant framerate, truly compliant VBR/ABR, fixed-GOP), or if your input is a raw/Y4M, then segmenting each GOP into its own x264 bytestream is rather trivial.

If the input is not prepared for immediate segmentation, it is also somewhat easy now to fix this before segmenting for processing. Using hardware acceleration a transcoder could decode the non-conforming input to Y4M (yuv4mpegpipe) or FFV1, which can then have a proper GOP set.

[0] https://suprnova.video/