Saving Uncompressed Video Files using OpenCv, Gstreamer, and/or FFMPEG?

Viewed 44

I have been trying to implement the cv::VideoWriter function from OpenCV to generate a an uncompressed video file. I started this because of a statement within the OpenCV Documentation which I will link here along with the statement.

cv::VideoWriter::VideoWriter    (   const String &  filename,
int     fourcc,
double  fps,
Size    frameSize,
bool    isColor = true 
)       

"If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file."

Ref. https://docs.opencv.org/3.4/dd/d9e/classcv_1_1VideoWriter.html

However whilst troubleshooting the function I came across the refuting statement,

" VideoCapture and VideoWriter do not provide interface to access raw compressed video stream, except maybe MJPEG in some cases. Make sure you actually use FFmpeg backend by setting apiPreference parameter: VideoWriter("outfile.avi", cv2.CAP_FFMPEG, ...)"

Ref. https://github.com/opencv/opencv/issues/14573

I am now confused about how I go about writing the cv::VideoWriter function to satisfy the requirements to create an uncompressed video file (.avi) and if it is even possible. If it is not possible how do I achieve the outcome of saving an raw uncompressed video file, as I assume it would use some combination of FFMPEG, OpenCV,or Gstreamer.

Note: My code is implemented in c++

0 Answers
Related