Forum Archive

Show Webcam Stream in Fullscreen

kami

Hi,

how can i show a webcam stream live on the UI? I have got an ESP32-microcontroller with a RTSP-Stream Server and a Webserver?

Which is the best way to get a fast picture?

Is it possible to set a connection to a wlan accesspoint or should i always use the Settingsmanager from iOS to do this?

Thanks a lot.

Cu kami

cvp

@kami I think it is possible to connect to a WiFi hotspot (see here)
But, Pythonista3 has to be configured for it
Important
To use the NEHotspotConfigurationManager class, you must enable the Hotspot Configuration capability in Xcode.

cvp

For the fun, I've tried this

from objc_util import * 

def handler(_cmd,obj1_ptr):
    if obj1_ptr:
        obj1 = ObjCInstance(obj1_ptr)
        print(obj1)         # error
    return

NEHotspotConfiguration = ObjCClass('NEHotspotConfiguration').alloc()

NEHotspotConfiguration.initWithSSID_passphrase_isWEP_('my_ssid', 'my_pwd', False)
NEHotspotConfiguration.joinOnce = False

NEHotspotConfigurationManager = ObjCClass('NEHotspotConfigurationManager').sharedManager()
handler_block = ObjCBlock(handler, restype=None, argtypes=[c_void_p, c_void_p])
NEHotspotConfigurationManager.applyConfiguration_completionHandler_(NEHotspotConfiguration,handler_block)

But it gives an error

Error Domain=NEHotspotConfigurationErrorDomain Code=8 "internal error." UserInfo={NSLocalizedDescription=internal error.}

Sincerely, I can't help more

kami

Okay thanks. But maybe you can help me with the Video Stream?

Cu kami

cvp

There are RTSP-Stream Python clients, thus you could try
If I had a camera with RTSP-Stream Server , I would try

cvp

Perhaps, in an ui.WebView, Safari supporting WebRtc to stream cameras?

JonB

@kami
Looks like if you can serve HLS, you can show it in an AVPlayerView

https://developer.apple.com/documentation/avfoundation/media_assets_playback_and_editing/using_avfoundation_to_play_and_persist_http_live_streams?language=objc