Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to embed gps into video

Tags:

html

video

gps

mp4

I am wanting to write an application that takes a live video stream along with GPS coordinates, merges them together and displays it on a HTML5 browser.

This is what I got so far.

I can capture the live Video. Video is in MP4/H.264 format.

I can get the GPS coordinates. Updated every second.

I need to merge them into one stream. I have thought about either, embedding the GPS as metadata or putting the GPS data into the captions.

On the client side, the user will have a HTML5-compliant browser that can play MP4/H.264 video.

I need a way to extract the GPS data from the merged stream.

I can then display the video in one frame and a map with the current position in another frame, side by side.

I am looking for help in the merging and un-merging of the streaming video and GPS.

Thanks.

like image 978
byteherder Avatar asked Oct 24 '12 23:10

byteherder


People also ask

Do videos have GPS metadata?

There is only GPS data (part of EXIF) and XMP. Video files support neither EXIF nor GPS, but XMP. Did you try to map a video file in IMatch? For videos recorded with my iPad Air 2 IMatch does import metadata that also includes the GPS location.


1 Answers

If you're going to split the merged stream, then why don't you just leave a video file, and a GPS log, and sync them afterwards?

In the GPS stream just log a frame number, or sync based on timestamps. Just make sure that you synchronize the system clock with GPS time in that case.

That's how I've done it in the past, and it works fine.

To get an overview of what was logged, and to verify that everything was synced correctly, I converted my data to .srt (for subtitles) format. Then with any video player you can see your custom text as a subtitle, and the video player does the syncing for you.

.srt looks like this.

1
00:00:00,000 --> 00:00:01,000
First Message. GPS bla bla 

2
00:00:01,000 --> 00:00:02,000
Second Message.. GPS foo bar

Can't be easier. More info: http://en.wikipedia.org/wiki/SubRip

Here you'll find an example of MP4+SRT on a HTML5 webpage: http://www.storiesinflight.com/js_videosub/

like image 159
Wouter van Nifterick Avatar answered Nov 04 '22 03:11

Wouter van Nifterick