开发者

Encoding graphics into an mpeg stream

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜