Video compression is typically "lossy", in contrast to "lossless".
This means that by compressing the data, and subsequently decompressing it, you end up with an approximation of the original that is (hopefully) acceptable for the purpose.
Storing images and video using lossy compression techniques is generally fine, because humans aren't very good at perceiving the detail in an image - for example, our brain can fill in lots of details from context alone (as our eyes only have a small area in the center that is of "high resolution"), and our eyes are more sensitive to the intensity of green than red or blue (which explains the allocation in RGB565).
So, when you say:
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
You're asking one question, but leaving lots of openings for misinterpretation.
- Can we extract the original, pixel-perfect image from a video compressed using lossy techniques?
- Can we extract a single frame of a video compressed using lossy techniques that has high quality, and could be used as a static image?
- Probably not - movement in a scene will cause a higher number of artifacts, while a static scene will typically look better and better over time.
- Can we extract an image of the original size, that looks "reasonable" to a human?
- Yes - for a given definition of "reasonable"
This imperfect resulting image will have "Compression Artifacts". As shown in the exaggerated examples below:
As the comments have also focused heavily on Audio quality, the exact same thing occurs. However, audio is a significantly lower bandwidth medium, which allows for lossless codecs to be practical (for example FLAC).
Converting from PCM / WAV → MP3 → PCM will result in an output PCM file that has the artifacts introduced by the MP3 encode/decode process - these cannot be removed.
Additionally, concatenating codecs will allow each to introduce their own artifacts, and the order that the codecs are applied can have a significant effect on the output.
Converting PCM → MP3 → OGG vorbis → Opus is not the same as PCM → Opus, because each of the intermediary codecs are lossy.
I've made an example audio file which presents this as another exaggerated example. This is the first ~30 seconds of "Tonight" by "The 69 Eyes", alternating every 5 seconds between the following chains:
- CD → FLAC → Opus
- CD → FLAC → MP3 → Vorbis → Opus
The effect here is dramatic, with the higher frequencies (i.e: high-hat) being almost completely removed from the audio, and with significant channel (left/right) interaction that is especially noticeable at the beginning.
18uncompressed != original – Bergi – 2019-04-02T20:00:32.990
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers. – thebrokencoder – 2019-04-03T03:36:29.093
2Aside from the technically oriented answers, a legally oriented person (a lawyer or judge or possibly the owner of the intellectual property) will, most probably, insist that the decompressed video is, in a nutshell, still the original work (even if it's copied at a much lower resolution/quality, for example). – Klaws – 2019-04-03T16:01:43.397
@Klaws It logically makes sense. But anyway, one cannot legitimately redistribute the video/audio in an opensource format unless the original allows it to be converted or redistributed; as far as I know. – thebrokencoder – 2019-04-03T18:30:33.640