RasPi Camera: GStreamer-1.0 w/ Windows 7. Then update the Pi to download dependencies for. (apt-get install netcat) and then on your windows machine. Getting GStreamer How do I get GStreamer? Generally speaking, you have three options, ranging from easy to hard: binary packages for Windows, macOS, iOS and Android.
Supported platforms
- Windows 7
- Windows 8
- Windows 8.1
- Windows 10
Prerequisites
To develop applications using GStreamer for Windows we recommend usingWindows 7or later. Windows Vista may also work but it is not supported.
GStreamer package includes C headers (
.h
) and library files (.lib
)valid for any version of Microsoft VisualStudio. For convenience,property pages (.props
) are also included which extremely simplifycreating new projects. These property pages, though, only work withMicrosoft VisualStudio 2010and newer (including the free Visual C++ Expressedition).
The recommended system isWindows 7 or newerwith Microsoft VisualStudio 2010or newer. Take a look at its systemrequirements).
Installing GStreamer for 32-bit platforms requires approximately 286MB offree disk space for the runtime and 207MB for the development files (as of some older version).
Installing GStreamer for 64-bits platforms requires up to approximately 350MB offree disk space for the runtime and 400MB for the development files (as of version 1.15.1).
Download and install GStreamer binaries
There are 3 sets of files in GStreamer binaries:
- The runtime files are needed to run GStreamer applications. Youprobably want to distribute these files with your application (orthe installer below).
- The development files are additional files you need to createGStreamer applications.
- The MergeModulesfiles are additional files you can use to deploy GStreamer binariesalongside your application (see Windowsdeployment).
Get the Runtime and Development files installers appropriate foryour architecture from here:
Execute the installers and choose an installation folder. The suggesteddefault is usually OK.
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.
On Windows 8 and Windows 10, it might be necessary to log out and log back in to your accountafter the installation for the newly defined environment variables to be picked up by Visual Studio.
It is the application's responsibility to ensure that, at runtime,GStreamer can access its libraries and plugins. It can be done by adding
%GSTREAMER_ROOT_X86%bin
to the PATH
environment variable, orby running the application from this same folder.
At runtime, GStreamer will look for its plugins in the following folders:
%HOMEDRIVE%%HOMEFOLDER%/.gstreamer-1.0/plugins
C:gstreamer1.0x86libgstreamer-1.0
<location of libgstreamer-1.0-0.dll>..libgstreamer-1.0
%GST_PLUGIN_PATH%
So, typically, if your application can find
libgstreamer-1.0-0.dll
,it will find the GStreamer plugins, as long as the installation folderstructure is unmodified. If you do change this structure in yourapplication, then you can use the GST_PLUGIN_PATH
environmentvariable to point GStreamer to its plugins. The plugins are initiallyfound at %GSTREAMER_ROOT_X86%libgstreamer-1.0
.
Additionally, if you want to prevent GStreamer from looking in all thedefault folders listed above, you can set the
GST_PLUGIN_SYSTEM_PATH
environment variable to point where the plugins are located.
Configure your development environment
Building the tutorials
The tutorials code, along with project files and a solution file forVisual Studio 2010, are in thegst-docs in the
examples/tutorials
folder.
In order to prevent accidental modification of the original code, and tomake sure Visual Studio has the necessary permissions to write theoutput files, copy the entire
tutorials
folder to a place of yourliking, and work from there.
64-bit Users
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.
Make sure you select the Solution Configuration that matches GStreamer that you have installed:
Win32
for 32-bit or x64
for 64-bit.
You can launch Visual Studio 2010 and load your copy of the
tutorials.sln
solution file (Click on the screen shots to enlarge them).
Hit F7, press the Build Solution button or go to Build →Build Solution. All projects should build without problems.
Running the tutorials
In order to run the tutorials, we will set the current working directoryto
%GSTREAMER_ROOT_X86%bin
in the Debugging section of theproject properties. This property is not stored in the project files,so you will need to manually add it to every tutorial you want to runfrom within Visual Studio. Right click on a project in the SolutionExplorer, Properties → Debugging → Working Directory, and type$(GSTREAMER_ROOT_X86)bin
.
(The
$(...)
notation is required to access environment variablesfrom within Visual Studio property pages. You use the %...%
notation in WindowsExplorer and in CMD scripts.)
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 x64Solution and Project configurations asexplained here.
Include the necessary GStreamer Property Sheet
The included property sheets make creating new projects extremely easy.In Visual Studio 2010 create a new project (Normally a
Win32 Console
or Win32 Application
). Then go to the Property Manager(View→Property Manager), right-click on your project and select “AddExisting Property Sheet...”.
In Visual Studio 2017, the property manager can be found inView→Other Windows→Property Manager
Navigate to
%GSTREAMER_ROOT_X86%sharevs2010libs
and load gstreamer-1.0.props
.
This property sheet contains the directories where the headers andlibraries are located, and the necessary options for the compiler andlinker, so you do not need to change anything else in your project.
If you cannot find the Property Manager, you might need to enable ExpertSettings. Go to Tools → Settings → Expert Settings. Upon firstinstallation of Visual Studio, Expert Settings are disabled bydefault.
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).
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.
Remove the dependency with the Visual Studio runtime
At this point, you have a working environment, which you can test byrunning the tutorials. However, there is a last step remaining.
Applications built with Visual C++ 2010 depend on the Visual C++ 2010Runtime, which is a DLL that gets installed when you install VisualStudio. If you were to distribute your application, you would need todistribute this DLL with it (e.g. via the Visual C++ 2010 RedistributablePackage).This happens with every version of Visual Studio, and the Runtime DLL isdifferent for every version of Visual Studio.
Furthermore, GStreamer itself is built using a “basic” C runtime whichcomes in every Windows system since Windows XP, and is named
MSVCRT.DLL
. If your application and GStreamer do not use the same CRuntime, problems are bound to crop out.
In order to avoid these issues you must instruct your application to usethe system's C Runtime. First install the Windows Device Driver KitVersion 7.1.0 (DDK).When the installer asks about the features, select only “BuildEnvironments”. Accept the suggested location for the installation, whichis usually
C:WinDDK7600.16385.1
. This download is an ISO file, youcan either burn a DVD with it (as recommended in the Microsoft site. Youwill need DVD burning software), mount the file in a virtual DVD device(you will need DVD virtualization software) or unpack the file as if itwas a regular compressed file (you will need decompression software thatunderstands the ISO format).
Then, add the
x86.props
or x86_64.props
(for 32 or 64 bits) propertysheet found in %GSTREAMER_ROOT_X86%sharevs2010msvc
to yourproject. This will make your application use the ubiquitousMSVCRT.DLL
saving you from some troubles in the future.
If you did not install the WinDDK to the standard path
C:WinDDK7600.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 tothe root folder where you installed the DDK. This is the folder containing a file called samples.txt
.
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.
Creating new projects using the wizard
Go to File → New → Project… and you should find a templatenamed GStreamer Project. It takes no parameters, and sets allnecessary project settings, both for 32 and 64 bits architectures.
The generated project file includes the two required Property Sheetsdescribed in the previous section, so, in order to link to the correct
MSVCRT.DLL
, you still need to install the Windows Device DriverKit and change the appropriate property sheets.