I am trying to implement code which decodes small chunks of H264 video, 15 frames at at a time. These chunks of video start with a keyframe and then have a sequence of p-frames after that. I am using NVDec via V4L2. After queuing this data to the output plane, I want to read the output frames from the capture plane before writing the next chunk of data to the output plane.
- If I simply try to dequeue a frame from the capture plane after the chunk of video is queued to the output plane, I get an
EAGAINerror and then the next atttempt to dequeue blocks indefinitely. - If I queue an empty buffer to the output plane after the buffer with the chunk of video, then I am able to read the 15 frames from the capture plane but I don’t know how to restart the decoder to send more video.
- If I call
v4l2_ioctlwithVIDIOC_DECODER_CMDand commandV4L2_DEC_CMD_STOPon the output plane, I don’t get any error but this does not seem to make any difference. (4.5.1. Memory-to-Memory Stateful Video Decoder Interface — The Linux Kernel documentation).
I am running Jetpack 6.1 on an Orin.