Writing x264 from OpenCV 3 with FFmpeg on Linux
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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: cv::VideoWriter writer(output_path.string(), CV_FOURCC('X','2','6','4'), 60, frame_size); Output: OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x00000021/'!???' The resulting video is extremely small (byte-wise) and unreadable. Setting the four_cc to -1 results in "unknown tag"