Ask Your Question
0

OpenCV 3 + x264 + FFmpeg

asked 2015-12-01 09:46:12 -0600

Greg Kramida gravatar image

I've seen this post here, but I think I'm having a different problem with the said combo. 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 video produced is unreadable. The FFmpeg I have is packaged by ubuntu maintainers, and it lists it was configured with "--enable-libx264". I made a repost here on SO. Any idea how I can make this combination work? Is it an OpenCV bug, FFmpeg bug, or neither?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-12-03 10:51:47 -0600

Greg Kramida gravatar image

updated 2015-12-03 10:52:23 -0600

The problem had nothing to do with the displayed warning. I was trying to write single-channel images, while the VideoWriter was expecting three-channel color images (default value of isColor, the 5-th argument to VideoWriter's constructor, is "true"). The solution was setting isColor to false.

edit flag offensive delete link more

Comments

@Greg Kramida hi did you still working on h264?

whdt gravatar imagewhdt ( 2018-07-31 04:59:01 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-01 09:46:12 -0600

Seen: 9,481 times

Last updated: Dec 03 '15