I\'m having trouble writing h264 video with OpenCV 3 via FFmpeg (\"\'X\',\'2\',\'6\',\'4\'\" FOURCC). I\'ve seen all the related posts so far on SO, but nothing helps. Code:
The problem on OpenCV which message is:
OpenCV: FFMPEG: tag 0x34363248/'H264' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x00000021/'!???'
It is produced by definitions of CV_FOURCC('H','2','6','4') this value do not corresponds with the value defined on isom.c
{ AV_CODEC_ID_H264 , 0x21 }
Then defining fourcc as 0x21 cv::VideoWriter works smooth,
cv::VideoWriter VF;
VF.open(filename,0x21,fps,frameSize,true);
as Jameson comments above,
"I decided to use 0x21 directly into VideoWriter.open(). That generates a valid and interpretable video file."