Can I control playbacking of a video? - General Discussion and Assistance - CHDK Forum

Can I control playbacking of a video?

  • 8 Replies
  • 3455 Views
Can I control playbacking of a video?
« on: 26 / March / 2020, 13:40:26 »
Advertisements
I want to connect my camera to a screen via HDMI and control video recording and playbacking on the screen, as well as photo shooting and opening on the screen.
Is this possible?

*

Offline reyalp

  • ******
  • 14128
Re: Can I control playbacking of a video?
« Reply #1 on: 26 / March / 2020, 22:35:17 »
I want to connect my camera to a screen via HDMI and control video recording and playbacking on the screen, as well as photo shooting and opening on the screen.
Is this possible?
What camera? Of the cameras supported by CHDK, only the EOS M models and G5 X support HDMI output in shooting mode. The other only support HDMI in playback mode.

I'm not clear what you mean by "control video recording and playbacking on the screen"
Don't forget what the H stands for.

Re: Can I control playbacking of a video?
« Reply #2 on: 27 / March / 2020, 05:56:34 »

What camera? Of the cameras supported by CHDK, only the EOS M models and G5 X support HDMI output in shooting mode. The other only support HDMI in playback mode.

I'm not clear what you mean by "control video recording and playbacking on the screen"
I have a SX260HS.
I am looking for (finding or writing) a script that can record a video and after that playback it over HDMI. And if possible also delete it after the playback.

Re: Can I control playbacking of a video?
« Reply #3 on: 27 / March / 2020, 10:59:53 »
I am looking for (finding or writing) a script that can record a video and after that playback it over HDMI. And if possible also delete it after the playback.
It's unlikely you will find an existing script to do exactly that. But off the top of my head it would not be too hard to write one.

It's trivial to initiate video recording in a script.

Liikewise switching to playback mode after you stop recording. 

Getting the script to play the most recent video (assuming HDMI is correctly configured) likely requires faking button presses but that's easy too. It can be tricky to get the sequence robust however.

The file i/o functions available to scripts allow deletion although you'll need a bit of logic to figure out the right filename to remove.

Finally a scripted reboot will probably be needed to sync the Canon firmware to the modified file system.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Can I control playbacking of a video?
« Reply #4 on: 27 / March / 2020, 12:02:51 »
it would not be too hard to write one.

Great!
So the commands that I need for playback are these ? :
set_record 0
click "set"
click "set"
sleep etc.

Finally a scripted reboot will probably be needed to sync the Canon firmware to the modified file system
I guess it's relevant just for deletion but I didn't understand this part. :(

Re: Can I control playbacking of a video?
« Reply #5 on: 27 / March / 2020, 12:14:07 »
So the commands that I need for playback are these ? :
set_record 0
click "set"
click "set"
sleep etc.
That's a good start.

Do you plan to run a script on the camera (launched by chdkptp maybe) or simply issue commands via chdkptp (which can also be scripted on the PC side)?  You mentioned wanting a script but it's not clear where you want it to run and there are several options that might do what you want.

Also, if you are scripting then you will want to use Lua rather than uBASIC.  There are a lot of limitations to what you can do in uBASIC.

For reference :  CHDK Scripting Cross Reference Page

Quote
Finally a scripted reboot will probably be needed to sync the Canon firmware to the modified file system
I guess it's relevant just for deletion but I didn't understand this part. :(
When CHDK deletes a file from the SD card, the Canon firmware may not realize that it has gone.  Caching etc.   So a reboot clears that up.
« Last Edit: 27 / March / 2020, 12:16:42 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: Can I control playbacking of a video?
« Reply #6 on: 27 / March / 2020, 12:19:40 »
FWIW, it might be possible to delete the file using the Canon user interface (after it finished playing).

Re: Can I control playbacking of a video?
« Reply #7 on: 27 / March / 2020, 14:25:42 »
Thank you so much for your comments.
I will go with a running a lua script from the SD (one day I will have a RC car :) )
And skip automatic deleting for now. It sounds too risky.

The only thing that is not clear for me from the tutorials - does CHDK support goto in Lua? If yes what's the correct syntax for it?
« Last Edit: 27 / March / 2020, 14:59:00 by nubicon »

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Can I control playbacking of a video?
« Reply #8 on: 04 / April / 2020, 03:20:37 »
...
The only thing that is not clear for me from the tutorials - does CHDK support goto in Lua? If yes what's the correct syntax for it?
No. CHDK includes an adapted Lua v5.1 version, the goto statement was added in regular Lua v5.2 & is not available in CHDK Lua.

To dive into CHDK Lua you may start from here: https://chdk.fandom.com/wiki/Lua

 

Related Topics


SimplePortal © 2008-2014, SimplePortal