05-16-2018 06:26 AM
Hi,
I have a setup with two (externally triggered) synchronized Basler cameras which continuously acquires images and streams onto the front panel simultaneously. I am using the IMAQdx VI library. The goal is to write an AVI from these continuous image acquisition. But I dont want to make 2 separate video files from the two cameras. Instead, I would like to overlay the streams vertically/horizontally in one video file. So, for output, I would like to have one AVI (or any other format) file which shows the video from both camera next to each other.
Can anyone please help me or give some ideas how to achieve this? If my question is not clear, please don't hesitate to clarify.
Best,
Arka
05-16-2018 11:26 AM
You would have to do it in two steps. First, combine the two images into a single image, then write that image to the AVI.
You can create a new image that is large enough to hold both images, then use IMAQ Image2Image 2 to insert each image into the larger image in the appropriate position.
Be aware that writing to AVI files is slow. Unless you have a very low frame rate, the acquisition will get ahead of the AVI. You need to either buffer a large number of images or do short acquisition runs. You won't be able to write to an AVI over a long period of time if you write every image.
Bruce
05-17-2018
12:50 PM
- last edited on
06-17-2025
09:31 AM
by
Content Cleaner
Hi Arkapal,
Bruce's advice is spot-on. In addition to his suggestions you might want to consider streaming your images to the hard disk as a binary file, as a step between combining the images and writing them to an AVI file. I've linked an example program below which demonstrates how to stream video to a binary file on your computer.
IMAQdx Stream Image to Disk Using Asynchronous TDMS
http://www.ni.com/example/31550/en/
After you stream the data to disk, you can read it from the binary file and into an AVI file. This would allow you to use your hard disk instead of your RAM and may prevent issues with overusing memory. I hope this makes sense!