0

I have been able to implement a video/audio decoder and encoder. On my Samsung S3, everything works fine. Then I deployed into a Samsung, and I had some rotation issues I have fixed, but the final encoded video does not have audio. When I stop the mediamuxer I get the following log:

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

I guess is something related to the 4/82 buffers and only 4 frames encoded. I have written into the muxer all the buffers I got from the decoder, which I think there are the 82 buffers. The presentationTime and flags are the same which I get from the decoder. As I said, this code works on my Samsung S3. Do you have any ideas which would be my issue? could it be the bitrate? thanks.

4

1 回答 1

1

我发现在某些情况下 byteBuffers 使用 Position=Limit,因此,我必须设置 Position(info.Offset)、Limit(info.Offset+info.Size),就像在许多示例中一样(例如 grafika)。正因为如此,我一直在编码 0 长度的缓冲区,但只有 4 个带有数据。没有它,这在我的三星上运行良好,但在摩托罗拉手机上却不行。谢谢

于 2016-01-29T18:18:50.270 回答