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
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.

Problem encoding interlaced videos with h264



I'm having problems to get correctly encoded interlaced videos, I'm using for testing the software encoder with ffmpeg muxing, for progressive videos works fine, but interlaced have artifacts both in vlc and quicktime.

For the encoding:

// declaration in the class

    mfxExtBuffer*             m_EncExtParams[2];
    mfxExtCodingOption         m_mfxCopt;
    mfxExtCodingOptionSPSPPS     m_extSPSPPS;

// interlaced set up

        mfxEncParams.mfx.FrameInfo.PicStruct        = MFX_PICSTRUCT_FIELD_TFF;
        m_EncExtParams[0] = (mfxExtBuffer *)&m_mfxCopt;
        mfxEncParams.NumExtParam = 1;   

If not including m_mfxCopt.FramePicture = MFX_CODINGOPTION_ON  the video has artifacts, that's ok

The problem is, for ffmpeg muxing it needs the SPS/PPS data, so to get it, after the mfxENC->Init(&mfxEncParams):

    m_EncExtParams[1] = (mfxExtBuffer*)&m_extSPSPPS;
    sts = mfxENC->GetVideoParam(&mfxEncParams);

The SPS/PPS data is retieved ok and the encoded video plays in quicktime but it has exactly the same artifacts produced when m_mfxCopt.FramePicture = MFX_CODINGOPTION_ON  is not set.

For testing, if the SPS/PPS data is not retrieved, the video seems to be ok it plays in vlc without artifacts, but of course not in quicktime.

I tried some combinations to set up the mfxExtCodingOptionSPSPPS before the first call to mfxENC->Query(&mfxEncParams, &mfxEncParams) and got error MFX_ERR_INCOMPATIBLE_VIDEO_PARAM

What would be the correct way to set the interlaced parameters and also get the SPS/PPS data?

thanks in advance

0 Kudos
1 Reply

hi,  I managed to get the interlaced encoding ok to h264 stream , it seems it is a ffmpeg mux problem, using the sample_encode for ffmpeg mux I got the same results.

0 Kudos