4 ms·
Transcoding on the client instead of in the cloud increases the amount of CPU and upstream bandwidth needed, and both are in short supply on phones. To put thi
by lucasgonze 12y ago
Transcoding on the client instead of in the cloud increases the amount of CPU and upstream bandwidth needed, and both are in short supply on phones.
To put this in perspective, three live encodes/ streams (360P, 540P, 720P) using Wirecast on a high end Macbook Pro pegs the CPU around 60% and requires at least 5MBPS upstream.
I understand the financial reasons for this architecture - cloud-based transcoders are crazy expensive - but from a customer satisfaction POV it's not an easy project.
- jgh 12y agoEncoding is done in hardware on the client side and doesn't increase CPU load by very much. I'm using the same trick in a library I made to do game broadcasting from iOS and honestly network traffic increases CPU load more than encoding an 1136x640 video does.
- lucasgonze 12y agoCan you be more specific by "in hardware"? I'll buy that there's some trick analogous to shaders on the desktop. But I'd want to know the specifics to be able to evaluate that. How many encodes have you been able to do, anyway? Encoding and upstreaming a single 640p video does seem plausible. But for each additional encode you need HLS and RTMP, and both CPU and upstream bandwidth grow linearly with each encode. A single bitrate means HLS and RTMP - two encodes, two upstreams. (Only HLS means only Apple software - 20% of the mobile market, 5% of the desktop market).
- jgh 12y agoWhy should you have to encode twice for HLS and RTMP? The only reason to encode twice or more would be if you wish to have different movie properties (i.e. bitrate, fps, resolution, etc) For example, for h.264, once you get the NAL units from the encoder (which in the case of iOS is a chip provided by PowerVR) you can encapsulate them in whatever format you need...mpeg-ts, MP4, RTMP, RTP, it doesn't matter... I only support one simultaneous encode in my SDK, and I'm not actually sure how many the hardware would support as an upper limit.
- chrisballinger 12y agoI've done simultaneous hardware encoding before (two 640x480 videos) but I haven't pushed the boundaries yet. I have a hunch that newer phones might be able to do a few bitrates at the same time, but at that point we will do re-encoding server side because end users will have more limited upload bandwidth than our servers.
- jgh 12y agoInteresting... I should do an experiment to see how many encodes I can do at once and what ends up happening.
- lucasgonze 12y agojgh, it's a completely different stack for HLS publishing vs. Flash. Different media, different upstreams, different endpoints. Looks at any encoding/pushing tools. It's possible to perform a single encode per bitrate, then split it between Flash and HLS on the server side, but then again that already exists in the form of cloud-based transcoders. It's also possible to take that single encode - h.264, for example - and wrap it twice, once for MP4 and once for HLS, but that would be software, which is CPU intensive. If it's in software, it's not in hardware.
- jgh 12y agoYou don't need to do that though. The container or packet format is completely independent from the encoder format and they're all fairly simple, so packetizing compressed audio and video data and sending multiple streams, while not ideal due to bandwidth concerns, is most definitely not limited by CPU resources.
- haywardsmyfault 12y agoHello! Kickflip developer here! The SoCs included with virtually every mobile device today have circuits designed specifically for encoding/decoding H.264 video and AAC audio. This is how your mobile device's native camera app reliably records HD video. Whether it's 640p or 1080p, there isn't a significant drain on system resources. These chips were traditionally accessed via a standard OMX[1] library (Think OpenGL for Video hardware), but the OMX implementations were device specific, making it nearly impossible to write custom video software with mass market appeal. Just recently (July '13 on Android), the video hardware has become somewhat controllable by the standard Android / iOS platform APIs allowing us to write a truly compatible video product. We currently only offer single stream output. When we do offer multiple bitrate outputs (transcoding), we'll do that work serverside. [1] http://en.wikipedia.org/wiki/OpenMAX http://en.wikipedia.org/wiki/OpenMAX
- lucasgonze 12y agoIf you only offer a single stream, your claims of being better than cloud-based transcoders have no meaning. You don't transcode, they do. You push a single stream, which any client can already do, and they can already live without transcodes. Your app doesn't add value by freeing them from the cost of cloud-based transcoders.
- haywardsmyfault 12y agoOur current offer is a significant cost reduction for a single high-quality broadcast to a large audience. On top of that we handle all the plumbing related to your iOS/Android cloud video app. Our SDK can manage all your application's broadcasts and users (if you choose). I'm excited for our open-source Android and iOS clients to stimulate development of some novel video apps. Maybe Security monitoring systems or even Phone + $20 Weather balloon = Weather satellite!
- Mizza 12y agoThe CPU usage actually isn't a whole bunch, since we do the video stuff with the hardware encoders on the devices. It does use more bandwidth, since the streams are higher quality than other methods, but that's . It's also configurable.. it doesn't _have_ to be higher quality. Implementers can choose to lower the resolution. All in all, this is definitely a better solution for developers and clients.
- lucasgonze 12y agoThis is definitely a cheaper solution than outsourcing to a cloud transcoding service, which is $$$. The streams are not higher quality than other methods. Your 720P is the same as everybody elses.
- Mizza 12y agoBut everybody else doesn't have 720p, precisely because cloud transcoding is so expensive. By default, Bambuser broadcasts at a measly 240 resolution with a low bitrate, and other streaming services were similar. In our test, our video quality was always much much higher. This is a great opportunity for a future blog post in which we explore the differences you're bringing up!
- srean 12y agoHey HN can we stop this petty downvoting please. It is starting to get really annoying. Dont know if anyone else has noticed this, but it seems stories these days are riddled with greyed out posts, even perfectly legit comments. I try to compensate with upvotes, but as I said this is really leaving a bad taste everytime I see this happening. This change seems highly correlated with the change of hands. I thought this would be a temporary phase, but seems to have become worse with time. I think a line of over-moderation is being crossed here. I would try and flag my own comment so that it gets some attention. EDIT: Unfortunately it seems one cannot do that, but if you agree, and can flag this, please do.
- dang 12y agoYou must have missed the recent posts where we've written about this at length. Here are a few to get you caught up: https://news.ycombinator.com/item?id=7605973 https://news.ycombinator.com/item?id=7605973 https://news.ycombinator.com/item?id=7619287 https://news.ycombinator.com/item?id=7619287 https://news.ycombinator.com/item?id=7611148 https://news.ycombinator.com/item?id=7611148 https://news.ycombinator.com/item?id=7608102 https://news.ycombinator.com/item?id=7608102 https://news.ycombinator.com/item?id=7642127 https://news.ycombinator.com/item?id=7642127 You'll notice that I've written a lot about the community practice of corrective upvotes, which is the best antidote to unfairly faded-out comments. This practice works most of the time. For example, the comment score you're complaining about was corrected hours ago. Corrective upvotes work because few such comments go far into negative territory. They're the best solution because they fix most of these problems silently. The reason the guidelines ask you not to post complaints about downvoting is that those, by contrast, stick around forever, worsening the threads.
- srean 12y agoReplying here because I may have your attention. Feel free to remove, because after that my purpose would have been served. I am well aware of your position, and I do try to correct comments that I feel were unfairly down-voted. However, I dont like this solution at all. > For example, the comment score you're complaining about was corrected hours ago. I had upvoted it to compensate for the downvote myself. If this was a single instance I would have moved on. I am seeing this too frequently and I dont see how else I can bring this to your attention. (If there is an alternative please do mention, Would be happy with a Ask dang page.) A downvote is unfriendly (although sometimes it is indeed deserved). An unfair downvote may or may not get corrected, and now I can only correct it and not give it a positive karma that I otherwise would have liked to. That does not seem to have been the HN way. It still would have been fine if the downvote pattern would have been as before. Compensatory upvote has been a part of HN since ever. It is not a new invention. Its the recent uptick in downvotes on perfectly benign comments (not mine) that is bothering me. What is bothering me is that I noticed that downvoting has acquired a distinct hair trigger edge and a tendency leaning towards petty disagreements. There is a heavy feeling of over moderation in several threads. I am not an old timer by any means but have been around for a while to know that this feels very alien on HN, unsavory too. On the contrary, this mythical "highly toxic comment" that is being used to justify the change I have seen very little of. Far rarer than a new story with half the comments greyed out, for the entire night. I love spending time here, I am sure you would want HN to be something like that, so wanted to bring this to your attention even though I was sure this will get downvoted. If this causes some reflection, thats a tiny cost to pay. Finally, like with system administration, good moderation is one that is barely noticed. I sense things are getting a little overboard. Just an FYI