Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h264 265 FU using wrong address #71

Open
fatalfeel opened this issue Jul 1, 2022 · 0 comments
Open

h264 265 FU using wrong address #71

fatalfeel opened this issue Jul 1, 2022 · 0 comments

Comments

@fatalfeel
Copy link

refer to live555 and use VLC play
void H264or5Fragmenter::doGetNextFrame()

// case 2
if (fHNumber == 264)
{
fInputBuffer[0] = (fInputBuffer[1] & 0xE0) | 28; // FU indicator
fInputBuffer[1] = 0x80 | (fInputBuffer[1] & 0x1F); // FU header (with S bit)
}
else
{ // 265
u_int8_t nal_unit_type = (fInputBuffer[1]&0x7E)>>1;
fInputBuffer[0] = (fInputBuffer[1] & 0x81) | (49<<1); // Payload header (1st byte)
fInputBuffer[1] = fInputBuffer[2]; // Payload header (2nd byte)
fInputBuffer[2] = 0x80 | nal_unit_type; // FU header (with S bit)
}

fInputBuffer[1] is nalu

FU_A[0] = (frame_buf[0] & 0xE0) | 28;
FU_A[1] = 0x80 | (frame_buf[0] & 0x1F);
frame_buf += 1;
frame_size -= 1;
&frame_buf[0] is not nalu value

////////////////////should
FU_A[0] = (frame_buf[4] & 0xE0) | 28;
FU_A[1] = 0x80 | (frame_buf[4] & 0x1F);
frame_buf += 5;
frame_size -= 5;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant