Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IP camera: How to save raw MJPEG frame to disk?

Solved!
Go to solution

Hello,

 

I have an IP camera streaming JPEG-compressed images. I tried to use IMAQdx Get Image Data.vi to get the raw bytes and save it to disk, but I can't produce a valid JPEG file.

 

In the code below, test2.jpg is always a valid JPEG file around 69 KB, while test1.jpg is always an invalid file around 65 KB (I tried both big-endian and little-endian settings, with the same results).

 

Any ideas?

 

IP Camera Save JPEG.png

Certified LabVIEW Developer
0 Kudos
Message 1 of 2
(4,788 Views)
Solution
Accepted by topic author JKSH

Gah, rookie mistake... I forgot to disable "prepend array or string size" in Write to Binary File.

 

I also don't need to convert the byte array into a string.

 

All working now!

Certified LabVIEW Developer
Message 2 of 2
(4,767 Views)