如何将缓冲区中的像素编码为 h.264 或 VP8

发布于 2024-10-21 04:06:00 字数 359 浏览 7 评论 0原文

我有一个应用程序(qt c++),它从 USB 设备读取数据,将该数据解码为存储在 uchar 数组中的 24 位 RGB 像素。

帧速率约为 10 FPS。帧大小为 128x4096。

问题是:如何将这些帧实时编码成VP8或h.264视频?

不允许外部进程,所有内容都需要在我的应用程序内运行。

ffmpeg 是一个选项,但如何将其包含到我的项目中并使用它?至少可以说,文档相当糟糕。 x264 也可以是一个选项,但问题与 ffmpeg 相同。而且它也相当昂贵,1 美元/单位,最低 10000。

简单的指南会有所帮助,但我怀疑是否存在这样的指南。

应用程序应在 Windows 和 Linux 中运行。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

横笛休吹塞上声 2024-10-28 04:06:00

VP8 SDK 的问题在于这些示例仅编码为 IVF。由于安全缺陷(缓冲区溢出),该编解码器似乎已被 Microsoft 关闭。当您甚至无法检查结果时,甚至很难获得 VP8 项目设置。它至少使用了 BSD 许可方案,并且据称不受专利限制。
VP8 SDK 有一些用于转换格式的例程,但它们隐藏在源代码树中。

未提及的一个选项是 Intel Media SDK,但它会将您锁定在 Windows 上。

还有狄奥拉和狄拉克。

X264有一个编码器,但是获得商业许可证会很昂贵。
GPLv2 源代码不是“免费”的。我不在乎他们试图让你相信什么。
还有一个名为“Revel - the Very Easy Video Encoding Library”的项目。这是对 MPEG-4 第 2 部分文件进行编码的途径。 H264 是 MPEG-4 第 10 部分。H264 也称为 AVC。 Revel 也是 GPL 的。

Ffmpeg 是一个包罗万象的实用程序,它试图围绕各种编码器/解码器创建一个包装器。如果你使用 x264 编码器,它就变成了 GPLv2。

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.

懒的傷心 2024-10-28 04:06:00

VP8 SDK 有文档,甚至 VP8 SDK 也有文档。 webmproject.org/docs/vp8-sdk/samples.html" rel="nofollow">一些示例代码

The VP8 SDK has documentation and even some sample code

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文