Video encoding(transcoding,format conversion etc) performance elements
I have been working on a project to allow for batch encoding 开发者_StackOverflow社区of any video to any other format, up to now I have been looking for API that I am most comfortable with but then it occurred to me that video encoding can be heavy task and it might be better to use Language(platofrm) or API that has the highest performance, for instance encoding video in a language that doest best multi-cpu job scheduling is better than on ones that only simulate it and etc. Any comments or suggestions on this ?
Use ffmpeg/libavcodec.
You have two different routes to go here. You could do it all on your own,
DIY Approach
- If you want to do batch encoding, you need powerful machines. Spin up something in the cloud.
- Setup open source libraries. ffmpeg is a good start. It can handle many, but not all, kinds of formats.
- Do the transcodings/format conversions.
- Tip: Start with the command-line tool, and then go with the "API" offered by ffmpeg. The learning curve for the "API" approach is pretty steep.
Use Encoding APIs
- Use cloud encoding API providers (there are many google'em).
- They take care of all the background magic, and you just set up a configuration and go.
- They are super simple to use. For example, check out this simple encoding api.
- At the same time, they gave you lots of flexibility and are built to handle all the weird input/output format combinations.
- Of course, this costs some money.
Conclusion
If you don't mind getting your hands "dirty", have time/patience to spare, go with the DIY approach. It's a very steep learning curve, but worth it. You will have skills at the end. But if this is something you are deploying for commercial use, I would advise against this approach. Rather, look for the cloud encoding API providers and start using them. There are many out there, pick the one you like. That way you can focus on the video encoding problems rather than others.
Full Disclosure: I work at Bitmovin, but that does not influence my answer.
精彩评论