07-27-2012 05:56 PM
Any ideas how to compress Video stream on-the-fly to 3-4 compressed video streams (high-quality, low, web...), built-in NI Vision filters are not good enough. FFDSHOW is not labview friendly, Quick-time is alright but requires complete AVI or go through saving individual frames to disk...
Do I need to create a labview-friendly encoder/decoder? (partially complete)
Any input on how to port it to windows enviroment?
-Artur
P.S. CPU platform PXI-8133 with SSD drives - shouldn't be a limiting factor
07-31-2012 08:48 AM
Hi GriffinRU,
You can definitely compress video in real time. The 'Grab and Save to AVI.vi' example does just that. What do you mean by saying the filters are not good enough? Not enough compression or poor quality? Check out the KB I have attached for a reference of comparing the filters themselves.
http://digital.ni.com/public.nsf/allkb/0A4D5BF47FD3FF0186256E9A004FD671
08-01-2012 07:28 AM
Hi Cole,
DV Video Encoder - doesn't support HD (720p only) and not a compressed stream anyways
MJPEG - compression level by definition is not sufficient
Cinepak Codec by Radius...Microsoft Video 1 are ancient and at best offer 30x compression with significant loss in quality.
I am looking for codec similar to H264 with user accessible preferences (i.e. keyframes, datarate and such).
I can use Quicktime export feature to compress acquired AVI stream to H264 (or other format) with nice user interface, but I cannot do that on partially acquired video. And as result it requires extra storage for RAW video and extra time for compression later, while it would be really helpful to compress data at the same time as you acquire it.
-Artur
08-02-2012 05:15 AM - edited 08-02-2012 05:23 AM
Use lossless lagarith, best codec I used, that works with labview avi functions.
I see, that the platform has some ATI GPU, you might want to take a look if you can code the encoder into it. ATI has an SDK for these purposes.
I am doing this with Intel platform (.h264 into GPU).
Code it in Microsoft VS and implement in LV through dll.
08-02-2012 05:33 AM
08-02-2012 07:59 AM
Thank you for feedback,
"Code it in Microsoft VS and implement in LV through dll." - that is what I am trying to avoid, or at least patch over .NET
Current system does have ATI video but future targets might not, so I would like to be more universal and use CPU for compression.
-Artur
08-08-2012 09:10 AM - edited 08-08-2012 09:11 AM
Why I need this...
I have an application when I need to capture video (multiple cameras) of particular test site (not close up as machine vision) with reasonable compression and switch to not compressed frames for short period time upon user request or triggered by some events in video stream. Tests can be run back to back in 8 hour day with 15-30 minute break between them.
NI Vision toolkit (and DOTNET) allows me to identify such events and trigger on user event, except streaming to disk. Most of-the-shelf compressors won't let me create video stream with variable video frame size or variable data rate.
In general it would be nice to use DirectDraw compressors and create separate streams for uncompressed frames(or when high quality required). But I was wondering if low quality and high quality can be inside one stream, playing back shouldn't be a problem if you know how to...
-Artur
P.S. And, yes it can be done on GPU core as well
Audio stream would be a bonus.
08-08-2012 09:32 AM - edited 08-08-2012 09:36 AM
You need a codec, that allows on fly parameter changes. There is probably bunch of such, but 100% there is no easy labview implementation.
So you need to code your own or produce some workaround.
08-08-2012 12:15 PM
Can you point to VS implementation - example?
-Artur
08-09-2012 04:57 AM
You can start by calling an DLL from labview and passing an image to it, good links are here and here, but you should find more. You don't need to install OpenCV, just make a project, create a DLL, pass an image and call some IMAQ function inside that DLL. I guess you are weak in C/C++, there is some learning involved in the correct linker settings and proper includes so such simple example should get you started.
The next step is to pick an opensource codec, create a LabVIEW wrapper for the functionality you need, here is an example, how to manipulate objects in labview.