Can I do motion estimation before encoding a frame?

I want to do motion estimation before encoding a frame. Can I capture a frame, then do motion estimation on it with ME only mode, then encode it with non-ME mode in the same encode session?

Application during encode session initialization can set NV_ENC_INITIALIZE_PARAMS::enableMEOnlyMode flag to make it ‘ME only’ session. Once session is set as ‘ME only’, same session cannot be used for encoding.

From your question it is not clear how you want to use output of ME only mode and encode session. ME only output cannot be fed directly for encoding. This output need to be converted to external hint format and then passed to encoder.

Hope this helps.


thank you.

In nvEncodeAPI.h, struct _NV_ENC_H264_MV_DATA, a field NV_ENC_MVECTOR mv[4] is defined. The comment is “up to 4 vectors for 8x8 partition”, what does it mean? What is the difference among four vector? Thank you!
I found the resulted motion vector is often very large, such as (-976, 134). Does nvenc use full search? Is there a parameter to control search scope? Field mbCost is a SAD or SATD metric? Thank you!