Frame-Align Annotations

You can post here general questions about Advene in english.

Frame-Align Annotations

Post by Hugo » Tue Jul 06, 2010 5:40 pm

Hi there,

I am using this great tool in a project where I have to annotate at frame level. I've searched through the user guide and the other wikis, but could not find the right technique (I am sure there is one) to accomplish my task somehow comfortable...

What I am doing right now:
* Watch the movie till there is something to annotate
* Create an one-frame-long annotation (using ctrl+up the ensure 1/25 of a second for the length)
* Open the edit dialog of the just created annotation -> Begin and End is set to something like "00:00:09.845" -> "00:00:09.885"
* Frame-align these numbers to "00:00:09.840" -> "00:00:09.880" (since all my videos are @ 25FPS these milliseconds correspond to frames)
* Check if I correctly hit the frames I wanted by viewing the "Update Begin/End" Dialog of the annotation

Is there something in Advene that could help me "frame-align" my annotation times? Realign the current time position to a frame when hit pause on the player?
I am using Advene 0.42 @ Win7 with gstreamer as player (VLC does not allow me to navigate by 1/25 of a second - jumps around when I try).

Thanks for your help!
Posts: 1
Joined: Tue Jul 06, 2010 5:30 pm

Re: Frame-Align Annotations

Post by oaubert » Wed Jul 07, 2010 2:53 pm


The frame issue is tricky to get correctly. However, the solution you mention (have the user specify a FPS, then align all annotation bounds to the nearest frame time) is easily be achievable in Advene. I will think about a way to integrate it in a simple way, but in the meantime, you can use the Advene python evaluator (menu View/Evaluator), and evaluate the following expression:

[ a.fragment.setBegin(a.fragment.begin / 25 * 25) for a in p.annotations ]

to round the annotation begin time to the nearest frame start (the / 25 * 25 works because / on integers produces an integer division in python). If you want 1-frame long annotations, you can use

[ a.fragment.setEnd(1000 / 25 + a.fragment.begin / 25 * 25) for a in p.annotations ]

to set the end time accordingly.

But I think that in the general case, we should round the begin time to the nearest frame start time, and the annotation end time to the end-time-containing frame end time. Any opinion on this?

Site Admin
Posts: 88
Joined: Mon Jan 07, 2008 4:02 pm

Return to English questions