开发者

Muxing an AVI with PyMedia

I am trying to generate an AVI with PyMedia by muxing together an audio and video stream. However, I can't find any examples on the web, and can't even get a simple example with a single MPEG2 video stream like this working:

from pymedia import muxer
from pymedia.video import vcodec

params = {
    'id': vcodec.getCodecID('mpeg2video'),
    'frame_rate': 10000,
    'width': 640,
    'height': 480,
    'bitrate': 1000,
    'channels': 1,
}
mux = muxer.Muxer('avi')
mux.addStream(muxer.CODEC_TYPE_VIDEO, params)
mux.start()

In Windows, this crashes Python with a generic error box "python.exe has stopped working.".

Am I doing something wrong here or is this library just broken? I realise the PyMedia project hasn't been active for a few years, but have quite a开发者_开发百科 bit of old code that uses it and am hoping I don't have to port it all to another library.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜