LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save one avi file with 2 camera's video?

您好,我编了一个vi实时采集2个摄像头视频,但是我想仅仅保存一个avi文件,请问如何操作?非常感谢!

hi, i have built a vi to get 2 cameras' video at the same time. but i want to combine them and save as just one avi file.could you please help to tell how to operate?

thanks a lot.

0 Kudos
Message 1 of 7
(1,974 Views)

It depends a lot on how you want to merge the two images.

 

You can blend then, or put them next to each other, or on top of each other, add them, subtract them, interleave them, etc.

 

I'd create a 3rd image, big enough to contain the result, and then use IMAQ functions to put the camera images in it. 

0 Kudos
Message 2 of 7
(1,943 Views)

I'd advise against doing that -- instead, write a separate AVI file for each camera.  The "two file" solution will probably be smaller than a single-file solution, will probably take less CPU time to compute (and thus will probably allow a faster frame rate for the video), and will certainly simplify any "post-processing" you wish to do for the two original Image Streams.

 

As Wiebe notes, if you want to "combine" the two frame images from the two cameras, you need to do Image Processing on the pair of Images (which potentially involves "touching" all of the pixels of both), with the result possibly having less information than the original two images (consider, for example, that you add or subtract the pixels -- you get a pixel value, but lose the original two pixel values).  In addition, the AVI format involves a CoDec, a Compressor/Decompressor algorithm that tries to make the file size smaller by compressing the Image Stream in both the Spatial (2D) and Temporal (a third dimension)  dimensions, which further complicates "combining" the (static, single) Video images from two Cameras into a single "AVI" Video.

 

Bob Schor

0 Kudos
Message 3 of 7
(1,927 Views)

I agree with you,but how to process the combine?I want to put them left and right.

0 Kudos
Message 4 of 7
(1,917 Views)

thanks for you suggestion,I want to put them next to each other,could you please tell the codes?thanks a lot


 

0 Kudos
Message 5 of 7
(1,916 Views)

@Willa_Liu wrote:

thanks for you suggestion,I want to put them next to each other,could you please tell the codes?thanks a lot


I don't have IMAQ installed, but it seems a lot harder then expected.

 

I'd think there should be a function for this, but I can't find it online.

 

You can expand one image (IMAQ Expand.vi or IMAQ Expand 2.vi). Then I guess you have to convert one image to a 2D array, and then insert the 2D array into the other image. If that's possible.

 

Worst case would be if you had to convert the 2 images to 2D Arrays, then concatenate those 2D arrays and convert them to a new image. It might be the only way.

 

OT: This would be 1 function in OpenCV...

0 Kudos
Message 6 of 7
(1,893 Views)

Not to belabor the point, but you could (as I suggested) save a pair of AVIs, then use Video Processing software to combine them into side-by-side views (I'm guessing, not ever having tried to do something like this, that Video software has functions to do such things ...).

 

Bob Schor

0 Kudos
Message 7 of 7
(1,881 Views)