I know H.264 is under GPL license and opencv-python doesn't support H264 encoding.
And I've already found some closed issue about H264 like below.
https://github.com/skvark/opencv-python/issues/299
https://github.com/skvark/opencv-python/issues/100
Here is my question, how about using OpenH264 which is not under GPL license instead of x264?
I couldn't find any answer toward this way so far.
So, If there is any solution for using OpenH264 and make h264 encoding for cv2.VideoWriter effective.
Thank you.
failed log
Could not find encoder for codec id 27: Encoder not found
code
import cv2
fourcc = cv2.VideoWriter_fourcc(*'H264')
video_out = cv2.VideoWriter('test.mp4', int(fourcc), 25.0, (640, 480))
system environment
OS: Ubuntu 16.4,
Opencv: 3.4.1
Not planning to add any additional dependencies on top of the existings ones. Compile FFmpeg and OpenCV manually if you really need the encoding support through OpenCV.
Is there any way to change the codec in cv2.imencode?
I think by default it is using mjpeg codec, so is there any way to change it to H.264 encoding?
Because I am not seeing any such param. in opencv/modules/imgcodecs/src/loadsave.cpp and opencv/modules/imgcodecs/include/opencv2/imgcodecs.hpp
bool imencode( const String& ext, InputArray _image,
std::vector<uchar>& buf, const std::vector<int>& params )