开发者

Encoding graphics into an mpeg stream

开发者 https://www.devze.com 2023-04-11 11:49 出处:网络
looking for an example of how to programatically encode a frame-buffer into an mpeg stream. I need this to experiment with some mp开发者_C百科eg encoders, to see how different patterns compress.

looking for an example of how to programatically encode a frame-buffer into an mpeg stream. I need this to experiment with some mp开发者_C百科eg encoders, to see how different patterns compress.

I have a slight inclination towards Windows, although if linux gives some advantage it is not a problem.


Assuming that you can turn your frame-buffer into a series of image files, you could convert them to mpeg video using ffmpeg:

From the docs:

For creating a video from many images:

 ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi

The syntax "foo-%03d.jpeg" specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable.

You'd want something like:

ffmpeg -f image2 -i in-%d.jpg out.mpg

for an mpeg stream.

0

精彩评论

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

关注公众号