Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: signy13 on May 01, 2020, 08:19:37 AM

Title: How to get timestamp of current position?
Post by: signy13 on May 01, 2020, 08:19:37 AM
Is there any way to get a timestamp of current position in video file in Tinypy?
I know how to get timestamp of markerA
adm = Avidemux()
ts = int(adm.markerA / 1000)

so I can set markerA to current position (in GUI) and then run a script which uses timestamp of the markerA, but in this case I have to change markerA for running the script.
I would like to get timestamp of current position and use it in the script without changing markers.
Title: Re: How to get timestamp of current position?
Post by: eumagga0x2a on May 01, 2020, 09:28:19 AM
adm = Avidemux()
cur = adm.getCurrentPts()


The current frame PTS is stored in cur then. You need a very recent nightly for that.
Title: Re: How to get timestamp of current position?
Post by: signy13 on May 01, 2020, 01:57:46 PM
Thank you for your info, now I can see why I was not able to find this information anywhere else.
I tried avidemuxUniversal_amd64_200430_74.app and it did not working.
I tried compile it (Ubuntu 18.04) and it is ot working as well.
In both cases it returnes:
Exception: (_tp_dict_get) KeyError: getCurrentPts
BackTrack:
File: py2bc.py line 53
Title: Re: How to get timestamp of current position?
Post by: eumagga0x2a on May 01, 2020, 02:42:29 PM
Oops, sorry, it is in the Editor() class, so

ed = Editor()
cur = ed.getCurrentPts()


should work.
Title: Re: How to get timestamp of current position?
Post by: signy13 on May 01, 2020, 03:27:42 PM
Nice, it is working, thank you very much :-)