04-12-2018 06:53 AM
I have a stream of JPEG files (wireless transmission) and i need to compress them before sending and decompress after receiving. Using NI Vision toolkit namely IMAQ AVI2 Codec Names.vi I found out that I have codec H.264. How can i use it for compressing and decompressing JPEG files. Is it possible using NI Vision toolkit ?
Thank you in advance.
04-12-2018 08:55 AM
Hi Hovhannes,
why do you want to compress and decompress JPEG files?
- JPEG already is compressed and has a certain datastructure: compressing it with "lossy" compression like H264 will damage that data structures!
- Have you tried to ZIP the files? (With JPEG files you will maybe gain 1-2% filesize…)
04-13-2018 12:48 AM
Thanks for replay.
When I compress my images with JPEG converter (IMAQ Flatten Image to String.vi) for transfer it I get a very bad quality. Because of it i want to compress my data send in via serial port and decompress so as not to have a strong loss of quality.
04-13-2018 01:02 AM
Hi Hov,
did you read the help and did you play with the parameters?
- You might change the quality of the JPEG compression.
- You might even switch off JPEG compression.
Did you try to ZIP the (image) string for transfer?
04-13-2018 01:07 AM
Yes I know, but the file with appropriate size (for transfer minimum 15 frames per second) have very poor quality.
04-13-2018 02:13 AM
It sounds like you basically need to reinvent MPEG. Don't send the full JPG, send the difference from the previous one.
/Y
04-13-2018 03:14 AM
If it's not hard for you can tell how it can be implemented? I try to transfer video via UART with 230.4 kbit/s baud rate with minimum 15 frame per second.
04-13-2018 03:19 AM
Hi Hov,
I try to transfer video via UART with 230.4 kbit/s baud rate with minimum 15 frame per second.
Wow.
Which frame size (in pixels)?
Some simple math: You can send ~23kB/s using your 230kbaud serial port. So you have just ~1.5kB/frame available: unless your frames are tiny the video quality will be poor…
04-13-2018 03:20 AM
Frame size is 320x240
04-13-2018 03:25 AM