Why does the VCU hang when trying to flush multiple times when closing a file?
An empty frame can cause the VCU to flush. If an empty frame occurs as the last frame before the application closes, it could result in 2 flushes, which will cause the VCU to hang.
This is a known issue with the Zynq UltraScale+ MPSoC VCU - LogiCORE H.264/H.265 Video Codec Unit (VCU) that can occur when the application is shutting down and a flush was already issued.
The fixes below will cause the application to issue an exception and close instead of hanging.