Running continuous video recording lua script via chdkptp causes crash - Script Writing - CHDK Forum  

Running continuous video recording lua script via chdkptp causes crash

  • 25 Replies
  • 4107 Views
*

Offline obi

  • *
  • 27
Advertisements
Hi guys,

I am trying to run the lua script#3 from https://chdk.fandom.com/wiki/Continuous_Video_Scripts using chdkptp but having issues running it. The script runs well when I run it without chdkptp after putting the camera into rec mode.

However, when I run it from chdkptp after putting the camera into rec mode, it is not starting the recording. I found out that it is because some function returns true/false instead of 0/1 when the USB is connected. So I fixed that by doing this small change in the script.

$diff vid_ext_orig.lua vid_ext_mod1.lua
19c19
<     if rec and vid and vid_button == 0 then
---
>     if rec and vid and vid_button == false then
23c23
<     elseif rec and vid_button == 1 then
---
>     elseif rec and vid_button == true then

After this change, the script starts the recording (I see the red recording symbol) but the camera crashes immediately with I/O error on the chdkptp CLI. I have tested it on SX230HS. Here is how I ran the script.

> rec                                                                 
> . a=1 b=0 loadfile('A/vid_ext_mod1.lua')()   

ROMLOG is also attached. I am not sure if I am doing something wrong here.

> =return get_buildinfo()
1:return:table:{platform="sx230hs",build_date="Oct  7 2021",build_number="1.5.1",build_time="23:36:31",version="CHDK",platsub="101a",build_revision="6020",digic=40,platformid=12840,os="dryos"}

Also tested on SX260HS and it has the same issue there. Any help would be appreciated.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #1 on: 02 / December / 2021, 12:42:23 »
Never seen that man... :-[
Code: [Select]
ASSERT!! ExMemMan.c Line 1251
Occured Time  2021:12:02 14:53:33
Task ID: 50331656
Task name: MovieRecord
...
00126630: UI:MovieState:0x4 means is recording (0x5 is busy after rec.)
Possible reasons: ptp-lifeview is not set up for lowest resolution 320p.
... or mouse apparently activated wrong switch, ...
My Sx230 has edited lib.c for other reasons I forgot already:
« Last Edit: 02 / December / 2021, 13:01:04 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14080
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #2 on: 02 / December / 2021, 13:23:58 »
However, when I run it from chdkptp after putting the camera into rec mode, it is not starting the recording. I found out that it is because some function returns true/false instead of 0/1 when the USB is connected. So I fixed that by doing this small change in the script.
FWIW, this is because the script is written for CHDK 1.3. You can use CHDK/LUALIB/wrap13.lua for backward compatible behavior (this is what happens if you run a script from the menu that doesn't have @chdk_version > 1.3)
But it's probably better to update the script to current syntax.
Quote
After this change, the script starts the recording (I see the red recording symbol) but the camera crashes immediately with I/O error on the chdkptp CLI. I have tested it on SX230HS. Here is how I ran the script.
Do you get the same crash if you run the script manually on the camera while chdkptp is connected?
How about if you just try to record video while chkdptp is connected?
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
« Last Edit: 02 / December / 2021, 13:47:53 by Caefix »
All lifetime is a loan from eternity.


*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #4 on: 02 / December / 2021, 14:12:32 »
Quote
FWIW, this is because the script is written for CHDK 1.3. You can use CHDK/LUALIB/wrap13.lua for backward compatible behavior (this is what happens if you run a script from the menu that doesn't have @chdk_version > 1.3)
But it's probably better to update the script to current syntax.
Ok. Will take into account that.
Quote
Do you get the same crash if you run the script manually on the camera while chdkptp is connected?
Yes, just tried that. It crashes.
Quote
How about if you just try to record video while chkdptp is connected?
Crashes as well.

I have also updated the chdkptp version but did not help. Using r964.
con> ver
host:2.9 cam:2.9

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #5 on: 02 / December / 2021, 14:30:00 »
Always good to know: size, resolution, light conditions, aspect ratio, ...  8)
« Last Edit: 02 / December / 2021, 14:46:02 by Caefix »
All lifetime is a loan from eternity.

*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #6 on: 02 / December / 2021, 15:17:19 »
Always good to know: size, resolution, light conditions, aspect ratio, ...  8)
I start with FHD, size is L and the aspect ratio is 16:9 (though I think those are only used for still images). I have tested it at all the possible video resolutions and it fails in all the cases. I use AUTO position on the dial. Light conditions are indoors, not so bright.

I also checked if the FPS are correct because some weeks ago I had crashes when wrong FPS value was set for a particular recording pixel setting.
> =return get_prop(171)
5:return:5
> =return get_prop(168)
6:return:1

Just a side question: do you know how can I avoid the LCD display going off when I connect the USB cable to the Camera. I always have to do >connect followed by >rec on the chdkptp prompt.



*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #7 on: 02 / December / 2021, 15:22:23 »
 ;) How behaves mode-dial to video?
All lifetime is a loan from eternity.


*

Offline obi

  • *
  • 27
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #8 on: 02 / December / 2021, 15:49:23 »
;) How behaves mode-dial to video?
Also crashes while connected with chdkptp when I press record button in video mode.

Could it be some other conflicting settings done by chdkptp when I do >rec ?

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Running continuous video recording lua script via chdkptp causes crash
« Reply #9 on: 02 / December / 2021, 16:10:31 »
That moment I found out, that my lib.c is fine, if dial at <P>, TV+? not fitting when cam display set to 16:9.  :blink: (1/2 hight or black borders.)
Continue tomorrow...  :-[
All lifetime is a loan from eternity.

 

Related Topics