<div dir="ltr"><div>Hello everyone,</div><div>I'm experimenting with a decoding video stream on one thread and processing those frames in the second thread.</div><div>In the decoding thread for each frame, I allocate a new AVFrame and after receiving the decoded frames with avcodec_receive_frame I put them in a mutexed queue, I do this in a loop and sleep if the queue is full.</div><div>The processing thread continuously grabs AVFrames from the mutexed queue, processes them, and only sleeps if the queue is empty.</div><div><br></div><div>This works completely fine as long as I use software decoding, but if I change the whole thing into any HW accelerated backend (doesn't matter if its DXVA2 or VAAPI) and receive any HW frames it fails and constantly prints various errors like this:</div><div><br></div><div>avcodec_send_packet: "Invalid data found when processing input"<br>[AVHWFramesContext @ 000001ca9afb9e80] Static surface pool size exceeded.<br>[h264 @ 000001ca9ae7d9c0] get_buffer() failed<br>[h264 @ 000001ca9ae7d9c0] thread_get_buffer() failed<br>[h264 @ 000001ca9ae7d9c0] decode_slice_header error<br>[h264 @ 000001ca9ae7d9c0] no frame!</div><div><br></div><div>Why is this happening? Is my approach even legal for this use? Did I miss something in the documentation?</div><div><br></div><div>Thank you for your help,</div><div>Nikita<br></div><div><br></div></div>