07-29-2010 02:51 PM
Hello everyone,
I have been working on a project in which I have to analyze individual frames in jpeg format. The problem is that I am given these frames in an mpeg clip of approximately 30 seconds. I was wondering if anyone knows a way, or has any suggestions as to how I could extract the individual frames from the mpeg file and save all of them using the jpeg format.
Thanks in advance,
Justin
Solved! Go to Solution.
07-29-2010 05:09 PM
Don't know if the Vision Module software can do that, but I'd guess your best option is just to Google for a tool to do this.
07-29-2010 05:26 PM
Maybe you can try to use VLC with command line option ("System Exec.vi" with LabVIEW).
In this way you can extract a JPG file for every frame. After this you can analyze these single JPG frame.
Regards
Golziante
07-30-2010 05:20 AM
Hi,
There are two possible ways to do this.
First way - just "stand alone" solution (without LabVIEW) as mentioned above. You can use ffmpeg for conversion, something like that:
ffmpeg -i TEST.MP4 -r 1 -s 1280x720 -f image2 foo-%03d.jpeg
Another way - If you want to do this in LabVIEW, then first you have to convert your MPEG video to RAW video (as far as I remember, NI VIsion AVI functions have troubles with MPEG files, at least with my files).
You can convert your video with mencoder something like that:
mencoder TEST.MP4 -ovc raw -oac copy -vf format=yv12 -o out.avi
Then you should be able to read this video with AVI functions with VDM (these functions have troubles with large HD videos) or ADV into IMAQ Image and saving images in JPEG format.
Best regards,
Andrey.
08-03-2010 10:18 AM
Thank you for your help everyone.
The solution I decided to go with was to convert the mpeg file to an avi using command line, then access the files through labview and separate the individual frames to analyze.
Thanks again,
Justin Yost
09-27-2016 01:54 PM
Hi Justin, hope you're still out there six years later.
What did you actually use to convert the files using the command line, mencoder?
Thanks,
BG