now videostab create a *.avi resource ,but I want to get *.mp4 so how to do? [closed]

asked Nov 7 '16

     if (!outputPath.empty())
    {
        if (!writer.isOpened())
            writer.open(outputPath, VideoWriter::fourcc('X','V','I','D'),
                        outputFps, stabilizedFrame.size());
        writer << stabilizedFrame;
    }
Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-12-17 16:58:26.444632

Comments

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.

Eduardo gravatar imageEduardo (Nov 7 '16)edit

The output video will always be saved in a .avi container, afaik.

LorenaGdL gravatar imageLorenaGdL (Nov 7 '16)edit