gpt4 book ai didi

java - Xuggler - 添加音频?

转载 作者:行者123 更新时间:2023-12-02 07:41:13 25 4
gpt4 key购买 nike

我通过编码 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)

最佳答案

使用 xuggle 处的示例

writer.addAudioStream(audioStreamIndex, audioStreamId, channelCount,
sampleRate);

关于java - Xuggler - 添加音频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11550424/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com