开发者

How can I send images to x264 one by one? [duplicate]

This question already has answers here: How does one encode a series of images into H264 using the x264 C API? (3 answers) 开发者_StackOverflow社区 Closed 7 years ago.

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.


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!


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜