2016-05-27 02:14:38 +00:00
|
|
|
# Installing on Windows
|
|
|
|
|
|
|
|
## Supported platforms
|
|
|
|
|
|
|
|
* Windows 7
|
|
|
|
* Windows 8
|
2016-11-28 13:12:34 +00:00
|
|
|
* Windows 8.1
|
2016-10-09 15:13:23 +00:00
|
|
|
* Windows 10
|
2023-08-24 14:33:27 +00:00
|
|
|
* Windows 11 and newer
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
## Prerequisites
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2023-08-24 14:33:27 +00:00
|
|
|
To develop applications using GStreamer for Windows we recommend using Windows
|
|
|
|
10 or newer with Microsoft Visual Studio 2019 or newer. Older versions of each
|
|
|
|
may also work, but they are not recommended.
|
|
|
|
|
|
|
|
GStreamer package includes C headers (`.h`) and library files (`.lib`) valid
|
|
|
|
for any version of [Microsoft Visual Studio](http://www.microsoft.com/visualstudio).
|
|
|
|
For convenience, property pages (`.props`) are also included which extremely
|
|
|
|
simplify creating new projects.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-06-17 22:21:42 +00:00
|
|
|
## Download and install GStreamer binaries
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-06-17 22:21:42 +00:00
|
|
|
There are 3 sets of files in GStreamer binaries:
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2023-08-24 14:33:27 +00:00
|
|
|
- The runtime files are needed to run GStreamer applications. You probably want
|
|
|
|
to distribute these files with your application (or the installer below).
|
|
|
|
- The development files are **additional** files you need at build-time to
|
|
|
|
create GStreamer applications.
|
|
|
|
- The [Merge Modules](http://msdn.microsoft.com/en-us/library/windows/desktop/aa369820%28v=vs.85%29.aspx)
|
|
|
|
files are **additional** files you can use to deploy GStreamer binaries
|
|
|
|
alongside your application (see [Windows deployment](deploying/windows.md)).
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2021-07-10 06:09:05 +00:00
|
|
|
Get both **the Runtime and Development** installers appropriate for
|
2023-08-24 14:33:27 +00:00
|
|
|
your architecture from the [GStreamer download page](https://gstreamer.freedesktop.org/download/).
|
2021-07-10 06:09:05 +00:00
|
|
|
|
|
|
|
If in doubt, download the 64-bit MSVC packages:
|
|
|
|
- Runtime installer: e.g. `gstreamer-1.0-msvc-x86_64-{VERSION}.msi`
|
|
|
|
- Development files installer: e.g. `gstreamer-1.0-devel-msvc-x86_64-{VERSION}.msi`
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2016-05-16 14:30:34 +00:00
|
|
|
Execute the installers and choose an installation folder. The suggested
|
|
|
|
default is usually OK.
|
|
|
|
|
2018-11-11 15:49:19 +00:00
|
|
|
> ![Warning](images/icons/emoticons/warning.svg)
|
2019-01-24 20:10:22 +00:00
|
|
|
> If you plan to use Visual Studio, **close it before installing GStreamer**.
|
|
|
|
> The installer will define new environment variables which will not be picked up by Visual Studio if it is open.
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2019-01-24 20:10:22 +00:00
|
|
|
> On **Windows 8** and **Windows 10**, it might be necessary to log out and log back in to your account
|
|
|
|
> after the installation for the newly defined environment variables to be picked up by Visual Studio.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
It is the application's responsibility to ensure that, at runtime,
|
|
|
|
GStreamer can access its libraries and plugins. It can be done by adding
|
2019-01-24 20:10:22 +00:00
|
|
|
`%GSTREAMER_ROOT_X86%\bin` to the `PATH` environment variable, or
|
2016-05-16 14:30:34 +00:00
|
|
|
by running the application from this same folder.
|
|
|
|
|
2021-07-10 06:09:05 +00:00
|
|
|
How to do this:
|
|
|
|
Windows start icon > Search "environment variables" > Edit the system environment variables (will open System Properties)
|
|
|
|
> Environment Variables > System variables > Variable :Path > Edit > New > Paste "C:\gstreamer\1.0\msvc_x86_64\bin" > OK
|
|
|
|
|
2019-01-24 20:10:22 +00:00
|
|
|
At runtime, GStreamer will look for its plugins in the following folders:
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
- `%HOMEDRIVE%%HOMEFOLDER%/.gstreamer-1.0/plugins`
|
|
|
|
- `C:\gstreamer\1.0\x86\lib\gstreamer-1.0`
|
2023-08-24 14:33:27 +00:00
|
|
|
- `<location of gstreamer-1.0-0.dll>\..\lib\gstreamer-1.0`
|
2016-05-16 14:30:34 +00:00
|
|
|
- `%GST_PLUGIN_PATH%`
|
|
|
|
|
2023-08-24 14:33:27 +00:00
|
|
|
So, typically, if your application can find `gstreamer-1.0-0.dll`,
|
2016-05-16 14:30:34 +00:00
|
|
|
it will find the GStreamer plugins, as long as the installation folder
|
|
|
|
structure is unmodified. If you do change this structure in your
|
2019-01-24 20:10:22 +00:00
|
|
|
application, then you can use the `GST_PLUGIN_PATH` environment
|
2016-05-16 14:30:34 +00:00
|
|
|
variable to point GStreamer to its plugins. The plugins are initially
|
2016-06-17 22:21:42 +00:00
|
|
|
found at `%GSTREAMER_ROOT_X86%\lib\gstreamer-1.0`.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
Additionally, if you want to prevent GStreamer from looking in all the
|
2019-01-24 20:10:22 +00:00
|
|
|
default folders listed above, you can set the `GST_PLUGIN_SYSTEM_PATH`
|
|
|
|
environment variable to point where the plugins are located.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
## Configure your development environment
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2023-08-24 14:33:27 +00:00
|
|
|
**NOTE: these instructions are out of date, exercise caution while following them**
|
|
|
|
|
2016-05-16 14:30:34 +00:00
|
|
|
### Building the tutorials
|
|
|
|
|
2016-10-25 20:16:42 +00:00
|
|
|
The tutorials code, along with project files and a solution file for
|
|
|
|
Visual Studio 2010, are in the
|
2022-09-06 07:53:51 +00:00
|
|
|
[gst-docs](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-docs) in the
|
2016-11-05 08:18:49 +00:00
|
|
|
`examples/tutorials` folder.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
In order to prevent accidental modification of the original code, and to
|
|
|
|
make sure Visual Studio has the necessary permissions to write the
|
2016-05-16 16:23:12 +00:00
|
|
|
output files, copy the entire `tutorials` folder to a place of your
|
2016-05-16 14:30:34 +00:00
|
|
|
liking, and work from there.
|
|
|
|
|
2018-11-11 15:49:19 +00:00
|
|
|
> ![Information](images/icons/emoticons/information.svg)
|
2016-05-16 16:23:12 +00:00
|
|
|
> **64-bit Users**
|
|
|
|
>
|
2019-01-24 20:10:22 +00:00
|
|
|
> Use the `GSTREAMER_ROOT_X86_64` environment variable if you have installed GStreamer binaries for 64-bit platforms.
|
|
|
|
> Both GStreamer packages (32 and 64-bit) can be installed simultaneously, hence the separate environment variables.
|
2016-05-16 16:23:12 +00:00
|
|
|
>
|
2019-01-24 20:10:22 +00:00
|
|
|
> Make sure you select the Solution Configuration that matches GStreamer that you have installed: `Win32` for 32-bit or `x64` for 64-bit.
|
2016-05-16 16:23:12 +00:00
|
|
|
>
|
2016-11-05 08:18:49 +00:00
|
|
|
> ![Windows Install Configuration](images/WindowsInstall-Configuration.png)
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2019-01-24 20:10:22 +00:00
|
|
|
You can launch Visual Studio 2010 and load your copy of the
|
|
|
|
`tutorials.sln` solution file (Click on the screen shots to enlarge them).
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2016-11-05 08:18:49 +00:00
|
|
|
![](images/WindowsInstall2.png)
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2016-11-05 08:18:49 +00:00
|
|
|
![](images/WindowsInstall1.png)
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2016-05-16 14:30:34 +00:00
|
|
|
Hit **F7**, press the Build Solution button
|
2016-11-05 08:18:49 +00:00
|
|
|
![](images/WindowsInstall-BuildSolution.png) or go to Build →
|
2016-05-16 16:23:12 +00:00
|
|
|
Build Solution. All projects should build without problems.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
### Running the tutorials
|
|
|
|
|
|
|
|
In order to run the tutorials, we will set the current working directory
|
2019-01-24 20:10:22 +00:00
|
|
|
to `%GSTREAMER_ROOT_X86%\bin` in the Debugging section of the
|
2016-05-16 14:30:34 +00:00
|
|
|
project properties. **This property is not stored in the project files,
|
|
|
|
so you will need to manually add it to every tutorial you want to run
|
2016-05-16 16:23:12 +00:00
|
|
|
from within Visual Studio**. Right click on a project in the Solution
|
2016-05-16 14:30:34 +00:00
|
|
|
Explorer, Properties → Debugging → Working Directory, and type
|
2019-01-24 20:10:22 +00:00
|
|
|
`$(GSTREAMER_ROOT_X86)\bin`.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
(The `$(...)` notation is required to access environment variables
|
2019-01-24 20:10:22 +00:00
|
|
|
from within Visual Studio property pages. You use the `%...%` notation in Windows
|
|
|
|
Explorer and in CMD scripts.)
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
You should now be able to run the tutorials.
|
|
|
|
|
|
|
|
### Creating new projects manually
|
|
|
|
|
|
|
|
**If you want to create 64-bit applications, remember also to create x64
|
|
|
|
Solution and Project configurations as
|
2016-05-16 16:23:12 +00:00
|
|
|
explained [here](http://msdn.microsoft.com/en-us/library/9yb4317s\(v=vs.100\).aspx).**
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2016-06-17 22:21:42 +00:00
|
|
|
#### Include the necessary GStreamer Property Sheet
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
The included property sheets make creating new projects extremely easy.
|
|
|
|
In Visual Studio 2010 create a new project (Normally a `Win32
|
2016-05-16 16:23:12 +00:00
|
|
|
Console` or `Win32 Application`). Then go to the Property Manager
|
2016-05-16 14:30:34 +00:00
|
|
|
(View→Property Manager), right-click on your project and select “Add
|
2018-07-23 16:56:10 +00:00
|
|
|
Existing Property Sheet...”.
|
|
|
|
|
|
|
|
> In Visual Studio 2017, the property manager can be found in
|
|
|
|
> View→Other Windows→Property Manager
|
|
|
|
|
2019-01-24 20:10:22 +00:00
|
|
|
Navigate to `%GSTREAMER_ROOT_X86%\share\vs\2010\libs` and load `gstreamer-1.0.props`.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
This property sheet contains the directories where the headers and
|
|
|
|
libraries are located, and the necessary options for the compiler and
|
|
|
|
linker, so you do not need to change anything else in your project.
|
2016-05-27 02:14:38 +00:00
|
|
|
|
2016-05-16 14:30:34 +00:00
|
|
|
If you cannot find the Property Manager, you might need to enable Expert
|
|
|
|
Settings. Go to Tools → Settings → Expert Settings. Upon first
|
|
|
|
installation of Visual Studio, Expert Settings are disabled by
|
2016-05-16 16:23:12 +00:00
|
|
|
default.
|
|
|
|
|
2016-11-05 08:18:49 +00:00
|
|
|
![](images/WindowsInstall10.png)
|
2016-05-16 14:30:34 +00:00
|
|
|
|
2018-11-11 15:49:19 +00:00
|
|
|
> ![Warning](images/icons/emoticons/warning.svg)
|
2019-01-24 20:10:22 +00:00
|
|
|
> **Depending on the GStreamer libraries you need to use, you will have to add more property pages,
|
|
|
|
> besides `gstreamer-1.0`** (each property page corresponds to one GStreamer library).
|
2016-05-16 16:23:12 +00:00
|
|
|
>
|
2019-01-24 20:10:22 +00:00
|
|
|
> The tutorial's project files already contain all necessary property pages. When developing your own applications,
|
|
|
|
> the GStreamer documentation will tell you what library a function belongs to, and therefore, what property pages you need to add.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
#### Remove the dependency with the Visual Studio runtime
|
|
|
|
|
|
|
|
At this point, you have a working environment, which you can test by
|
|
|
|
running the tutorials. However, there is a last step remaining.
|
|
|
|
|
|
|
|
Applications built with Visual C++ 2010 depend on the Visual C++ 2010
|
|
|
|
Runtime, which is a DLL that gets installed when you install Visual
|
|
|
|
Studio. If you were to distribute your application, you would need to
|
2019-01-24 20:10:22 +00:00
|
|
|
distribute this DLL with it (e.g. via the [Visual C++ 2010 Redistributable
|
2016-05-16 14:30:34 +00:00
|
|
|
Package](http://www.microsoft.com/download/en/details.aspx?id=5555)).
|
|
|
|
This happens with every version of Visual Studio, and the Runtime DLL is
|
|
|
|
different for every version of Visual Studio.
|
|
|
|
|
|
|
|
Furthermore, GStreamer itself is built using a “basic” C runtime which
|
|
|
|
comes in every Windows system since Windows XP, and is named
|
|
|
|
`MSVCRT.DLL`. If your application and GStreamer do not use the same C
|
|
|
|
Runtime, problems are bound to crop out.
|
|
|
|
|
|
|
|
In order to avoid these issues you must instruct your application to use
|
|
|
|
the system's C Runtime. First install the [Windows Device Driver Kit
|
2016-05-16 16:23:12 +00:00
|
|
|
Version 7.1.0](http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11800) (DDK).
|
2016-05-16 14:30:34 +00:00
|
|
|
When the installer asks about the features, select only “Build
|
|
|
|
Environments”. Accept the suggested location for the installation, which
|
2016-05-16 16:23:12 +00:00
|
|
|
is usually `C:\WinDDK\7600.16385.1`. This download is an ISO file, you
|
2016-05-16 14:30:34 +00:00
|
|
|
can either burn a DVD with it (as recommended in the Microsoft site. You
|
|
|
|
will need DVD burning software), mount the file in a virtual DVD device
|
|
|
|
(you will need DVD virtualization software) or unpack the file as if it
|
|
|
|
was a regular compressed file (you will need decompression software that
|
|
|
|
understands the ISO format).
|
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
Then, add the `x86.props` or `x86_64.props` (for 32 or 64 bits) property
|
2019-01-24 20:10:22 +00:00
|
|
|
sheet found in `%GSTREAMER_ROOT_X86%\share\vs\2010\msvc` to your
|
2016-05-16 14:30:34 +00:00
|
|
|
project. This will make your application use the ubiquitous
|
2019-01-24 20:10:22 +00:00
|
|
|
`MSVCRT.DLL` saving you from some troubles in the future.
|
2016-05-16 16:23:12 +00:00
|
|
|
|
2018-11-11 15:49:19 +00:00
|
|
|
> ![Information](images/icons/emoticons/information.svg)
|
2019-01-24 20:10:22 +00:00
|
|
|
> If you did not install the WinDDK to the standard path `C:\WinDDK\7600.16385.1`,
|
|
|
|
> you will need to tell Visual Studio where it is. Unfortunately, there is no automated way to do this.
|
|
|
|
> Once you have added the `x86.props` or `x86_64.props` to your project, go to the Property Manager,
|
|
|
|
> expand your project and its subfolders until you find the property sheet called `config`.
|
|
|
|
> Double click to edit it, and select the section called “User Macros” in the list on the left.
|
|
|
|
> You should see a macro called `WINDOWS_DRIVER_KIT`. Double click to edit it, and set its value to
|
|
|
|
> the root folder where you installed the DDK. This is the folder containing a file called `samples.txt`.
|
2016-05-16 16:23:12 +00:00
|
|
|
>
|
2019-01-24 20:10:22 +00:00
|
|
|
> That's it. Accept the changes, right click on the `config` property sheet and select “Save”.
|
|
|
|
> The path to the DDK is now stored in `config.props` and you do not need to perform this operation anymore.
|
2016-05-16 14:30:34 +00:00
|
|
|
|
|
|
|
### Creating new projects using the wizard
|
|
|
|
|
2016-05-16 16:23:12 +00:00
|
|
|
Go to File → New → Project… and you should find a template
|
2016-06-17 22:21:42 +00:00
|
|
|
named **GStreamer Project**. It takes no parameters, and sets all
|
2016-05-16 14:30:34 +00:00
|
|
|
necessary project settings, both for 32 and 64 bits architectures.
|
|
|
|
|
|
|
|
The generated project file includes the two required Property Sheets
|
|
|
|
described in the previous section, so, in order to link to the correct
|
|
|
|
`MSVCRT.DLL`, **you still need to install the Windows Device Driver
|
2016-05-27 02:14:38 +00:00
|
|
|
Kit** and change the appropriate property sheets.
|