https://github.com/qengineering/gstreamer-1.18.4-rpi_32-bits
GStreamer 1.18.4 with OpenCV example on a Raspberry Pi 32-bits
https://github.com/qengineering/gstreamer-1.18.4-rpi_32-bits
cpp gstreamer gstreamer-pipeline opencv raspberry-pi raspberry-pi-camera raspicam rpicamsrc
Last synced: 7 months ago
JSON representation
GStreamer 1.18.4 with OpenCV example on a Raspberry Pi 32-bits
- Host: GitHub
- URL: https://github.com/qengineering/gstreamer-1.18.4-rpi_32-bits
- Owner: Qengineering
- License: bsd-3-clause
- Created: 2021-06-02T11:24:44.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-07T11:45:08.000Z (over 4 years ago)
- Last Synced: 2025-02-01T12:44:04.332Z (over 1 year ago)
- Topics: cpp, gstreamer, gstreamer-pipeline, opencv, raspberry-pi, raspberry-pi-camera, raspicam, rpicamsrc
- Language: C++
- Homepage: https://qengineering.eu/install-gstreamer-1.18-on-raspberry-pi-4.html
- Size: 19.5 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GStreamer-1.18.4-RPi_32-bits

## GStreamer + OpenCV on a Raspberry Pi 4 32-bits
[](https://opensource.org/licenses/BSD-3-Clause)
An working example of the GStreame 1.18.4 with the new rpicamsrc source.
Please note, it only works on a Raspberry Pi with an 32-bits OS.
If you have an 64-bits OS see https://github.com/Qengineering/GStreamer-1.18.4-RPi_64-bits
------------
## Dependencies.
To run the application, you have to:
- A Raspberry Pi 4 with a **32-bits** operating system.
- GStreamer 1.18.4 installed. [Install GStreamer](https://qengineering.eu/install-gstreamer-1.18-on-raspberry-pi-4.html)
- OpenCV bit installed. [Install OpenCV 4.5](https://qengineering.eu/install-opencv-4.5-on-raspberry-pi-4.html)
- Code::Blocks installed. (```$ sudo apt-get install codeblocks```)
- A working Raspicam
------------
## Installing the app.
To extract and run the app in Code::Blocks
$ mkdir *MyDir*
$ cd *MyDir*
$ wget https://github.com/Qengineering/GStreamer-1.18.4-RPi_32-bits/archive/refs/heads/main.zip
$ unzip -j master.zip
Remove master.zip, LICENSE and README.md as they are no longer needed.
$ rm master.zip
$ rm LICENSE
$ rm README.md
Your *MyDir* folder must now look like this:
GStreamerTest32.cpb
main.cpp
------------
## Running the app.
To run the application load the project file GStreamerTest32.cbp in Code::Blocks.
Next, follow the instructions at [Hands-On](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html#HandsOn).
------------
## Frame rate.
The Raspicam supports many sizes and frame rates, as you can see [here](https://www.raspberrypi.org/documentation/raspbian/applications/camera.md).
You can switch between the different options by altering the parameters in the pipeline.
As long it's a valid combination, it will work. For instance:
```
//pipeline parameters
int capture_width = 640 ;
int capture_height = 480 ;
int display_width = 640 ;
int display_height = 480 ;
int framerate = 90 ;
```

Since the developer of the rpicamsrc, Jan Schmidt aka [thaytan](https://github.com/thaytan/gst-rpicamsrc), took the raspivid parameters as best they could, many can now be used in the pipeline. An example;
```
"rpicamsrc exposure-mode=off shutter-speed=50 preview=false ! "
"video/x-raw, width=(int)" + std::to_string(capture_width) + ", height=(int)" + std::to_string(capture_height) + ", framerate=(fraction)" + std::to_string(framerate) +"/1 !"
" videoscale ! video/x-raw,"
" width=(int)" + std::to_string(display_width) + ","
" height=(int)" + std::to_string(display_height) + " ! "
" videoconvert ! video/x-raw, format=(string)BGR ! appsink";
```
For more info see [rpicamsrc](https://gstreamer.freedesktop.org/documentation/rpicamsrc/index.html?gi-language=c)
------------
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CPZTM5BB3FCYL)