Authors:
Sonni Lorenz F. Cubero (sonni.cubero@proventusnova.com) CJ Mirafuentes (cj.mirafuentes@proventusnova.com) |
Date: March 10, 2025 |
GStreamer Application Development
This page shows how to build gstreamer applications. Gstreamer applications can be built on the following platforms:
- Linux
- Windows
- Android
- iOS
- macOS
Linux
Gstreamer is included in all Linux distributions. We recommend using the latest version of a fast-moving distribution such as Fedora, Ubuntu (non-LTS), Debian or OpenSuse to get a recentg Gstreamer release.
Prerequisites
The following must be present in the Linux system.
Compiler
- GCC
- Clang
Package Manager
Any one of the following will do:
- apt
- dnf
- snap
Linux Build Environment
The Linux build environment was emulated using VMware Workstation 17 Pro with the following specifications:
Operating System: | Ubuntu 24.04.1 LTS |
Processors: | Number of processors: 4
Number of cores per processor: 1 |
Memory: | 8GB |
Storage: | 30GB (Expandable) |
Installing on Ubuntu/Debian
Run the following command:
apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
Note: Make sure you have root access to install.
Installing on Fedora
Run the following command:
dnf install gstreamer1-devel gstreamer1-plugins-base-tools gstreamer1-doc gstreamer1-plugins-base-devel gstreamer1-plugins-good gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel gstreamer1-plugins-bad-free-extras
Note: Make sure you have root access to install.
Building a GStreamer Application
Building GStreamer requires the gcc/clang compiler and a text editor. Run the following command to build an application using GStreamer:
gcc [filename].c -o [output_file] `pkg-config --cflags --libs gstreamer-1.0`
Running a GStreamer Application
To run the application, simply run the following command:
./[application_name]
Windows
Prerequisites
To develop applications using GStreamer for Windows, it is recommended to use Windows 10 or newer (Windows 7 or 8 is also supported), with Microsoft Visual Studio 2019 or newer.
Additionally, the runtime and development installers must be installed. Download Gstreamer
Installing on Windows
Install the GStreamer Runtime and Development Installer. After installing GStreamer runtime and development, add its libraries and plugins to your environment variables.
Follow these steps to add them to your environment variables:
- Open Environment Variables.
- In System Variables, scroll down to the Path variable and click Edit.
- Click New.
- Add the locations for the \bin, \lib, \include, and \gstreamer-1.0 directories.
If you have the 32-bit version installed, add the following paths to your System Variables:
- C:\gstreamer\1.0\msvc_x86\bin
- C:\gstreamer\1.0\msvc_x86\lib
- C:\gstreamer\1.0\msvc_x86\lib\gstreamer-1.0
- C:\gstreamer\1.0\msvc_x86\include
If you have the 64-bit version installed, add the following paths to your System Variables:
- C:\gstreamer\1.0\msvc_x86_64\bin
- C:\gstreamer\1.0\msvc_x86_64\lib
- C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0
- C:\gstreamer\1.0\msvc_x86_64\include
Building and Running a GStreamer Application
This build was done with a 64-bit runtime and development GStreamer.
To build a GStreamer project, follow these steps:
1 .Open Visual Studio.
2. Click Create a new project.
3. Select either Empty Project or Console App.
.4 After selecting your project, set up the libraries and dependencies.
5. In Solution Explorer, right-click on the project and select Properties.
6. Go to C/C++ โ General โ Additional Include Directories โ Click Edit and add the following paths:
C:\gstreamer\1.0\msvc_x86_64\include\glib-2.0 C:\gstreamer\1.0\msvc_x86_64\include\gstreamer-1.0 C:\gstreamer\1.0\msvc_x86_64\include\gstreamer-1.0\gst C:\gstreamer\1.0\msvc_x86_64\include\glib-2.0\glib C:\gstreamer\1.0\msvc_x86_64\lib\glib-2.0\include C:\gstreamer\1.0\msvc_x86_64\include\glib-2.0\ C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0 %(AdditionalIncludeDirectories)
Note: The directories may vary depending on where you installed the GStreamer runtime and development files.
7. Next, go to Linker โ General โ Additional Library Directories โ Click Edit and add the following paths:
C:\gstreamer\1.0\msvc_x86_64\lib C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0 C:\gstreamer\1.0\msvc_x86_64\bin
Note: The directories may vary depending on where you installed the GStreamer runtime and development files.
8. Next, go to Linker โ Input โ Additional Dependencies โ Click Edit and add the following libraries:
gobject-2.0.lib glib-2.0.lib gstreamer-1.0.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib %(AdditionalDependencies)
Note: The directories may vary depending on where you installed the GStreamer runtime and development files.
9. After setting up the Libraries and Dependencies, its time to build the project.
10. In the toolbar, select Debut, then select either x32 or x64, then click the play button.
11. After clicking, the project should build and now you have your first Gstreamer Project!
References
- GStreamer Introduction
- Building GStreamer from Source (Meson & Ninja)
- README.md - GStreamer GitLab
- GStreamer Daemon - RidgeRun
- Building GStreamer Daemon - RidgeRun
- GstInterpipe - RidgeRun Wiki
- Stack Overflow Answer - GStreamer
- Stack Overflow Answer - GStreamer
Frequently Asked Questions (FAQ)
- What is GStreamer?
- GStreamer is an open-source multimedia framework used for creating media-handling components such as audio and video processing applications. It is widely used in media players, streaming applications, and multimedia frameworks.
- How do I install GStreamer on Linux?
- On Ubuntu/Debian, use the following command:
#Ubuntu apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio #Debian dnf install gstreamer1-devel gstreamer1-plugins-base-tools gstreamer1-doc gstreamer1-plugins-base-devel gstreamer1-plugins-good gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel gstreamer1-plugins-bad-free-extras
- How do I install GStreamer on Windows?
- Download the GStreamer Runtime and Development Installer from the official website: GStreamer Download
๐ Customized Technology Solutions for Your Business
Do you need to:
- โ Optimize your embedded systems for performance and reliability?
- โ Integrate cutting-edge AI and computer vision?
- โ Improve real-time multimedia capabilities?
- โ Develop a secure and scalable web platform?
We have a track record of delivering innovative solutions across multiple industries.
๐ฉ Contact us: support@proventusnova.com ๐ Visit us: ProventusNova.com