Open its-saeed opened 2 years ago
Hi, What do you use the flag CGO_ENABLED=0? go-gst needs cgo because of binding gstreamer written in C. Have you setup gstreamer on your devlopment environment?
Thanks for your reply. I think you're right. Whenever I remove CGO_ENABLED following errors start to come up:
# pkg-config --cflags -- gio-2.0 glib-2.0 gobject-2.0 gio-2.0 glib-2.0 gobject-2.0 gio-2.0
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
pkg-config: exit status 1
I'm using golang:1.16.6 image as the image for development environment, Is it possible to install gstreamer there?
Hi, Saeed! All these libraries must be installed on the system. It won't work without them. It's not a mistake. For example this is commands for install it on Ubuntu\Debian os
apt-get install pkg-config
apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-libav```
In order to install gstreamer from source coude, you can refer the guideline below
Thanks for your help. Is it possible to link to GStreamer libraries statically? Do I need to recompile it from the source?
If you built gstreamer, you can see numerous libraries generated in dynamic linking form. It is not only hard to make it but also just time consuming stuff. I think, it is nothing worth if you succeed how to figure out making static linking of gstreamer with your app.
You can install gstreamer in several ways. The most convenient way is to use package manager like apt-get, yum and somethings like that.
Once you properly install gstreamer on your system, your app will look up gstreamer libraries on system path and found.
For example, you need a video player to play movie.mp4 file where movie.mp4 is your app and video player is gstreamer. Likewise, it is nothing worth to integrate a video player into movie.mp4.
Building a project which depends on go-gst with this command:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o main .
results in the following errors: