Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video codec for H264 with opencv

I am trying to create a movie using opencv and I need that output file be in H264 format.

I used the following fourcc in opencv, but I am getting error that suitable codec is not installed.

fourcc=CV_FOURCC('H','2','6','4') ;

When I run my application I get the following error message:

Could not find encoder for codec id 28: Encoder not found

What do I need to be able to use this codec in OpenCV?

like image 960
mans Avatar asked Jun 10 '13 12:06

mans


1 Answers

H264 is not a codec, but rather a standard, while for example x264 is an encoder that implements the H264 standard (CV_FOURCC('X','2','6','4') ;).

OpenCV can write videos using FFMPEG or VFW. You need to compile FFPMEG with x264-support (instructions can be found on FFMPEG's website)

If you are using VFW: Take a look at http://sourceforge.net/projects/x264vfw/

like image 136
kamjagin Avatar answered Sep 21 '22 14:09

kamjagin