7 ms·
I'm surprised Facebook still uses software to do video encoding. Most big companies with millions of hours of video uploaded each day have realised it's cheape
by londons_explore 6y ago
I'm surprised Facebook still uses software to do video encoding.
Most big companies with millions of hours of video uploaded each day have realised it's cheaper to stick a bunch of hardware video encoding chips onto an accelerator board and be able to transcode 100 HD streams simultaneously into all the formats and resolutions you need to host.
The power savings on CPU's pay for the custom hardware in a matter of months.
It does reduce flexibility when new video formats get released though.
- PicassoCTs 6y ago? Xilinx for the rescue?
- meteorfox 6y agoFacebook does have hardware for video transcoding. [1] https://youtu.be/0yk4SPRisPA https://youtu.be/0yk4SPRisPA
- deleted 6y ago[deleted]
- retrac 6y agoHardware encoders for newer codecs tend to be simply less bit-efficient. They can be more limited in features. My desktop's GPU can handle quite a few 1080p H.264 streams in parallel. But it can't do average-bitrate-capped CRF, which I think is the preferred type of encoding for streaming services.
- deleted 6y ago[deleted]
- prvc 6y agoWhat was mentioned in the article seem like very basic, obvious considerations. Meanwhile, Youtube has custom ASICs which efficiently produce multiple formats simultaneously.
- jeffbee 6y agoAnd yet, despite YouTube's abundantly clear motivation for doing so it took them years and years to develop the hardware and it only recently hit production. Could it be that acceleration for video encoding isn't as easy as people are making it sound?
- dylan604 6y agoI'm waiting for the "meh, i could roll it out in a weekend" responses.
- yjftsjthsd-h 6y agoOf course I could;) It would just be hacky, ugly, unreliable, scale badly, use either GPUs or inadequate FPGAs, and fall over once it exceeded 10 users. My resume doesn't need to know that, though:)
- dylan604 6y agoYou now know 1 way of not to do it.
- webmobdev 6y agoI would be suprised if FB doesn't use hardware encoders. That said, hardware encoders are fast, but they don't match the quality of the software (CPU) encoding. Slower CPU encoding still provide the best quality.
- thefourthchime 6y agoI can’t speak for all of the encoding options. But I can tell you that Dolby Hybrik, one of the main competitors and encoding space uses relatively cheap ec2 instances. Based on the speed I see from Telestream and Elemental. I think they’re software based as well
- cobookman 6y agoYoutube and Facebook have a much different encoding problem then say HBO/Netflix/Hulu...etc YT & FB have a few popular videos, and a ginormous long-tail. That long-tail needs to be encoded, and cheaply as it might not get many views. The TV/Movie VOD over IP industry stands to benefit optimizing the encoding to have the smallest filesize with highest quality. Spending considerable CPU cycles to find that best quality path. For those like Netflix, why would you invest with ASICs. You likely don't have a huge infra bill (relatively) when it comes to encoding. And CPU vs ASICs, the ASICs mean you loose flexibility to really fine-tune the quality and use the latest codecs. For those like YT/FB. You just gotta encode that long tail. Getting something cheap that's 80% the quality of CPU-based encoding is good enough for 99% of the content.
- mnt16 6y agoElemental is a mix of software and hardware encoding. They utilize GPU’s for some portion on the encode.
- astrange 6y agoHardware encoders are not as good because they have worse algorithms in order to make them faster. I don’t think you could make an x265 ASIC. Also, good video codec engineers can’t be hired for any predictable amount of money, and ones who speak Verilog barely exist.
- yaur 6y agoThis used to be true but modern NVIDIA cards beat x264 on both quality and energy cost.
- Wowfunhappy 6y agoThey do?! Even on the slow presets?
- paulmd 6y agoNVENC beats x264 medium. Not quite up to the level of the "slow" presets yet but you have to throw a huge amount of hardware at it to match them let alone beat them. Basically the number I came up with a few weeks ago from playing around with x264 settings on ffmpeg was between 6 and 12 cores to keep up with NVENC at 720p and 1080p, depending on framerate and the quality preset.
- ksec 6y agoWhat sort of bitrate are we talking about? I haven't tried using NVENC for years and last time I check it was clearly missing many details that x264 tries to preserve. NVENC is good at cleaning the noise and fast encoding. ( Or basically Game Streaming ). Which isn't something you want to do if you want to do movies encoding.
- paulmd 6y agohttps://developer.nvidia.com/blog/turing-h264-video-encoding-speed-and-quality/ https://developer.nvidia.com/blog/turing-h264-video-encoding...
- manca 6y agoThe problem is that most of the big tech thinks they are smarter than 1000's of codec engineers who worked on libx264 and they try to reinvent the wheel. They realize too late that all the money they threw into building their own stuff (or variants) do far worse in general case than the baseline libx264. They just don't want to admit it.
- LdSGSgvupDV 6y agoBidTechEngineer: Ya, I know, but I need that wasted money.
- manca 6y agoAbsolutely. In fact, I interviewed a guy last week that comes from very big tech and he basically himself admitted that they're basically wasting time and money chasing unknown "ideal" codec while almost always those projects hit dead end. He loves the money, I am sure, but he wants out anyway. :)
- Tade0 6y agoWho wouldn't eventually? I've been to a project where, because the development and "hardening" budgets were separate, we knowingly pushed out buggy code so that we could take advantage of the latter. Had I known that half of the job would be to game the system, I wouldn't have joined.
- nowherebeen 6y ago> half of the job would be to game the system, I wouldn't have joined. Bureaucracy is inevitable once a certain number of people join a group.
- ClumsyPilot 6y ago"Had I known that half of the job would be to game the system" You should be happy it's only half!
- 6y ago
- jimmySixDOF 6y agoLike someone already pointed out this whole announcement could be in response to Google announcing this week it's new Argos chipset approach to transcoding [1] https://arstechnica.com/gadgets/2021/04/youtube-is-now-building-its-own-video-transcoding-chips/ https://arstechnica.com/gadgets/2021/04/youtube-is-now-build...
- dheera 6y agoI could see lots of reasons to do software encoding at a company like Facebook which are probably not mentioned in the article, including e.g. extracting the optical flow which can be reused as part of various machine learning workflows. For example, if you want to only annotate 1 in 100 frames and interpolate with optical flow, you can get the flow in the process of doing video compression. I don't have inside info but there are various other things like this that I can think of for wanting to do it in software. Also, hardware encoders suck if the company making the hardware decides to suddenly EOL the product. With software encoders you can easily scale the backend whenever you want, at any time in the future, and without succumbing to supply chain issues.
- tinus_hn 6y agoIf you’re Facebook, the company making the hardware doesn’t suddenly decide to EOL the product, or they are sued for millions for breach of contract.
- ksec 6y agoGoogle released the paper [1] "Warehouse-scale video acceleration: co-design and deployment in the wild " a few days ago. https://news.ycombinator.com/item?id=26925307 https://news.ycombinator.com/item?id=26925307 >It does reduce flexibility when new video formats get released though. A new video codec is released and adopted once every ten years. So I dont think it would be a problem. Hardware encoding also trade compression quality for speed. And they are compensating it with slightly higher bitrate. It will also reduce their incentives for improving open source encoder. Although I think even Netflix switched to BEAMR ( Cant really blame them though ) I think the next frontier, for both Audio and Video will be Codec designed with LiveStreaming / Low Latency in mind. ( Or pretty much everything computing, I wish we could focus on latency, from Hardware Input, Display, Network, Disk, etc. Apple is certainly moving in that direction without talking about it. )
- cpeterso 6y agoI was talking with a Netflix product manager a few years ago and, IIUC, he said Netflix re-encodes their entire catalog monthly to take advantage of new encoder optimizations. Disk is cheap. They want to optimize network transfers to both save money and improve user experience.
- teruakohatu 6y agoNetflix has about 36,000 hours of content. On Youtube that much content is uploaded every 1 hour and 20 minutes! Or to put it another way, Netflix re-encodes every month what YouTube encodes in just over an hour.
- ynx 6y agocounterpoint: if you're big enough to have your own bona-fide cloud, then you might have more spare CPU capacity that can be flexibly allocated than available PCs with dedicated GPU
- zaphirplane 6y agoIf you are in the cloud business you are worried about heating power, with powering down disks a real thing
- ZeroGravitas 6y agoI've seen this contrasted with the Google stuff but it seemed to me the two approaches were entirely complementary. Facebook, which videos will we transcode into what versions. Google, with this list of videos to transcode how can we do it cheaply on a massive scale. I didn't spot anything that pitted approaches against each other.