Showing results for 
Search instead for 
Did you mean: 

double rate deinterlacing and timestamps


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. = 29.97  (30000 / 10001)
vpp.out.fps = 59.94 ( 60000 / 1001)

// frame rate conversion
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
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

0 Kudos
2 Replies

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


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: You might also be interested in taking a look at this old post: 

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.