now videostab create a *.avi resource ,but I want to get *.mp4 so how to do? [closed]
if (!outputPath.empty())
{
if (!writer.isOpened())
writer.open(outputPath, VideoWriter::fourcc('X','V','I','D'),
outputFps, stabilizedFrame.size());
writer << stabilizedFrame;
}
See here for the list of fourcc code (so maybe
fourcc('X','2','6','4')
would work).What I usually do is to save the images in an uncompressed format and after use FFmpeg to encode properly with X264 codec.
The output video will always be saved in a .avi container, afaik.