Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 2185

Reusing MFX session after calling EncodeFrameAsync with NULL surface

$
0
0

Hi,

We're building an application where we would like to use the Intel Quick Sync hardware encoder to encode a discontinuous stream: e.g., we have a video stream for 30 seconds, it drops for 10 seconds, it comes back for 30 seconds, etc...

When the stream drops after 30 seconds, it's likely that there are still frames being encoded so what we would like to do is, once we get an external signal that the stream is gone, flush all frames in the encoder's pipelines. As we understood from the documentation and sample_encode, this can be done by calling EncodeFrameAsync with a NULL surface.

The question now is, when the stream comes back, can we still use the same MFXSession?

We modified the sample_encode source code slightly in such a way that in the main() procedure, pPipeline->Run() is called 3 times in a row. When running it the third time, we get a MFX_ERR_LOCK_MEMORY status from the Direct3D allocator when trying to lock a frame in the Run() procedure.

Does this mean that calling EncodeFrameAsync with a NULL surface sets the MFXSession in some kind of "closing" state after which we always have to close it completely and reinitialize it? The odd thing is then that the error apparently originates from the Direct3D device...

Note that this only occurs when using Direct3D surfaces.

Regards,

Elwood


Viewing all articles
Browse latest Browse all 2185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>