Skip to content

media presentationTimeUs is not correct #1

Description

@RrtoyewxXu

I find that media stamp time is not correct when i play it using other player.then I check code

// adjust the ByteBuffer values to match BufferInfo (not needed?)
encodedData.position(mBufferInfo.offset);
encodedData.limit(mBufferInfo.offset + mBufferInfo.size);
mMuxer.writeSampleData(mTrackIndex, encodedData, mBufferInfo);
Log.d(TAG, "sent " + mBufferInfo.size + " bytes to muxer");

found mBufferInfo.presentationTimeUs = 710920,not correct,
at last, I try to modify presentationTimeUs like this

// adjust the ByteBuffer values to match BufferInfo (not needed?)
encodedData.position(mBufferInfo.offset);
encodedData.limit(mBufferInfo.offset + mBufferInfo.size);
Log.e("TAG",startRecordTime+"S");
mBufferInfo.presentationTimeUs = startRecordTime / 1000;
startRecordTime += 1000 / FRAME_RATE;
mMuxer.writeSampleData(mTrackIndex, encodedData, mBufferInfo);
Log.d(TAG, "sent " + mBufferInfo.size + " bytes to muxer");

It does not work.
please help me to solve issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions