Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3056 Discussions

Problems with insertion of SEI messages (H.264) into the bitstream

marina_golovkina
Beginner
1,011 Views
Hello,

I try to insert SEI messages (H.264) into the bitstream. I open the output encoded stream with Tektronix MTS4EA Video ES Analyser. But it reports error: End of NAL unit reached while reading RESERVED_SEI_MESSAGE_PAYLOAD_BYTE. I attached screenshot. Below I wrote an example of code as I insert SEI messages. What do I do incorrectly?


mfxSession mfx_session;
mfxIMPL impl = MFX_IMPL_HARDWARE_ANY;
mfxVersion version = {0, 1};
mfxVideoParam mfx_enc_params;
mfxFrameSurface1 pSurface;
mfxSyncPoint EncSyncP;
mfxBitstream mfxBS;

MFXInit(impl, &version, &mfx_session);

// filling of mfx_enc_params structure
mfx_set->mfx.CodecId = MFX_CODEC_AVC;
...

MFXVideoENCODE_Init(mfx_session, &mfx_enc_params);

//initialization of pSurface and mfxBS
...

// SEI message

mfxEncodeCtrl mfxEncCtrl = {0};

unsigned char text[] = "MainConcept";

mfxPayload * p_payload[256];
mfxPayload p;

p.Data = text;
p.BufSize = sizeof(text);
p.NumBit = sizeof(text) * 8;
p.Type = 5; //user_data_unregistered

mfxEncCtrl.Payload = p_payload;
mfxEncCtrl.Payload[0] = &p;
mfxEncCtrl.NumPayload = 1;

MFXVideoENCODE_EncodeFrameAsync(mfx_session, &mfxEncCtrl, pSurface, &mfxBS, &EncSyncP);

//writing encoded data to file...



Thanks,
Marina
0 Kudos
2 Replies
Petter_L_Intel
Employee
1,011 Views
Hi Marina,

Please see the following forum post for how to insert SEI message into H.264 stream.
http://software.intel.com/en-us/forums/showthread.php?t=101849&o=a&s=lr

Hope this helps.
Regards,
Petter
0 Kudos
marina_golovkina
Beginner
1,011 Views
Hi Petter,

Thank you for reply. I corrected my code as in your example. Now SEI messages are inserted without problem.

Best regards,
Marina
0 Kudos
Reply