Jetson Nano Encode Frame by Frame

I’m trying to adjust sample 01_video_encode from the multimedia api support encoding frame by frame.

It seems like the main function initialize the encoder planes and for some reason reads from input file some of the frames.
Afterwards the encoder_proc_blocking function read the rest of the file in a while loop.
I’ve tried not to read anything at first and it got blocked at “dqBuffer” function.
Also, I’ve tried to removed the while loop and replace the read from stream with read from buffer - but it is blocked at waitForDQThread.

Is it possible to initialize the encoder without reading any file?
Is it possible to modify encoder_proc_blocking to support frame by frame encoding?


For encoding (n+1)th frame, encoder needs to keep at least (n)th frame. So you would need to have 2 frames queued to encoder and do initialization. Please try this case.