如何将图像一张一张地发送到x264?

发布于 2024-08-22 17:21:05 字数 212 浏览 4 评论 0原文

我有一个用 C 编写的图像生成器。现在我想将这些图像传递到 x264 以对其进行编码并将其写入文件。

  • 每第 100 个图像都应该是一个关键帧,以便每第 100 帧将视频保存到磁盘。
  • 图像生成器在每个图像之后调用onImageGenerate()

如果您能提供有关如何以这种方式设置 x264 的指示,我将不胜感激。

I've got an image generator written in C. Now I want to pass those images to x264 to encode them and write it to a file.

  • Every 100th image should be a key frame in order to save the video to disk every 100th frame.
  • The image generator calls onImageGenerated() after each image.

I'd appreciate any pointers on how to set up x264 in this way.

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

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

发布评论

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

评论(2

放飞的风筝 2024-08-29 17:21:05

关于关键帧:这可以作为 x264 的选项传递。

为了将图像传递到 x264,您可以使用命名管道(希望您使用的是 unix):生成的图像将由您的程序写入命名管道,x264 将使用该管道作为输入。

使用此解决方案,您将不需要搞乱 x264。如果需要更多帮助,请询问!

About the keyframes: this can be passed as an option to x264.

In order to pass the images to x264, you can use a named pipe (hope you are using unix): the generated images will be written to the named pipe by your program and x264 will use the pipe as input.

Using this solution you won't need to mess with x264. If more help is needed just ask!

后知后觉 2024-08-29 17:21:05

您可以使用 x264 的前端之一。例如 FFMPEG http://ffmpeg.org/
它为您提供了一个库,您可以将其链接到您的程序中并调用其 API 对图像进行编码解码

You can use one of the front-ends for x264. For example FFMPEG http://ffmpeg.org/
It provides you with a library which you can link in your program and call its APIs to encode decode the image

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