Skip to main content
How to do long traffic surveys thanks to file merging

Learn how to merge files to create more than 24 hour long survey

DataFromSky avatar
Written by DataFromSky
Updated over a week ago

When you need traffic analysis for longer time periods but for whatever reason you have shorter videos, merging can be a great help. Merging can help you to save a lot of time because you don't have to set up gates in each video individually or import the annotation into each .tlgx file separately. There are 2 ways file merging can be done.

Shorter videos can be merged together into one and analyzed as a whole or you can analyze the individual videos separately and then merge the results (individual .tlgx files) into a single one. Let's go through the advantages and disadvantages of these approaches:

A) Merge videos before processing - pros and cons

In the first method, you use video editing software to merge shorter videos into a single long one and this needs to be done before the video is uploaded to the platform for analysis. One of the disadvantages of this method is the 200GB upload limit for a single file. Note that you can upload a maximum of 600GB of combined file size at the same time. You will also require more disk space to store both the origin video files and the merged video file however, having a single large file instead of many can make file management much easier. Another disadvantage of this method is that it also takes a lot of time and effort to put the video together perfectly. The advantages of this method are that you have a single video file with a complete trajectory for each object if the merges were accurate. Also, with this method trajectories are bound to the video and can therefore be inspected visually meaning you can check for possible errors such as camera movements or irregular vehicle behavior.

B) - Merge the processed video data (.tlgx) - pros and cons

For tracking log merging (.tlgx) the disadvantage is that the trajectories do not get merged because the .tlgx files are only ordered into a time sequence. Depending on the .tlgx file length and number of merged files the accuracy of turning movement counts with this method will be marginally off due to the transitions between the files. This also means that trajectories are no longer bound to a video and what you will see instead is a static reference frame from the first .tlgx file. The benefits of .tlgx merging are faster processing. It is more suited for videos longer than 24 hours.

How can you merge video files?

This method is very straightforward and is more suitable for analyses shorter than 24 hours. To do it you need some video editing software in which you order the videos so that image frames from one video flow perfectly into the next one. This method is recommended for merging shorter videos such as merging 6 - 10 minute long videos into a single hour-long one. For merging videos before processing you can use any video editing software, there are plenty of free options out there.

How can you merge .tlgx files?

Tlgx merging option is suitable for analyses longer than 24 hours and easily merges 7x 24hour long .tlgx files to get data from a whole week into a single analysis. The main difference compared to the first method is that instead of merging the source videos you are only merging the analyzed data (the trajectories). For this type of merging you need to Import the data from multiple .tlgx files into a single one. It is necessary that the framerate, resolution, and other parameters of the input videos are the same for all of the input videos when merging .tlgx files. You can merge just 2 files. To do that you first open the first .tlgx file and then click “Import Tracking Log” from the “File” menu in the TrafficSurveyViewer and select the file you want to import. Be careful to not import the first .tlgx into itself.

Merging multiple files is slightly more complicated. You need to gather all of the .tlgx files in the same folder and name them according to alphanumeric order. Ideally, your file names should start with 01, 02, 03, and so on if you are merging more than 9 files. If merging more than 99 files the ordered .tlgx files should be named 001, 002, 003, etc… The folder in which you group the merged .tlgx files and the file names might look like this.

Once you have prepared the files you can merge them the same way you would merge only 2 files. After you select the files a “Tracking log import order” window will appear where you can check if the videos have been ordered correctly.

Another way to check if the videos have been imported in the correct order is to look at the video transitions. If you see any major trajectory jumps/ disappearances in this part then you have likely named the files wrong and they have not been imported in the correct order.

Keep in mind…

To do any kind of merging, the recording camera should be as static as possible. This is necessary in order for you to set up gates and zones correctly in respect to the physical environment of the scene. The videos also need to be from the same timeframe and they need to be ordered correctly.

If you have trouble merging your files please let us know and we will gladly assist you. We hope that you have found this guide helpful. Good luck with your merging!

Links

• Do you have more questions? Contact us!

• Follow us on Linkedin.

• Learn more about TrafficSurvey

• Visit our homepage to view products and news.

Thank you for your interest! Have a great day!

Let the traffic flow - with FLOW!

Did this answer your question?