Get Video Data Post-Compression Pre-Writing

Hello,

I have a video stream that I’m compressing and writing to a video file. Is there a way to get the data post-compression but prior to writing the video file? Or is ffmpeg compressing and then writing without any opencv hooks in between?