我已经能够实现视频/音频解码器和编码器。在我的三星S3上,一切正常。然后我部署到三星,我有一些我已修复的旋转问题,但最终编码的视频没有音频。 当我停止mediamuxer时,我得到以下日志:
01-29 12:35:26.372 I/MPEG4Writer(23222): Received total/0-length (27/0) buffers and encoded 27 frames. - video
01-29 12:35:26.374 D/MPEG4Writer(23222): Stopping Audio track
01-29 12:35:26.376 I/MPEG4Writer(23222): Received total/0-length (4/82) buffers and encoded 4 frames. - audio
01-29 12:35:26.376 I/MPEG4Writer(23222): Audio track drift time: 0 us
01-29 12:35:26.377 D/MPEG4Writer(23222): Stopping Audio track source
01-29 12:35:26.377 D/MPEG4Writer(23222): Audio track stopped
01-29 12:35:26.377 D/MPEG4Writer(23222): Stopping Video track
01-29 12:35:26.377 D/MPEG4Writer(23222): Stopping Video track source
01-29 12:35:26.377 D/MPEG4Writer(23222): Video track stopped
01-29 12:35:26.378 D/MPEG4Writer(23222): Stopping Audio track
01-29 12:35:26.378 D/MPEG4Writer(23222): Duration from tracks range is [80000, 1772500] us
01-29 12:35:26.378 D/MPEG4Writer(23222): Stopping writer thread
01-29 12:35:26.379 D/MPEG4Writer(23222): 1 chunks are written in the last batch
01-29 12:35:26.380 D/MPEG4Writer(23222): Writer thread stopped
01-29 12:35:30.212 D/MPEG4Writer(23222): Stopping Video track
01-29 12:35:30.212 D/MPEG4Writer(23222): Stopping Audio track
我猜是与4/82缓冲区相关的东西,只有4帧编码。我已经将从解码器中获得的所有缓冲区写入复用器,我认为有82个缓冲区。 presentationTime和标志与我从解码器获得的相同。 正如我所说,这个代码适用于我的三星S3。你有什么想法会成为我的问题吗?可能是比特率? 感谢。
答案 0 :(得分:1)
我发现byteBuffers在某些情况下得到了Position = Limit,所以,我必须设置Position(info.Offset),Limit(info.Offset + info.Size),就像它在许多例子中一样(例如grafika)。因此,我一直编码0长度缓冲区,但只有4个数据。没有它,这在我的三星中运行良好,但在摩托罗拉手机中没有。 感谢