• yukia10

    I restarted my iPad mini and it runs OK now.
    Thank you very much for all of your help.

    posted in Pythonista read more
  • yukia10

    Thank you very much for checking my code.

    @JonB Pythonista 3.2 on iPad mini 5. This code says:

    Pythonista version 3.2 (320000) running Python 3.6.1 on iOS 12.3.1 on a 64-bit iPad11,1 with a screen size of (1024 x 768) * 2
    

    .encoding is:

    >>> _device.setActiveVideoMinFrameDuration_.encoding
    b'v40@0:8{?=qiIq}16'
    

    @cvp I assume 3/30 = 10 FPS. It gave the same error without the line dur.value *= 3.

    This error may be specific on iPad mini.

    posted in Pythonista read more
  • yukia10

    Thank you very much for all of your advices. I still have no luck.

    I ran the following code:

    from ctypes import *
    from objc_util import *
    
    class CMTime(Structure):
      _fields_ = [('value', c_int64), ('timescale', c_int32), ('flags', c_uint32), ('epoch', c_int64)]
    
    AVCaptureDevice = ObjCClass('AVCaptureDevice')
    
    _device = AVCaptureDevice.defaultDeviceWithDeviceType_mediaType_position_(
      'AVCaptureDeviceTypeBuiltInWideAngleCamera', 'vide', 1)
    
    dur = _device.activeVideoMinFrameDuration(restype=CMTime, argtypes=[])
    dur.value *= 3
    _device.lockForConfiguration_(None)
    _device.setActiveVideoMinFrameDuration_(dur, restype=None, argtypes=[CMTime])
    _device.unlockForConfiguration()
    

    And I got error:

    Traceback (most recent call last):
      File "/private/var/mobile/Containers/Shared/AppGroup/94D43082-190D-4454-9A0E-256D7C4B8046/Pythonista3/Documents/test.py", line 15, in <module>
        _device.setActiveVideoMinFrameDuration_(dur, restype=None, argtypes=[CMTime])
      File "/var/containers/Bundle/Application/F1D3A05F-66E7-4AD5-8569-D61994DF7737/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 897, in __call__
        res = objc_msgSend(obj.ptr, sel(self.sel_name), *args)
    ctypes.ArgumentError: argument 3: <class 'TypeError'>: expected __Structure instance instead of CMTime
    

    activeVideoMinFrameDuration is a property. Is there any way to specify argument types of a setter?

    posted in Pythonista read more
  • yukia10

    Hello forum members. Will you tell me how to set activeVideoMinFrameDuration?

    I tried the following code:

    from objc_util import *
    
    AVCaptureDevice = ObjCClass('AVCaptureDevice')
    
    _device = AVCaptureDevice.defaultDeviceWithDeviceType_mediaType_position_(
      'AVCaptureDeviceTypeBuiltInWideAngleCamera', 'vide', 1)
    
    dur = _device.activeVideoMinFrameDuration()
    dur.a *= 3
    _device.setActiveVideoMinFrameDuration(dur)
    

    I got error:

    Traceback (most recent call last):
      File "/var/mobile/Containers/Shared/AppGroup/94D43082-190D-4454-9A0E-256D7C4B8046/Pythonista3/Documents/test.py", line 10, in <module>
        _device.setActiveVideoMinFrameDuration(dur)
      File "/var/containers/Bundle/Application/F1D3A05F-66E7-4AD5-8569-D61994DF7737/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 803, in __call__
        return method(*ordered_args, **kw)
      File "/var/containers/Bundle/Application/F1D3A05F-66E7-4AD5-8569-D61994DF7737/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 897, in __call__
        res = objc_msgSend(obj.ptr, sel(self.sel_name), *args)
    ctypes.ArgumentError: argument 3: <class 'TypeError'>: expected __Structure instance instead of __Structure
    

    I have read the following topic: https://forum.omz-software.com/topic/2031/videos, but I have had no success so far.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!