Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Codec issues in recording and playback of compressed video.

l want to collect and save video for hours, do you have some suggestions ? at present, l just get video for 35 min. 

  • How do you apply compression patterns in labview without four codec provided by NI, such as :FF Video Codec 1, Motion JPEG, Y800 Uncompressed, and YUV 4:2:0 Planar.

  • if you solve the limition that 1.96G,can you show me the way or block diagram?

Thanks

C-Dison

0 Kudos
Message 11 of 15
(1,517 Views)

The Codec itself will usually have some ability for the user to adjust the compression settings and sometimes you can adjust this in NI-Vision.  Those codecs you mentioned are pretty old so try the FREE Camtasia Codecs (TSCC or the older TSC2)

 https://www.techsmith.com/codecs.html

It also depends what you are trying to record - colour, B/W, grayscale, High or Low resolution and your Frame rate.  The Camtasia Codecs have been optimised for computer screen capture.

I haven't recorded an AVI that is over 2Gbytes, so I couldn't tell you if this is a limitation, but I'm pretty sure if you are using  64-bit NI-Vision then this should not be a problem.

Chris

0 Kudos
Message 12 of 15
(1,515 Views)

Picking up this thread again:

 

Since AVI2 it is possible to use the the x264vfw codec. I just ran into some problems to get it done as "AVI2 Get Codec Names" (http://zone.ni.com/reference/en-XX/help/370281AE-01/imaqvision/imaq_avi2_get_codec_names/) is not listing all my installed codecs.

 

What you need to do is:

1. use the example VI "AVI Compressor Comparison" as mentioned here https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019M0ySAE&l=de-DE. You will get all your installed codecs listed and probably an error, at least in my case, as the VI can not compare the codecs properly.

2. Copy the codec string and place it as string constant for "AVI2 Create" (see: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019M0ySAE&l=de-DE)

3. Now it is important to know which picture/video formates (width and heigth) your prefered codec can compress! E.g. the "x264vfw - H.264/MPEG-4 AVC codec" is only able to compress pictures with width and heigth as a multiple of 2.

 

I got a series of pictures (1000 up to 100000 pictures) and create a compressed video with these. This is the code i am using and its working out perfectly for me.

Blockdiagram.PNG

 

The difference to your task is just that you need to implement the compression into your realtime recording, but i think it should work out quite fine.

 

0 Kudos
Message 13 of 15
(1,385 Views)

I should clarify that I have been able to use many different codecs to encode the video.  I used various combinations of tools from the K-Lite codec pack.  However, where LabVIEW always failed was at playing back video that was compressed with key frames.  I could encode the video where every single frame was made to be a key frame, but then it defeats so much of the compression algorithm that the file sizes don't get reduced enough.  I want to record smaller file sizes without losing image quality, because the cost of storing all this data is actually quite high.

0 Kudos
Message 14 of 15
(1,379 Views)

Okay, than i didnt get the question right, sorry.

 


@jtrout wrote:

I want to record smaller file sizes without losing image quality, because the cost of storing all this data is actually quite high.


Still, to reduce file size without any losses is quite hard to do, isn't it?

0 Kudos
Message 15 of 15
(1,371 Views)