Created
May 1, 2016 16:51
-
-
Save Nook2007/92f460c87d8556d35ab5676f40a5e840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (VIDEO_TRACK == trackIndex) { | |
if (firstVideoData) { | |
byte[] spspps = {0, 0, 0, 1, 103, 66, -64, 30, -23, 1, 64, 123, 64, 60, 34, 17, -88, 0, 0, 0, 1, 104, -50, 6, -30}; //from media encoder | |
MediaCodec.BufferInfo spsPpsBI = new MediaCodec.BufferInfo(); | |
spsPpsBI.flags = bufferInfo.flags; | |
spsPpsBI.presentationTimeUs = bufferInfo.presentationTimeUs; | |
spsPpsBI.offset = 0; | |
spsPpsBI.size = spspps.length; | |
flv.writeVideoSample(ByteBuffer.wrap(spspps), spsPpsBI); | |
firstVideoData = false; | |
} | |
flv.writeVideoSample(byteBuf, bufferInfo); | |
} else { | |
flv.writeAudioSample(byteBuf, bufferInfo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment