LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read a frame from a mpeg video

Solved!
Go to solution

I need to progammatically read a frame from a mpeg video.

I have already tried to make use of ffmpeg and convert the video in a PNGs (or whatever) sequence but now I would develop a more performing solution.

Did anyone try or need something similar?

 

Thanks!

0 Kudos
Message 1 of 6
(5,164 Views)

Hi simroc76,

 

the mpeg video format is not native supported by LabVIEW.

If you want to read a mpeg video, one possible solution is to convert the mpeg file to an .avi file. If you want to create solution with a higher performance, i can give you two possible solutions:

 

1) Maybe the ffmpeg application provides a dll, which you can call from LabVIEW. With this approach, you would use the CIN-Node from LabVIEW to control the function of ffmpe. I don't know, if ffmpeg provides such a function. If not, you must search in the internet for a application, which offers you this function. If you never used a DLL with the CIN-Node, this links are really helpful:

 

Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW - Developer Zone - National Instruments
http://www.ni.com/white-paper/4877/en

 

Integrating External Code with the Import Shared Library Wizard - Developer Zone - National Instruments
http://www.ni.com/white-paper/2818/en

2) Another approach is to use ActiveX to get an frame. With ActiveX, you can control another application and can excange Data between LabVIEW and another application. This solution would also not be very easy, but it is an opption to import a frame from an avi-file into LabVIEW. If you want to know what is possible with ActiveX, you can use this example:

 

Community: Creating a Hyperlink to a cell in Excel via Active X
https://decibel.ni.com/content/docs/DOC-5780

0 Kudos
Message 2 of 6
(5,132 Views)
Solution
Accepted by topic author simroc76

Thanks for the reply Stephan.

 

I solved my issue!

After several tests, I've used an OpenCV dll: opencv_highgui240.dll (version 2.4.0).

Since I had some issues with dll included into the official OpenCV package, I've used the ones included into the Emgu package http://www.emgu.com/wiki/index.php/Main_Page

That dll is not static, so I had to take care about the Windows current working directory (see here https://decibel.ni.com/content/docs/DOC-7192 ).

Now I am able to extract  frames from a MPEG2 video and put them into an IMAQ RGB image (with 640x480 frames I need 10 msec for each frame).

Message 3 of 6
(5,123 Views)

Hi simroc76,

 

thanks for your replay. Great that you could solve the issue with a DLL which converts the mpeg frames on the fly into LabVIEW.

Would it be possible for you to post your solution? I think that your solution would be helpfull for other forum user, which deal with the same problem an also search for a way to get mpeg frames into LabVIEW.

 

Stephan

0 Kudos
Message 4 of 6
(5,097 Views)

If you dont mind sharing your example, i would love to see it as well.

Thanks!

 

0 Kudos
Message 5 of 6
(5,068 Views)

If you can share your solution i was appreciate you. Thanks

0 Kudos
Message 6 of 6
(4,801 Views)