i have worked on live preview in iOS using Swift 5 and OSC library. But my live preview is too slow. May I know the reason for that and how can i fix it? Also, I want to display the Theta camera battery progress for that is there any method?
Please someone help me to fix that.
Thanks @shrhdk.
I am using “OpenSphericalCamera” library.
So, that library having LivePreviewDelegate class for Live Preview and using UnsafeRawBufferPointer with unsafeBytes.
Something like -
dataBuffer.withUnsafeBytes { (bytes: UnsafeRawBufferPointer) → Void in
while i < dataBuffer.count - 1 {
if JPEG_SOI[0] == bytes[i] && JPEG_SOI[1] == bytes[i + 1] {
soi = i
i += 1
break
}
i += 1
}
while i < dataBuffer.count - 1 {
if JPEG_EOI[0] == bytes[i] && JPEG_EOI[1] == bytes[i + 1] {
i += 1
eoi = i
break
}
i += 1
}
}
guard let start = soi, let end = eoi else {
return
}
So, this is right approach or need to define frame rate
like {“width”: 1920, “height”: 960, “framerate”: 8} *1.