@b0hr see @JonB real original code
which is the first line of the script linked by your "original code"
You need to use AVCapturePhotoOutput instead of AVCaptureStillImageOutput to get raw output. There are some other changes needed as well, you will have to read the docs or examples that go along with that class.
Oops! Looks like something went wrong!
You may only upload PNG, JPG, or GIF files ()