# Is gstreamer disable the setting function of CAP\_PROP\_FOURCC?

**URL:** <https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728>\
**Category:** C++\
**Tags:** gstreamer, videoio\
**Created:** [October 20, 2021, 6:48am UTC](https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728 "2021-10-20T06:48:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HongEn\_Tsai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/hongen_tsai/32/3509_2.png) [@HongEn\_Tsai](https://forum.opencv.org/u/HongEn_Tsai)\
**Post date:** [October 20, 2021, 6:48am UTC](https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728/1 "2021-10-20T06:48:56Z")

</div>

hi sir,  
I have a webcam , its fps in 1280x720 is about 10 .  
As I know that the fps can reach to 30 fps if I change VideoCapture’s input format to MJPG.

I used following code in opencv450 without gstreamer and It works fine, the fps in 1280x720 could be about 30

```auto
int main()
{
    VideoCapture video(0);
    std::cout << "MJPG: " << video.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
    video.set(CAP_PROP_FRAME_WIDTH,1280);
    video.set(CAP_PROP_FRAME_HEIGHT,720);
    cout<<"fps: "<< video.get(CAP_PROP_FPS)<<endl;
    
    Mat frame;
    while (video.isOpened()) {
        video>>frame;
        imshow("frame",frame);
        waitKey(1);
    }
    return 0;
}

```

Now I updated opencv to latest version (4.5.4) and build WITH\_GSTREAMER, and the function

`video.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));`

no longer works . it shows the message:

> [WARN:0] global /media/gino/a278e84d-9197-4f4e-8f2a-3a52677ef946/home/gino/opencv/opencv/modules/videoio/src/cap\_gstreamer.cpp (1390) setProperty OpenCV | GStreamer warning: GStreamer: unhandled property

is that means gstreamer disable the CAP\_PROP\_FOURCC setting function? What should I do to make the correct setting?

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [October 20, 2021, 7:47am UTC](https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728/2 "2021-10-20T07:47:54Z")

</div>

Hi,

There is no such property in [gstreamer binding](https://github.com/LaurentBerger/opencv/blob/master/modules/videoio/src/cap_gstreamer.cpp#L1251-L1397) in opencv

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [October 20, 2021, 8:10am UTC](https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728/3 "2021-10-20T08:10:25Z")

</div>

and [no trace of it in 4.5.0](https://github.com/opencv/opencv/blob/4.5.0/modules/videoio/src/cap_gstreamer.cpp#L1051), either

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [October 20, 2021, 4:47pm UTC](https://forum.opencv.org/t/is-gstreamer-disable-the-setting-function-of-cap-prop-fourcc/5728/4 "2021-10-20T16:47:03Z")

</div>

nothing indicates that your earlier test actually used gstreamer.

explicitly pass an `apiPreference` that is not gstreamer, to avoid using gstreamer.
