# Overlay log data in post processing video

**URL:** <https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857>\
**Category:** General Discussion\
**Created:** [August 28, 2019, 5:25am UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857 "2019-08-28T05:25:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![VMartini](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/vmartini/32/4529_2.png) [@VMartini](https://discuss.bluerobotics.com/u/VMartini)\
**Post date:** [August 28, 2019, 5:25am UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/1 "2019-08-28T05:25:38Z")

</div>

Hi there!

I need to hardcode a logged telemetry data to a video overlay, and I was wondering if anyone has already done that before.

I was thinking about creating a subtitle file and use some video editor or VLC, but I’m not sure it’s the best idea.

Any suggestion?

cheers

— VMartini.

---

<div class="post-metadata">

**Author:** ![Boko](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/boko/32/7241_2.png) [@Boko](https://discuss.bluerobotics.com/u/Boko)\
**Post date:** [August 28, 2019, 8:06am UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/2 "2019-08-28T08:06:37Z")

</div>

Hi!  
There is a solution in the pipeline.  
Temporary solution with daily builds:

> <https://github.com/mavlink/qgroundcontrol/pull/7482>
>
> This patch allows QGC to record a data overlay while recording the video. This i…s implemented by producing an independent subtitle file for use with each video that is recorded to file. The subtitle file is a text file in the \[SubStation Alpha\](https://en.wikipedia.org/wiki/SubStation\_Alpha) format. This is supported by your usual media players, where you can control if the overlay is displayed on playback, or optionally combine the video and subtitle file and export a single video file with the subtitles 'burned in'.
> 
> This patch will close #7286. No additional UI elements or user configuration/options are introduced. The values that will be recorded are the same as those that are selected for display in the vehicle values widget (telemetry display). Telemetry values are sampled and recorded at a fixed 1Hz. The file is produced automatically.
> 
> The result looks like this:
> 
> !\[Screenshot from 2019-05-30 10-12-21\](https://user-images.githubusercontent.com/4013804/58635207-adf10c00-82c3-11e9-9889-e713be845642.png)
> 
> The data rate is about 1kb/s. In a test with FHD video, 3 hours of footage took 8.5GB of disk, with a 7.4MB subtitle file.

Bo

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [August 28, 2019, 1:27pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/3 "2019-08-28T13:27:46Z")

</div>

Hey Vagner,

That pull request does that, but the subtitles are recorded live, it is not generated in post-processing. You could write a script to parse the .tlog or .bin file and generate it the same way.

It can be played live with some players such as VLC or burned into the video using ffmpeg or similar.

---

<div class="post-metadata">

**Author:** ![VMartini](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/vmartini/32/4529_2.png) [@VMartini](https://discuss.bluerobotics.com/u/VMartini)\
**Post date:** [August 29, 2019, 4:19am UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/4 "2019-08-29T04:19:23Z")

</div>

Hi Willian,

I have extracted the information I needed on .tlog (using the Mission Planner and converting to a CSV file) and saved in a .SSA file.

Following your suggestion, now I can burn it to the video with ffmpeg (and I can also include a logo picture).

Thanks again!

— Vagner

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [August 29, 2019, 1:30pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/5 "2019-08-29T13:30:56Z")

</div>

Hi Vagner!

That is great!  
Would you mind sharing a picture/video of the final result?

If you are willing to share your script, we could help improve it and host it at [ardusub.com](http://ardusub.com)

---

<div class="post-metadata">

**Author:** ![VMartini](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/vmartini/32/4529_2.png) [@VMartini](https://discuss.bluerobotics.com/u/VMartini)\
**Post date:** [August 29, 2019, 2:37pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/6 "2019-08-29T14:37:18Z")

</div>

Hi Willian,

In fact there wasn’t any script involved, I did it all by hand, converting .tlog to CSV, then gathering the parameters I needed (date, time, depth and heading) and saving them to a subtitle file.

The final result was better than I expected, and the script is definitely in my “to do list”.

 ![Snapshot](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/4/4855f05a15733f1a1e313a9e0e6119258abe4bdd.jpeg)

---

<div class="post-metadata">

**Author:** ![sigane17](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sigane17/32/3979_2.png) [@sigane17](https://discuss.bluerobotics.com/u/sigane17)\
**Post date:** [September 4, 2019, 2:30pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/7 "2019-09-04T14:30:21Z")

</div>

Fantastic, how did you insert logo and subtitle position

---

<div class="post-metadata">

**Author:** ![VMartini](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/vmartini/32/4529_2.png) [@VMartini](https://discuss.bluerobotics.com/u/VMartini)\
**Post date:** [September 5, 2019, 1:06am UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/8 "2019-09-05T01:06:10Z")

</div>

Hi @sigane17,

In this case, I had to process in two steps, one for the logo, and the other to hardcode the subtitle.  
I did it using **ffmpeg** , following @williangalvani suggestion, the subtitles were edited manually with the data gathered from .tlog file and saved to a .SSA subtitle file.

As everything was post processed twice, it took a long time to reencode all the videos.

---

<div class="post-metadata">

**Author:** ![sigane17](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/sigane17/32/3979_2.png) [@sigane17](https://discuss.bluerobotics.com/u/sigane17)\
**Post date:** [September 10, 2019, 1:42pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/9 "2019-09-10T13:42:21Z")

</div>

I managed to insert the logo with mmpeg and it’s fantastic. I used Mission Planner and converted .tlog to csv. But I have great difficulty in extracting the I needed parameters (date, time, depth and heading)

---

<div class="post-metadata">

**Author:** ![VMartini](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/vmartini/32/4529_2.png) [@VMartini](https://discuss.bluerobotics.com/u/VMartini)\
**Post date:** [September 10, 2019, 6:47pm UTC](https://discuss.bluerobotics.com/t/overlay-log-data-in-post-processing-video/5857/10 "2019-09-10T18:47:59Z")

</div>

Hi @sigane17,

In your readable Log, do you have something like this ?

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/8/8b479ba3d5b058fee4830c6c67215a0bb8de0283.png)

In this case, the first and second columns are date and time. For the parameters you need, just look for mavlink\_vfr\_hud\_t line; the depth and heading will be in this row.
