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.

double rate deinterlacing and timestamps

koby_s_
Beginner
965 Views

Hi

I am trying to double the frame rate of interlaced source (29.97i -> 59.94p).
I found this old post which helped me a lot (I was able to get x2 frame rate) but I am not getting a time stamp on each frame.

I configured frame rate conversion + deinterlacing on a VPP object.

vpp.in.fps = 29.97  (30000 / 10001)
vpp.out.fps = 59.94 ( 60000 / 1001)

// frame rate conversion
MSDK_ZERO_MEMORY(m_FrameRateConversion);
m_FrameRateConversion.Header.BufferId     = MFX_EXTBUFF_VPP_FRAME_RATE_CONVERSION;
m_FrameRateConversion.Header.BufferSz     = sizeof(mfxExtVPPFrameRateConversion);
m_FrameRateConversion.Algorithm         = MFX_FRCALGM_DISTRIBUTED_TIMESTAMP;

// vpp deinterlace - double the input frame rate
MSDK_ZERO_MEMORY(m_VPPDeinterlacer);
m_VPPDeinterlacer.Header.BufferId    = MFX_EXTBUFF_VPP_DEINTERLACING;
m_ExtHEVCParam.Header.BufferSz        = sizeof(mfxExtVPPDeinterlacing);
m_VPPDeinterlacer.Mode                 = MFX_DEINTERLACING_ADVANCED;

I tried the other frame rate convertion algorithms and they all failed to assign correct timestamp to the generated frame.

A sample for the output timestamps that I'm getting is :
(Timestamps units are 90000)

vpp out timestamp = 4425183439
vpp out timestamp = -1
vpp out timestamp = 4425186442
vpp out timestamp = -1
vpp out timestamp = 4425189445
vpp out timestamp = -1
vpp out timestamp = 4425192448
vpp out timestamp = -1
vpp out timestamp = 4425195451

As you can see, the gap between 2 valid timestamps is 3003 which is matching to the source frame rate (29.97).
I would expected them to increase by 1501.5 (59.94 FPS) without having -1 in between.

Is there anyway to assign a valid timestamp to generated frames instead of doing that by myself?

Thank you
koby

0 Kudos
2 Replies
koby_s_
Beginner
965 Views

I just found that the double de-interlacing is working even without adding frame rate conversion parameter to the VPP object but I am still getting invalid time stamps..

0 Kudos
Harshdeep_B_Intel
965 Views

Hi Koby,

I have following scenarios you can try and include in your solution to resolve this issue:

1) You can attached DecodeTimeStamp to mfxbitstream structure where, when MSDK automatically calculates timestamps from SDK encoder from PTS. Please refer to structure Page No.77 in MSDK manual: https://software.intel.com/sites/default/files/mediasdk_release_notes.pdf. You might also be interested in taking a look at this old post: https://software.intel.com/en-us/forums/intel-media-sdk/topic/311726. 

2) "Is there anyway to assign a valid timestamp to generated frames instead of doing that by myself?"-> If above solution is not feasible for your use case, then as I have mentioned on one of the old thread, timestamp handling by MediaSDK is very transparent. I would suggest have the splitter/demuxer manipulate/reshuffle the timestamps. 

Thanks,

0 Kudos
Reply