0

我通过编码 BufferedImages 创建一个视频文件。如何从 mp3 文件向该视频添加音频?

IMediaWriter movie = ToolFactory.makeWriter("somefile.mp4");                
movie.addVideoStream(0, 0, ICodec.ID.CODEC_ID_H264, 720, 540);
movie.encodeVideo(0,img, time, TimeUnit.MILLISECONDS);   
movie.close();

当我尝试连接类时,我收到此错误:

45694 [Thread-2] WARN com.xuggle.xuggler - Got error: picture is not of the same PixelType as this Coder expected (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1430)
4

1 回答 1

2

使用xuggle上的示例

writer.addAudioStream(audioStreamIndex, audioStreamId, channelCount,
      sampleRate);
于 2012-07-18T21:48:55.533 回答