Menu Sign In Contact FAQ
Banner
Welcome to our forums

A video with dynamic subtitles or a GPS moving map insert

No, it’s frame rate independent as the times are times, not numbers of frames.

I’d try something like:-

1
00:00:00,000 —> 00:00:00,999
Time: 17:45:07 Position:50.619690, 6.887390 Altitude: 12345

2
00:00:01,000 —> 00:00:01,999
Time: 17:45:08 Position:50.619690, 6.887390 Altitude: 12345

then, if you have a gap between reports…

3
00:00:02,000 —> 00:00:04,999
Time: 17:45:09 Position:50.619690, 6.887390 Altitude: 12345

4
00:00:05,000 —> 00:00:05,999
Time: 17:45:12 Position:50.619690, 6.887390 Altitude: 12345

So subtitle ‘3’ stays on screen for three seconds in the example above.

I believe this logic is beyond anything you could do with regex!

provided one removed the 6-line header junk manually.

tail -n +6 should do the trick, no need for manual action

I agree with Steve though, line-oriented utilities like sed and awk are a hell to use on multiline data, i.e. when an action must be taken depending on the data in more than one line. I wonder if It couldn’t be done with an Excel macro?

EBZH Kiewit, Belgium

The thing which complicates it are the conditionals which need to extract the time delay between consecutive lines in the CSV file.

Obviously it’s possible in any programming language, but it would be much easier in something which can just give you the distance (in seconds or milliseconds) between two date+time values, as an integral part of the language. You can’t just use the hh:mm:ss alone because it will crash at midnight. Not that one is often airborne at midnight…

A google on
csv to srt converter
digs out some leads but apparently no ready made tools. But then I guess everybody is importing different data, even if it’s all CSV.

I haven’t got a clue how to do excel macros. And I still use Orifice 2003

Administrator
Shoreham EGKA, United Kingdom

I am re-visiting this topic…

I am fairly sure I can do subtitles from an ex-GPS CSV file as below (CSV to SRT conversion; there are some PHP scripts and I can probably find somebody who can help me there). There is also e.g. this

The next step is something MUCH more complicated:

The first two columns are latitude and longitude. I would like to insert a moving map into the corner of the video, positioned with the lat/long in its centre.

I looked into this a few years ago and got a lot of feedback in some forums but all of it seemed to involve highly specialised unix based command line tools.

Fairly obviously I will need to start with a moving map GPS program which can take as input the lat/long data and “play” the track from it (Oziexplorer can do that) and I need a program which can capture the screen area to either a video or (maybe better) to a series of still images with each one corresponding to each data point. There is a data point every 3 seconds; maybe I need to make that a lot finer to create a smooth video. All this I can arrange.

But hasn’t this wheel been invented many times before?

Administrator
Shoreham EGKA, United Kingdom

Have a look at GMapCatcher – you could feed your co-ordinates into it and have it download a bunch of tiles.

You could then use FFMPEG to string the tiles into a movie and then drop it into your timeline in Vegas.

That’s a good tip… it is limited to the open source maps, but that may be OK.

I am still on SRT generation… the closest I can get in Excel (2007) is this

There doesn’t appear to be an obvious way to create a time format of hh:mm:ss,000 although it could obviously be done by creating another column with the “000” and then concatenating the two columns, or just stripping out the comma in the CSV file with sed etc…

Administrator
Shoreham EGKA, United Kingdom

A further update. This product can import subtitles from CSV. If that works, that will be a good workflow because it’s a plug-in. It is also one of the very few (for Vegas / Vegas Pro) means of generating a flexibly configurable time counter embedded in the video.

Administrator
Shoreham EGKA, United Kingdom

OK; I have finally done it.

Vegas cannot import SRT, as it turns out, but it can with the above-mentioned Vegasaur plug-in. There is a nontrivial procedure for making it work while getting the subtitles in the chosen size, font, location, etc – described in this video (not mine)


On a 5hr flight, Oziexplorer generates nearly 10,000 data points and the resulting 10,000 subtitle events (Vegasaur generates a Sony Text event for each SRT subtitle) very nearly hang the program!

But this is OK because it still runs (just the user interface becomes very slow) and one will do a render at this point, to embed the data into the video. This render can of course include the usual stuff e.g. contrast, colour correction, lens correction, etc. The rendered footage (45GB for a 5hr 1080P project) is then re-imported into a new Vegas project and edited to remove the boring stuff – more than 90% usually.

This is a small piece of the result


The timecode in the bottom RH corner is the Sony Timecode which is built into Vegas. One would not normally include this if the other text is available.

Administrator
Shoreham EGKA, United Kingdom

Peter wrote:

There doesn’t appear to be an obvious way to create a time format of hh:mm:ss,000 although it could obviously be done by creating another column with the “000” and then concatenating the two columns, or just stripping out the comma in the CSV file with sed etc…

In OpenOffice/LibreOffice it is possible to do this by changing to a user defined coding as

HH:MM:SS,000

for the format. In Excel 2010 the same works with

hh:mm:ss,000

I cannot check how Excel 2007 takes this, but you can give it a try.

P19 EDFE EDVE EDDS

Interesting – thanks.

I was sure it could be done somehow – because just about everything is “possible” in Excel, using macros, VB scripts, etc, etc.

In this case I got a colleague to write a converter in C++ in about 2 hours which did exactly what I wanted, including subtracting 1 second from the label end time and adding the “,999” to it. (we did assume no flight will pass through midnight )

Actually I suspect that a better way to render the subtitles is to do it in Handbrake, not Vegas. HB is very high quality, loads of config settings (including a basically lossless one which Vegas cannot do) and is fast. And it can read SRT directly. However, there is a subtle issue because one needs to do stuff in a specific order

1) colour etc correction and lens correction and rotation
2) rendering any subtitles

otherwise the subtitles will get distorted They have to be rendered after the corrections. But (like any timecode) they have to be rendered before the video is finally edited to remove unwanted content. So if one used an external rendering tool, one would end up generating an intermediate file, with a loss in quality.

One solution is to shoot in 4K but all the “4K” action cams have serious limitations with 4K…

Administrator
Shoreham EGKA, United Kingdom
Sign in to add your message

Back to Top