Gstreamer Opencv backend doesn't support this codec acutally [closed]

asked 2018-09-07 01:56:08 -0600

tengfei han gravatar image
 OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open, file /home/htf/Downloads/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp, line 505
    Qt has caught an exception thrown from an event handler. Throwing
    exceptions from an event handler is not supported in Qt. You must
    reimplement QApplication::notify() and catch all exceptions there.

    terminate called after throwing an instance of 'cv::Exception'
      what():  /home/htf/Downloads/opencv-2.4.9/modules/highgui/src/cap_gstreamer.cpp:505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally. in function CvVideoWriter_GStreamer::open

    Aborted (core dumped)

this is a part of my code

 PCL_VideoWriter.open(FileName.toAscii().data(),CV_FOURCC('M','P','4','2'),FPS,cv::Size(640,480));
        //        MainTimer->start(viewer_thr->loop_time);





  if(SLAM_IMG_Capture_flag == 1)
    {
        FileName.clear();
        FileName =  "Video/"+CurrDateText+"-"+CurrTimeText+"-SLAM"+".avi";
        SLAM_VideoWriter.open(FileName.toAscii().data(),CV_FOURCC('M','P','4','2'),30,SLAM_IMG.size());
    }

if(Raw_IMG_Capture_flag == 1)
{
    FileName.clear();
    FileName =  "Video/"+CurrDateText+"-"+CurrTimeText+"-RAW"+".avi";
    RAW_VideoWriter.open(FileName.toAscii().data(),CV_FOURCC('M','P','4','2'),30,RAW_IMG.size());
}

I am new to OpenCV, does anyone know how to fix this problem? little clues would be appreciated

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-20 09:06:55.064915

Comments

opencv 2.4.9 is stone age. please use soomething more modern.

berak gravatar imageberak ( 2018-09-07 02:14:21 -0600 )edit

@berak, if I updated my OpenCV's version, this problem would be disappeared.it that right ?

tengfei han gravatar imagetengfei han ( 2018-09-07 02:17:25 -0600 )edit

no, not nessecarily. but it's a good idea to do so anyway.

(and recent versions have improved methods to control the backend used for this)

try with another codec, like XVID

berak gravatar imageberak ( 2018-09-07 02:20:32 -0600 )edit

I followed your instructions, but this problem still exists.

tengfei han gravatar imagetengfei han ( 2018-09-07 02:59:29 -0600 )edit