Page 1 of 1

Perform action when certain timestamp is reached

Posted: 27 Jun 2022 18:33
by mips12
Hi!

I'd like to the ability to run some code when the timestamp of a file has been reached (i.e. trigger an alert)

How can this be achieved?

I was looking at this https://www.geeksforgeeks.org/python-vl ... edia-time/

However, I feel like I'm really looking for some kind of daemon (i.e. start the media file with VLC and then have this "listener" perform an action when timestamp on vlc has been reached)

What direction may I be pointed to to achieve this? Thanks!

Re: Perform action when certain timestamp is reached

Posted: 20 Jul 2022 16:48
by emcodem
You can for example start vlc with -I http and periodically check status.xml if the time you are looking for has passed.

Re: Perform action when certain timestamp is reached

Posted: 02 Aug 2022 10:55
by Krilya
Hey mips12,
If I understood you well;

def function():
current_time = media_player.get_time()
time_stamp = str(dt.timedelta(0, 0, 0, current_time))
if time_stamp == "0:05:02": # or whatever time
# Function

create a thread for this function.

Re: Perform action when certain timestamp is reached

Posted: 30 Aug 2022 14:57
by jereboss7
Hi !

I had a script developed by a company last year that was designed to do just that! It was for a project of a multimedia terminal at the entrance of a supermarket which had to launch an application at a precise moment of the video.

However, in order to negotiate the price of the development of this script, we did not take the rights to it. But if you want to contact the company in question to ask them, it was them: https://amj74-informatique.fr/

It's a French company but they speak very good English. Tell them you are interested in the script that was developed for the Leclerc stores in France.

Hoping to have helped you ;)

Re: Perform action when certain timestamp is reached

Posted: 15 Sep 2022 11:05
by emcodem
Or just ask for help with your script here, including your code and a description of the problem you face :D