lvdumpimg -pipebm = oneproc -count = 70 -vp = file.ppm '
Maybe google translate broke something, this command does not make sense to me.
Can we do it from get_frames? and how ?
Thank you in advance for your help
I think get_frames is buggy, maybe a python3 issue. I did not write chdkptp.py and do not maintain it, but maybe you can contact the authors.
>>> frames=cam.get_frames()
>>> frame_ppm=next(frames)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/chdkptp_py/lib/python3.5/site-packages/chdkptp/device.py", line 392, in get_frames
""")(scaled)
File "lupa/_lupa.pyx", line 559, in lupa._lupa._LuaObject.__call__
File "lupa/_lupa.pyx", line 1306, in lupa._lupa.call_lua
File "lupa/_lupa.pyx", line 1328, in lupa._lupa.execute_lua_call
File "lupa/_lupa.pyx", line 1350, in lupa._lupa.unpack_lua_results
File "lupa/_lupa.pyx", line 1117, in lupa._lupa.py_from_lua
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 291: invalid continuation byte
I think it tries to return the ppm as a string, but the string is not valid unicode, because it's image data.
I think lupa lets you set the encoding, but this option is not exposed in chdkptp.py.
You could use the lvdumpimg command from chdkptp.py. This worked for me:
$ python
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chdkptp
>>> cam=chdkptp.ChdkDevice(chdkptp.list_devices()[0])
>>> cam._lua.execute('''
... errutil=require'errutil'
... ustime=require'ustime'
... cli=require'cli'
... ''')
>>> cam._lua.execute('cli:execute("lvdumpimg -vp=${frame}.ppm -bm=${frame}.pam")')