I have a very high quality video and I need to produce a high quality and a low quality version for transport into other systems.

For the high quality version I use

  • a lossy compression (currently VP9 because I have HW acceleration for that)

For the low quality version I use

  • half the framerate (possibly I could use even lower)
  • lower resolution
  • cropping to 50% of the canvas
  • possibly an even lossier compression

Both video files need to be transferred over the same limited bandwidth link. The lower quality is somewhat time critical, so it needs to be as small as possible. The high quality video is not time critical, it can be transferred whenever free bandwidth is available. But the link being limited overall, I do not want to waste anything. Obviously some information is duplicated if I transfer the low quality video first and then the full high quality video. I wonder whether there are existing delta encodings that allow me to transfer only the low quality file and a delta file and reconstruct a high quality video at the destination.

Although information is duplicated, with standard video compressions I don't think there is much data duplicated if I just produce 2 videos using different parameters. So the delta would not be helpful. Instead the video encoding needs to be tuned in a clever way resulting in duplicated data that does not need to be sent twice.

A very naive algorithm to produce a useful delta would work like this: I start to produce the high quality version, thereby guaranteeing that every odd frame (if counting starts at 1) is an I-frame. To produce the low quality version I remove every even frame from the high quality version. So I get a low quality video with half the frame rate. As the delta I collect all the even frames and transfer them separately. At the destination I can combine odd and even frames again to losslessly reconstruct the high quality video.

Obviously that is not a very good algorithm. The delta will most likely be p-frames (or b if the codec used those). So I end up with a "big" low quality video and a "small" delta. The "other way round" would be preferred. Maybe the low quality video consisting of only I-frames could still be compressed using a lossless compression. This algorithm does not yet make use of cropping and downscaling. The cropping part I might be able to figure out myself without deeper studies in video encoding, the downscaling unlikely so.

So the question is: Are there known delta encodings for video files that would be applicable here? Preferably with an open source implementation.

As a further constraint I do not have a GPU available on the machine applying the delta. (But a GPU is available on the machine producing the delta.)

  • With an existing pair of videos, this can't be done. An encoded bitstream has its own syntax (hence called encoded), and the coded elements across different versions of the video (resolution, framerate) can't be correlated like that. A naive delta encoding would take up significant size. – Gyan Apr 5 at 6:36
  • @Gyan I don't expect that would be possible for any arbitrary pair of video files. The files need to be encoded with the delta in mind, like in my naive algorithm does. Edited the question to further stress that. – Uwe Geuder Apr 5 at 7:52
  • The closest but not identical tech is SVC but encoders are proprietary and support is limited. It is available for audio though e.g. WavPack. – Gyan Apr 5 at 8:02
  • Thanks @Gyan, SVC seems extremely close to what I'm looking for. It's specified for streams, but creating separate files for the substreams should be possible without needing to understand the coding theory behind it. According to lists.freedesktop.org/archives/gstreamer-devel/2012-May/… no open source encoder exists. It's been 8 years, but maybe the situation is still unchanged? – Uwe Geuder Apr 5 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.