- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We're trying to add closed caption data using the media SDK by attaching "mfxPayload" buffer to each frame, after calling "MFXVideoENCODE_EncodeFrameAsync" then "MFXVideoCORE_SyncOperation" method return a "MFX_ERR_UNKNOWN" error.
So could you please tell us how to send the closed caption data using the mfx encoder.
Regards.
We're trying to add closed caption data using the media SDK by attaching "mfxPayload" buffer to each frame, after calling "MFXVideoENCODE_EncodeFrameAsync" then "MFXVideoCORE_SyncOperation" method return a "MFX_ERR_UNKNOWN" error.
So could you please tell us how to send the closed caption data using the mfx encoder.
Regards.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Abdellatif
Do you encode into H.264 or MPEG2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using the H.264 encoder.
I'm using the H.264 encoder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Abdellatif,
sorry for the late response. I'm assuming you are trying to insert the SEI messageuser_data_registered_itu_t_t35 into the stream to carry the closed captioning information?
If so, then using mfxPayload is the correct approach. Please see below for an example on how to insert custom SEI messages:
Regards,
sorry for the late response. I'm assuming you are trying to insert the SEI messageuser_data_registered_itu_t_t35 into the stream to carry the closed captioning information?
If so, then using mfxPayload is the correct approach. Please see below for an example on how to insert custom SEI messages:
[cpp]#define SEI_USER_DATA_REGISTERED_ITU_T_T35 4 typedef struct { unsigned char countryCode; unsigned char countryCodeExtension; unsigned char payloadBytes[2]; // In this example only two bytes of data } userdata_reg_t35; mfxEncodeCtrl m_encodeCtrl; mfxPayload m_mySEIPayload; mfxU8 m_seiData[100]; mfxPayload* m_payloads[5]; userdata_reg_t35 m_userSEIData; // Insert SEI_USER_DATA_REGISTERED_ITU_T_T35 into payload m_userSEIData.countryCode = 10; m_userSEIData.countryCodeExtension = 11; m_userSEIData.payloadBytes[0] = 1; m_userSEIData.payloadBytes[1] = 2; MSDK_ZERO_MEMORY(m_mySEIPayload); m_mySEIPayload.Type = SEI_USER_DATA_REGISTERED_ITU_T_T35; m_mySEIPayload.BufSize = sizeof(userdata_reg_t35) + 2; // 2 bytes for header m_mySEIPayload.NumBit = 4*8 + 2*8; // data + header m_mySEIPayload.Data = m_seiData; // SEI header m_seiData[0] = (mfxU8)m_mySEIPayload.Type; m_seiData[1] = (mfxU8)((m_mySEIPayload.NumBit - 16) >> 3); // size of following SEI message in bytes // SEI message memcpy(m_seiData+2, &m_userSEIData, sizeof(userdata_reg_t35)); m_payloads[0] = &m_mySEIPayload; // Encode control structure initialization MSDK_ZERO_MEMORY(m_encodeCtrl); m_encodeCtrl.Payload = (mfxPayload**)&m_payloads[0]; m_encodeCtrl.NumPayload = 1; // Use encode control structure while calling encode sts = m_pmfxENC->EncodeFrameAsync(&m_pEncodeCtrl, &m_pEncSurfaces[nEncSurfIdx], &pCurrentTask->mfxBS, &pCurrentTask->EncSyncP);[/cpp]
Regards,
Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter,
Thank you for your code example, it was very helpful. I'm now able to add closed caption data.
Regards,
Abdellatif
Thank you for your code example, it was very helpful. I'm now able to add closed caption data.
Regards,
Abdellatif
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