- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I use SLICE_CHECK_LIMIT, the stream is certainly split in NAL with a given size.
I didn't find an accessor in the sample for changing the value of m_MaxSliceSize, so I changed it in the code directly.
My question is the following one:
I use the following code (not optimized for a good understanding)
int nSrcWidth = abs((long) pOutputFormat->bmiHeader.biWidth);
int nSrcHeight = abs((long) pOutputFormat->bmiHeader.biHeight);
// Compared to I420 (YUV) plans are in YV12 (YVU)
LPBYTE pDestY = lpVideoBuffer;
LPBYTE pDestU = pDestY + (nSrcWidth * nSrcHeight);
LPBYTE pDestV = pDestU + ((nSrcWidth * nSrcHeight) / 4);
m_pSrcMediaData->SetPlanePointer(pDestY, 0); // Y
m_pSrcMediaData->SetPlanePointer(pDestU, 1); // U
m_pSrcMediaData->SetPlanePointer(pDestV, 2); // V
m_pDstMediaData->SetBufferPointer(lpCompressedData + sizeof(RTP_INFO_HEADER), lOutDataLen - sizeof(RTP_INFO_HEADER));
if (m_h264VideoEncoder->GetFrame(m_pSrcMediaData, m_pDstMediaData) == UMC::UMC_OK)
{
if (m_pDstMediaData->GetDataSize() > 0)
{
....
The problem is that m_pDstMediaData is a continous stream, how I can access the NAL split in order to send it over the network. I need to split in NAL with a maximum size of the given MTU. The mode used is the single NAL unit.
I found a h264_split but it's not very how I should use it (if I need to use it)
Thanks for your answers.
I didn't find an accessor in the sample for changing the value of m_MaxSliceSize, so I changed it in the code directly.
My question is the following one:
I use the following code (not optimized for a good understanding)
int nSrcWidth = abs((long) pOutputFormat->bmiHeader.biWidth);
int nSrcHeight = abs((long) pOutputFormat->bmiHeader.biHeight);
// Compared to I420 (YUV) plans are in YV12 (YVU)
LPBYTE pDestY = lpVideoBuffer;
LPBYTE pDestU = pDestY + (nSrcWidth * nSrcHeight);
LPBYTE pDestV = pDestU + ((nSrcWidth * nSrcHeight) / 4);
m_pSrcMediaData->SetPlanePointer(pDestY, 0); // Y
m_pSrcMediaData->SetPlanePointer(pDestU, 1); // U
m_pSrcMediaData->SetPlanePointer(pDestV, 2); // V
m_pDstMediaData->SetBufferPointer(lpCompressedData + sizeof(RTP_INFO_HEADER), lOutDataLen - sizeof(RTP_INFO_HEADER));
if (m_h264VideoEncoder->GetFrame(m_pSrcMediaData, m_pDstMediaData) == UMC::UMC_OK)
{
if (m_pDstMediaData->GetDataSize() > 0)
{
....
The problem is that m_pDstMediaData is a continous stream, how I can access the NAL split in order to send it over the network. I need to split in NAL with a maximum size of the given MTU. The mode used is the single NAL unit.
I found a h264_split but it's not very how I should use it (if I need to use it)
Thanks for your answers.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yann.stephan@gmail.com
When I use SLICE_CHECK_LIMIT, the stream is certainly split in NAL with a given size.
I didn't find an accessor in the sample for changing the value of m_MaxSliceSize, so I changed it in the code directly.
My question is the following one:
I use the following code (not optimized for a good understanding)
int nSrcWidth = abs((long) pOutputFormat->bmiHeader.biWidth);
int nSrcHeight = abs((long) pOutputFormat->bmiHeader.biHeight);
// Compared to I420 (YUV) plans are in YV12 (YVU)
LPBYTE pDestY = lpVideoBuffer;
LPBYTE pDestU = pDestY + (nSrcWidth * nSrcHeight);
LPBYTE pDestV = pDestU + ((nSrcWidth * nSrcHeight) / 4);
m_pSrcMediaData->SetPlanePointer(pDestY, 0); // Y
m_pSrcMediaData->SetPlanePointer(pDestU, 1); // U
m_pSrcMediaData->SetPlanePointer(pDestV, 2); // V
m_pDstMediaData->SetBufferPointer(lpCompressedData + sizeof(RTP_INFO_HEADER), lOutDataLen - sizeof(RTP_INFO_HEADER));
if (m_h264VideoEncoder->GetFrame(m_pSrcMediaData, m_pDstMediaData) == UMC::UMC_OK)
{
if (m_pDstMediaData->GetDataSize() > 0)
{
....
The problem is that m_pDstMediaData is a continous stream, how I can access the NAL split in order to send it over the network. I need to split in NAL with a maximum size of the given MTU. The mode used is the single NAL unit.
I found a h264_split but it's not very how I should use it (if I need to use it)
Thanks for your answers.
I didn't find an accessor in the sample for changing the value of m_MaxSliceSize, so I changed it in the code directly.
My question is the following one:
I use the following code (not optimized for a good understanding)
int nSrcWidth = abs((long) pOutputFormat->bmiHeader.biWidth);
int nSrcHeight = abs((long) pOutputFormat->bmiHeader.biHeight);
// Compared to I420 (YUV) plans are in YV12 (YVU)
LPBYTE pDestY = lpVideoBuffer;
LPBYTE pDestU = pDestY + (nSrcWidth * nSrcHeight);
LPBYTE pDestV = pDestU + ((nSrcWidth * nSrcHeight) / 4);
m_pSrcMediaData->SetPlanePointer(pDestY, 0); // Y
m_pSrcMediaData->SetPlanePointer(pDestU, 1); // U
m_pSrcMediaData->SetPlanePointer(pDestV, 2); // V
m_pDstMediaData->SetBufferPointer(lpCompressedData + sizeof(RTP_INFO_HEADER), lOutDataLen - sizeof(RTP_INFO_HEADER));
if (m_h264VideoEncoder->GetFrame(m_pSrcMediaData, m_pDstMediaData) == UMC::UMC_OK)
{
if (m_pDstMediaData->GetDataSize() > 0)
{
....
The problem is that m_pDstMediaData is a continous stream, how I can access the NAL split in order to send it over the network. I need to split in NAL with a maximum size of the given MTU. The mode used is the single NAL unit.
I found a h264_split but it's not very how I should use it (if I need to use it)
Thanks for your answers.
I found maybe the answer, NAL units are separated by a simple (at least) 4-byte sequence containing a
big-endian 1, i.e. 00 00 00 01. So, by searching them I should be able to send them over the network.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - yann.stephan@gmail.com
I found maybe the answer, NAL units are separated by a simple (at least) 4-byte sequence containing a
big-endian 1, i.e. 00 00 00 01. So, by searching them I should be able to send them over the network.
This is how I did too.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page