Ask Your Question
0

compression of big data and transit to other system then decompress

asked 2017-07-04 00:02:31 -0600

ansari gravatar image

updated 2017-07-04 00:03:40 -0600

If I compress big video data-reduced the size of the video and transit to other system after, all compressed data has been received then decompress in the other system. For Example: If I am send big video file from system A to System B. During sending from System A , I compressed big video file (Reduce the size of the file) in System A then I transit that compressed data to System B . In System B, I decompress the video file. During decompression, whatever the original video file is there it should come without any loss of frames and pixels.

So, Is there any solution to solve this kind of problem??

I am new to this technology. I need help. Thanks.

edit retag flag offensive close merge delete

Comments

this might be the wrong place to ask.

opencv is a computer-vision library, not a video-processing one. go and ask the ffmpeg folks.

berak gravatar imageberak ( 2017-07-04 00:22:14 -0600 )edit

can we use Video Encoding/Decoding to compress and decompress the file? Can you explain how Video Encoding/Decoding is used? @berak

ansari gravatar imageansari ( 2017-07-04 01:28:41 -0600 )edit

well, you can, but unless you're specifically interested in processing some computer-vision task, opencv (which wraps around ffmpeg or gstreamer here) is the wrong library for your task, you will have to use e.g. ffmpeg directly, to get sufficient control.

berak gravatar imageberak ( 2017-07-04 01:34:27 -0600 )edit

btw, #ffmpeg or #gstreamer or #videolanon irc.freenode.net might be more helpful, than we ever can be here.

berak gravatar imageberak ( 2017-07-04 01:40:58 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2017-07-04 05:08:56 -0600

pklab gravatar image

I would suggest to use/search for LossLess video codec like Lagarith or Huffman.

Often this codecs aren't available for any platform and have low compression rate... usually about 1/3

Quite old but you might start your selection from here Lossless Video Codecs Comparison ‘2007

Once you have the codec available on both systems you can read/write the video using VideoCapture/VideoWriter

With VideoWriter you have to select right FOURCC, for example:

int    codec      = CV_FOURCC('L', 'A', 'G', 'S'); //use this for Lagarith lossless codec
int    codec      = CV_FOURCC('H', 'F', 'Y', 'U'); //use this for Huffman Lossless Codec
//create the video file using your codec
VideoWriter vw(filename,codec,fps,img.size(),1);
edit flag offensive delete link more

Comments

If I am using CV_FOURCC during VideoWriter , the pixel size is reducing. In my case the pixels should be similar as original file. can you suggest me? @pklab

ansari gravatar imageansari ( 2017-07-05 01:07:52 -0600 )edit

I don't understand at all.

  1. You must use CV_FOURCC with VideoWriter to choose the codec. Some codec are lossy (like XVID, X264...) some other are lossless like above.
  2. Lossless means that no quality compression (read reduction) will be applied than written frame === source frame
  3. Pixel size depends on "size" parameter you use when create the video file. This size must be same as size of frame you will write to the file.
pklab gravatar imagepklab ( 2017-07-05 02:32:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-07-04 00:02:31 -0600

Seen: 373 times

Last updated: Jul 04 '17