Call Function in every Frame

Discuss your Lua playlist, album art and interface scripts.
Ultralon
New Cone
New Cone
Posts: 3
Joined: 01 Aug 2020 14:37

Call Function in every Frame

Postby Ultralon » 01 Aug 2020 17:07

Hi I´m Tobi fom Mainz in Germany,

To introduce myself:
Normaly I do 2D and 3D Animation for television but at the Moment I tempory lost my Job (German Kurzarbeit) and so I have a lot of time which I want to use for a small personal scripting Project. I did Action Script long ago ... very long :D

I started 8 hours ago with lua and VLC and I think this is the Platform for my little Project. I want to create a script which is looping the beginning of the video till a Hotkey (Spacebar) is pressed, then finishing the loop and continue the Video (normal playback and no loop anymore).

I read a lot about Hotkeys and it seams to be a big problem to solve this in Lua. So I think I will hack this with this Code

Code: Select all

if vlc.playlist.status()=="paused" then -- play -- set Variable KeyWasHit to 1
So I think I can use the Spacebar as a Hotkey

But I have a big Problem with calling a specific function when a specific Timecode is reached
Is it possible to call a Function on every Frame to check if the End of the loop (Timecode) is reached?

I only found the While Function but, as far as I know programming-Loops are not what is needed here cause they call the Function a lot to often.

Please excuse me for being such a big noob but I really started just today

Thanks for your time :)

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Call Function in every Frame

Postby mederi » 02 Aug 2020 14:04

Probably only some interface script looping like in Time https://addons.videolan.org/p/1154032/

Ultralon
New Cone
New Cone
Posts: 3
Joined: 01 Aug 2020 14:37

Re: Call Function in every Frame

Postby Ultralon » 04 Aug 2020 07:45

good Idea!

The Loop Function Seams to be stored in a Intf Lua file.

Are the lua Files in the intf folder have other features - is there a Help on this topic?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Call Function in every Frame

Postby mederi » 04 Aug 2020 14:32


Ultralon
New Cone
New Cone
Posts: 3
Joined: 01 Aug 2020 14:37

Re: Call Function in every Frame

Postby Ultralon » 05 Aug 2020 10:01

Ah yeah :D
You are completly right - Read the --please stay polite-- Manual.

The Problem is that this is taking a lot of time and I have to do a lot of other Tasks (Create Content for Example) so I desided to create a Lua job on upwork. If noone reacts I can still try to create the plugin myself. You are all very invited to grab for the job:
https://www.upwork.com/jobs/~01509cf87501280442


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 12 guests