GPS data in Text tracks

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

GPS data in Text tracks

Postby sherington » 10 Oct 2013 20:17

Hello,

I want to extract GPS data that is encoded inside a Text track inside an MP4. I would like to be able to get at that data in real-time as the video is played, so I can display it, chart it or whatever.

As an aside, I can view the encoded data using the vlc application by enabling the subtitle track. I can also use "avconv" to extract the subtitle track to a text file and I have successfully decoded all the GPS data contained within that track, so I know in principle this should be possible.

My problem now is to synchronise that with the video so the current position and heading can be plotted on an interactive map. My ideal solution would be to be able to register a callback through libvlc to notify my application each time new subtitle data is available. What I would want from libvlc would be the "raw" subtitle text - I expect my own application to do the decoding of the proprietry GPS format given the raw "text".

So what I am hoping for are some pointers as to where I should start with vlc to implement such a feature - do I need to write a new vlc plugin of a particular type, should I be looking at adding a callback to an existing piece of vlc, or something else? Is there a good example to follow from any existing plugin?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: GPS data in Text tracks

Postby Jean-Baptiste Kempf » 14 Oct 2013 12:12

Yes, you need to write a new plugin to extract text data, like vmem, but for subtitles.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: GPS data in Text tracks

Postby sherington » 24 Dec 2013 09:21

I'm not sure if I have done this the right way, but this is what I did...

- Create a new "text_renderer" module to send the SPU text via a callback, the callback accepts the subtitle text and an opaque pointer (in keeping with how vmem and amem are implemented).
- Add new API to libvlc to set this callback.

This actually works - the subtitle text containing the encoded GPS data is sent via the callback to my application at the correct time and I can decode it successfully and display the GPS data side-by-side with the video.

I have two outstanding issues with it:

First is that I don't know about is how to programatically select/enable my new text renderer module - I can select it with the "--text-renderer <module-name>" switch when I create the libvlc instance, but is there a way to do this in code inside my set_callback function?

Second is that ideally I would want to use this for subtitles only, but since the new module is a general text renderer it's also used for things like displaying the video title. Can I do anything about that?

Rémi Denis-Courmont
Developer
Developer
Posts: 15224
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: GPS data in Text tracks

Postby Rémi Denis-Courmont » 24 Dec 2013 12:23

I think it is somewhat obvious, but if the GPS data is marked as plain text, there is no way for the player to discriminate it from normal subtitles.

If you want to deal with GPS data cleanly, it must be coded as a separate/new data/codec type in the MP4 file.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

uglide
New Cone
New Cone
Posts: 1
Joined: 13 Aug 2014 18:04

Re: GPS data in Text tracks

Postby uglide » 13 Aug 2014 18:09

I'm not sure if I have done this the right way, but this is what I did...

- Create a new "text_renderer" module to send the SPU text via a callback, the callback accepts the subtitle text and an opaque pointer (in keeping with how vmem and amem are implemented).
- Add new API to libvlc to set this callback.

This actually works - the subtitle text containing the encoded GPS data is sent via the callback to my application at the correct time and I can decode it successfully and display the GPS data side-by-side with the video.
Hi, I faced with same problem. Can you provide your solution?

ryantheseer
Blank Cone
Blank Cone
Posts: 15
Joined: 16 Feb 2017 20:19

Re: GPS data in Text tracks

Postby ryantheseer » 20 Mar 2017 14:50

Hi sherington or uglide: have either of you succeeded in making a plugin for GPS data in text files? I'm looking to do something similar, except that instead of GPS data, I would like to make use of custom auxiliary data that needs to be synchronized with the video image frames.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: GPS data in Text tracks

Postby Jean-Baptiste Kempf » 14 Apr 2017 14:18

Hi sherington or uglide: have either of you succeeded in making a plugin for GPS data in text files? I'm looking to do something similar, except that instead of GPS data, I would like to make use of custom auxiliary data that needs to be synchronized with the video image frames.
So far, I've not seen any plugin actually working
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests