# Building GStreamer as static for iOS app w/ AWS kvssink plugin

**URL:** https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662
**Category:** Embedded
**Tags:** ios
**Created:** [November 28, 2024, 11:14pm UTC](https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662 "2024-11-28T23:14:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sbelbin](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/sbelbin/32/980_2.png) [@sbelbin](https://discourse.gstreamer.org/u/sbelbin)
#### Post date: [November 28, 2024, 11:14pm UTC](https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662/1 "2024-11-28T23:14:09Z")

</div>

I’m working at a company in which we are building an iOS Swift app that is deployed on modern iPad devices that streams video & audio from the iPad cameras/microphones into the device’s folder & to an AWS Kinesis Video Stream service (using the AWS kvssink GStreamer plugin).

As part developing this iOS app we strive using static libraries over dynamic ones from reasons of security along with some gains in performance.

I’ve got these questions:

- Feedback from anyone that has build an app as GStreamer as static libraries in a production application deployed to many users?

- Are there special caveats/considerations that we need to be aware of for an iOS app?

Something that I’m still mulling over is the fact that this app uses the AWS kvssink GStreamer plugin. At present, it a separate Git repository that we build afterwards since there are dependencies on the GStreamer project.

One idea is to create our fork of the GStreamer Git repository which includes the kvssink as a subproject. Thus when building GStreamer as static library then the kvssink plugin is incorporated alongside the other plugins.

Does someone have a experiences on incorporating their GStreamer plugins being built as a static library incorporated alongside the other plugins?

Thanks,  
Steven

---

<div class="post-metadata">

### Author: ![ystreet00](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/y/3d9bf3/32.png) [@ystreet00](https://discourse.gstreamer.org/u/ystreet00)
#### Post date: [November 29, 2024, 2:07am UTC](https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662/2 "2024-11-29T02:07:58Z")

</div>

The official binaries shipped by the GStreamer project (using Cerbero) support building for iOS and there are example iOS application and tutorials. The rust plugins are shipped as well.

---

<div class="post-metadata">

### Author: ![nirbheek](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/nirbheek/32/206_2.png) [@nirbheek](https://discourse.gstreamer.org/u/nirbheek)
#### Post date: [November 29, 2024, 9:58am UTC](https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662/3 "2024-11-29T09:58:49Z")

</div>

To add to what Matt already said, the official tutorials and examples all use static linking. All this is already supported.

[https://gstreamer.freedesktop.org/documentation/tutorials/ios/index.html?gi-language=c](https://gstreamer.freedesktop.org/documentation/tutorials/ios/index.html?gi-language=c)

[https://gstreamer.freedesktop.org/documentation/installing/for-ios-development.html?gi-language=c](https://gstreamer.freedesktop.org/documentation/installing/for-ios-development.html?gi-language=c)

Since the AWS kvssink plugin is third-party, you should just build it as part of your app, instead of forking gstreamer and building everything.

---

<div class="post-metadata">

### Author: ![sbelbin](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/sbelbin/32/980_2.png) [@sbelbin](https://discourse.gstreamer.org/u/sbelbin)
#### Post date: [November 29, 2024, 8:16pm UTC](https://discourse.gstreamer.org/t/building-gstreamer-as-static-for-ios-app-w-aws-kvssink-plugin/3662/4 "2024-11-29T20:16:07Z")

</div>

On my MacBook Pro, I built the GStreamer as a static library, then built the AWS Kinesis Video Stream plugin (kvssink) as a shared library using the package of the previously built GStreamer.

When performing the `gst-inspect-1.0` a crash occurs.

```auto
me@workstation bin % export DYLD_LIBRARY_PATH=:/usr/local/lib:/Users/me/install/MAC_ARM64/gstreamer/lib:/Users/me/install/MAC_ARM64/aws_kinesis/lib
me@workstation bin bin % export GST_PLUGIN_PATH=:/Users/me/install/MAC_ARM64/gstreamer/lib:/Users/me/install/MAC_ARM64/aws_kinesis/lib                 
me@workstation % ./gst-inspect-1.0                                                                                                                               

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.904: cannot register existing type 'GstObject'

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave_pointer: assertion 'result != 0' failed

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.905: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:42520): GLib-GObject-CRITICAL **: 13:43:55.905: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:42520): GLib-CRITICAL **: 13:43:55.905: g_once_init_leave_pointer: assertion 'result != 0' failed

```

When removing the `/Users/me/install/MAC_ARM64/aws_kinesis/lib` from the `DYLD_LIBRARY_PATH` and `GST_PLUGIN_PATH`, then the `gst-inspect-1.0` tool behaves as expected listing the plugins.

> _Which I gather are those compiled into `libgstreamer-full-1.0.dylib`._

I just what to state that verified that this isn’t a case as mentioned in the **Troubleshooting** section mentionned in `subprojects/gstreamer/docs/random/porting-to-1.0.txt` where there are multiple GStreamer editions. I’ve reviewed that the `kvssink` plugin is compiled and linked using GStreamer package that I just built. Therefor, it matches the executables in the package’s `../gstreamer/bin` folder.

My comprehension of the crash, is that `gst-inspect-1.0` tools is load the plugins using the folder from the `GST_PLUGIN_PATH` but when it gets to `kvssink` plugin after it loaded that plugin dynamically, it attempts to a register function is invoked. However, that block of code is meant to be invoked only once.

I’ll look into this a bit and provide an update on what I discover.
