开发者

How to encode pixels from buffer to h.264 or VP8

开发者 https://www.devze.com 2023-02-16 01:06 出处:网络
I have a application (qt c++) that reads data from USB-device, decodes that data into 24bit RGB pixels which are stored in a uchar array.

I have a application (qt c++) that reads data from USB-device, decodes that data into 24bit RGB pixels which are stored in a uchar array.

Framerate is ~10 FPS. Framesize is 128x4096.

Question is: How to encode these frames into VP8 or h.264 video in real time?

No external processes are allowed, everything needs to run inside my application.

ffmpeg is an option but how to include it to my project and use it? Documentation is rather 开发者_如何转开发bad to say the least. Also x264 could be an option but same question as to ffmpeg. And it's also quite expensive, 1$ for unit and minimum of 10000.

Simple guide would be helpful but I doubt there exists one.

Application should run in Windows and Linux.


The problem with the VP8 SDK is that the examples only encode to IVF. That codec appears to have been shut down by Microsoft due to a security flaw (buffer overflow). It's pretty hard to even get the VP8 project setup when you can't even check the results. It at least uses a BSD license scheme and its supposedly unencumbered with patents. The VP8 SDK has some routines for converting formats, but they are buried in the source tree.

An option not mentioned is the Intel Media SDK, but that locks you to windows.

There is also Theora and Dirac.

X264 has an encoder, but it would be expensive to get a commercial license. GPLv2 source code is not "free". I don't care what they try to get you to believe. There is also a project called "Revel - the Really Easy Video Encoding Library". That is a path to getting MPEG-4 part 2 files encoded. H264 is MPEG-4 part 10. H264 is also called AVC. Revel is also GPL'd.

Ffmpeg is a catch all utility that tries to create a wrapper around the various encoders/decoders. If you use the x264 encoder with it, it becomes GPLv2.


The VP8 SDK has documentation and even some sample code

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号