GroundSDK / vmeta-extract: precise start time for video frame timestamps?

Hello,

I would like to synchronize a video recorded by an Anafi UKR with the position logs.
To do this, I installed groundsdk-tools and extracted the video metadata using vmeta-extract.

I have access to the following information:

  • the time when the drone was powered on,
  • the time when the video recording started,
  • for each frame, the elapsed time since the beginning of the recording (though I’m not entirely sure what the exact unit is).

My goal is to compute the exact timestamp for each frame.
In theory, I could calculate:

recording_start_time + frame_elapsed_time

However, the recording start time is only given in the hh:mm:ss format.
I don’t know whether the recording actually starts at hh:mm:ss.00.

So my questions are:

  • Is the recording start time known with finer resolution than one second?
  • If so, where can this more accurate timestamp be found (e.g., in the video metadata or GroundSDK tools)?

Hello,

Can you specify what you are calling “position logs”?

You can extract synchronized information about the drone location in each frame metadata with vmeta extract to ensure synchronization. (See the json output)
Is this a solution to your issue?

Hello,

I was indeed able to extract this information using vmeta-extract, which gives me the drone’s GPS position for each image.
However, I don’t have the exact timestamp for when each image was captured—only the elapsed time since the start of the recording, which is only given in the hh:mm:ss format.
But I need the precise capture time (=hh:mm:ss.xx) in order to synchronize the drone’s position with the positions of other drones.

There is an UTC timestamp (in us since the Epoch) (described here libvideo-metadata/proto/vmeta.proto at master · Parrot-Developers/libvideo-metadata · GitHub) in the frame metadata.
It should be available if your drone has a GPS connection.

Thanks for your reply.

I just realized that it was from an Anafi USA that I was able to extract video metadata, including the GPS position (though still without the UTC timestamp).

However, with an Anafi UKR, when I run:

./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <video_path>

the only information I get is the serial number.

Could this be due to an outdated version of vmeta-extract?
Or is there some configuration or additional step required to extract metadata on this model?

Hello,
The UTC timestamp was not available for Anafi USA, but you should be able to get it with Anafi UKR.

You should update your groundsdk-tools repository to be sure to have Anafi UKR metadata.

The UTC metadata is not available without the GPS, you probably need to make the recording outside to get proper GPS data. To be sure the GPS is available you can test with freeflight (the icon should be green if the GPS is available).

Hi,
Thanks again for the detailed explanation.

I’ve installed groundsdk-tools by following the steps described here: developer.parrot. com/docs/groundsdk-tools/installation.html.

However, it seems the version I installed isn’t the latest one, as I’m still unable to read the metadata.

What’s the proper way to update my groundsdk-tools repository?

The documentation in Installation - 7.7 should work.

Can you verify you have this commit? [INTEGRATION] Ground SDK Tools 8.3 · Parrot-Developers/groundsdk-tools-manifest@88277ce · GitHub
If not, $ repo sync should update your repository properly
If you do, you can try removing the out directory before rebuilding vmeta-extract

WIth

cd .repo/manifests
git log --oneline | head

I got

88277ce [INTEGRATION] Ground SDK Tools 8.3
011d0d1 [INTEGRATION] Ground SDK Tools 8.2
562bf05 [INTEGRATION] GroundSDK Tools 7.7
67bbc1b [INTEGRATION] Update EULA to version 3.0
a429227 [INTEGRATION] GroundSDK Tools 7.5
8e231e8 [INTEGRATION] GroundSDK Tools 7.4
b1dcc35 [INTEGRATION] GroundSDK Tools 7.3 (full)
cc28b27 [INTEGRATION] GroundSDK Tools 7.3
acb7646 [INTEGRATION] Add EULA
68101c5 [DEV] Initial commit (to be patched)

So I do have the right commit. I guess the issue is the rebuilding of vmeta-extract.
I did remove the out directory. Then, I ran

./build.sh -p groundsdk-linux -t build -j/1

But I still cannot extract metadata with

./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <path_th_mp4>

Is it the right way to build vmeta-extract? If it can help, in groundsdk-tolls/products, I only have groundsdk/linux. Am I supposed to extract https:// github. com/Parrot-Developers/libvideo-metadata somewhere?

./build.sh -p groundsdk-linux -t build -j/1
Should work, if you only want to build vmeta-extract,
./build.sh -p groundsdk-linux -A vmeta-extract -j/1 does the same

libvideo-metadata should be in ./packages/libvideo-metadata already

When you do

./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <path_th_mp4>

  1. do you have an error or is it that some metadata are missing?
  2. Is the out.json generated ?
  3. Do you have an output starting with:
vmeta-extract - Parrot Drones video metadata extractor tool
Copyright (c) 2016 Parrot Drones SAS
duration: X.XXs
friendly_name: Anafi3-MIL-000XXX
maker: Parrot
model: ANAFI UKR

Can you try with:

ULOG_STDERR=y ./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <path_th_mp4>

I confirm that libvideo-metadata is in ./packages/libvideo-metadata.

When I run,

./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <path_to_mp4>

I get

vmeta-extract - Parrot Drones video metadata extractor tool
Copyright (c) 2016 Parrot Drones SAS
duration: 227.50s
serial_number: Lav*******
Done!

The out.json is generated and contains
{
“session”:{
“serial_number”:“Lav*****”
}
}

Finally, ULOG_STDERR=y ./out/groundsdk-linux/staging/native-wrapper.sh vmeta-extract --pretty --json out.json <path_th_mp4> does not add anything, I get the same output as without ULOG_STDERR=y.

Hello,

Does the serial number filed start with “Lavf…”? In that case it indicates that the video was (re)processed by ffmpeg and then Parrot’s metadata will not be present any more. The MP4 file must come directly from the drone’s memory without any modification.

Hello,
Thank you for your reply, this is indeed the explanation for my issue. I am actually able to extract the metadata from the raw video, frame by frame.