fpv-wtf / wtfos-configurator

Configurator for wtfos, with built in margerine
GNU Affero General Public License v3.0
42 stars 16 forks source link

Support modified video files for OSD overlay #394

Closed FinalFrag closed 12 months ago

FinalFrag commented 12 months ago

Currently the OSD overlay feature only supports video files that come straight from the goggles. This PR adds support for modifications as long as they don't change the video length.

Technical: video files straight from the goggles have all frames in the correct order. Tools like gyroflow or superviou save frames in a different order that they are supposed to be shown. The correct order is described in the optional ctts box in the mp4 spec.

An example of footage that has the aspect ratio altered with superviou: image

stylesuxx commented 12 months ago

Cool - thank you!

Just an FYI: you only need to add/update the en translation, crowdin will do the rest.

j005u commented 12 months ago

@FinalFrag I should add that if you want to get your hands dirty with C, then msp-osd on the goggles side could be improved to add (roughly estimated) timestamps per frame so that the .osd could also be applied to air side recordings/gopro footage.

The trouble with trying to do that with the current frame index like we handle goggles side DVR is that any frames that get skipped due to transmission issues push things out of sync. This de-sync can build up significantly over longer flight videos.

Just mentioning it FYI. In any case your improvements are really appreciated!

FinalFrag commented 12 months ago

Bet you can't tell I'm used to a non-semicolon environment :P

Isn't it weird ESlint didn't fail on this?

FinalFrag commented 12 months ago

@j005u Took a quick look at the msp-osd code, but that is way beyond me :)

j005u commented 12 months ago

@j005u Took a quick look at the msp-osd code, but that is way beyond me :)

The .osd writing code is actually extremely straight forward: https://github.com/fpv-wtf/msp-osd/blob/03c1faf4fe808548f6a737a43231c24049403988/jni/rec/rec.c#L74C21-L74C21

If you'd be interested in dealing with the rendering code then I'm sure someone on the team can add a milliseconds from frame 0 count to each frames header.

stylesuxx commented 12 months ago

Isn't it weird ESlint didn't fail on this?

Yeah, I was wondering too - need to double check the config.

stylesuxx commented 12 months ago

Merged. Thanks again for you contribution, very much appreciated!