Building a gstreamer based SwiftUI iOS app to stream RTSP feeds

How to build SwiftUI iOS apps powered by gstreamer — part 1

Raktim Bora
2 min readJun 19, 2023

Before we start, code lives here

I have been in awe of gstreamer ever since I discovered it. This summer, I was fiddling with Swift and SwiftUI and I wanted to do a little fun side project that combined those pieces of tech. The idea was — the title must have given it away — an iOS app that I can use to stream my personal IP cameras over RTSP. I have so far used gstreamer using C/C++ as well as it’s Python bindings. Question was, can I make it play nice with Swift in iOS?

The problems were not far away

The gstreamer website has packages for iOS and macOS. So, that solved 50% of what I wanted to achieve.

But when i looked at the tutorial sections about installing and using those packages, to my horror, I found they were all written in Objective-C. Also they used UIKit as the rendering framework and I really wanted to use SwiftUI.

I’m not an iOS dev and I have safely navigated my “tinkerings” so far without having to learn the older UIKit framework.

So i faced my demons and spent a few weeks studying Objective-C (it’s syntax is the most obscure one I have learnt till date!) and UIKit and then the tutorials to understand how to use gstreamer in iOS. Then i figured out a way to do the same in native Swift and SwiftUI (and without using…

--

--

Raktim Bora

Currently building camhero.app. I explain concepts on AI, Deep Learning, Computer Vision, Python, C++ with an easy hands-on and intuitive style