VideoWriter_IntelMFX: Written file is not playable

Whilst I have not tried this myself the documentation

Where fourcc can be one of MPG2, H264, X264, AVC , H265 or HEVC

would imply this, which is why it doesn’t make sense for the output file to have a .mp4 extension. I am supprised that you had to change the output file name to “.h264” instead of simply changing the extension from “.mp4” to “.h264” once the file was written. I guess internally OpenCV is adding something to the file when you specify a “.mp4” extension.