Can compressed videos be decoded back to their uncompresed original format?What are the differences of watching a 1080p and a 720p version of the same media on a 720p screen?Can someone suggest a workflow for transcoding videos in iPhoto from Motion-JPEG to something smaller?Problems with frame rate on video conversion using ffmpeg with libx264Converting RAW Blackmagic Intensity Card framesExtract Y-channel of every I-frame from MPEG4 movie as loslessly as possibleffmpeg segment by video-time instead of wall-timeMerging two videos while skipping common partsUsing a lossless video codec for archiving (monochrome) scientific video dataAdapting video for LaTeX with ffmpeg does not produce the expected resultFFmpeg filter for scene changeCan ffmpeg be used to reduce encoded file size back to original after OBS+VLC workflow?
What's the point of deactivating Num Lock on login screens?
Malcev's paper "On a class of homogeneous spaces" in English
What would happen to a modern skyscraper if it rains micro blackholes?
strTok function (thread safe, supports empty tokens, doesn't change string)
Do infinite dimensional systems make sense?
Cross compiling for RPi - error while loading shared libraries
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Do I have a twin with permutated remainders?
Which country benefited the most from UN Security Council vetoes?
Is it possible to run Internet Explorer on OS X El Capitan?
Is it possible to do 50 km distance without any previous training?
A case of the sniffles
How is it possible to have an ability score that is less than 3?
How to format long polynomial?
"You are your self first supporter", a more proper way to say it
Does detail obscure or enhance action?
Approximately how much travel time was saved by the opening of the Suez Canal in 1869?
Add text to same line using sed
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
What are these boxed doors outside store fronts in New York?
tikz convert color string to hex value
Languages that we cannot (dis)prove to be Context-Free
Can I make popcorn with any corn?
What is a clear way to write a bar that has an extra beat?
Can compressed videos be decoded back to their uncompresed original format?
What are the differences of watching a 1080p and a 720p version of the same media on a 720p screen?Can someone suggest a workflow for transcoding videos in iPhoto from Motion-JPEG to something smaller?Problems with frame rate on video conversion using ffmpeg with libx264Converting RAW Blackmagic Intensity Card framesExtract Y-channel of every I-frame from MPEG4 movie as loslessly as possibleffmpeg segment by video-time instead of wall-timeMerging two videos while skipping common partsUsing a lossless video codec for archiving (monochrome) scientific video dataAdapting video for LaTeX with ffmpeg does not produce the expected resultFFmpeg filter for scene changeCan ffmpeg be used to reduce encoded file size back to original after OBS+VLC workflow?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
The following is mentioned in the ffmpeg documentation.
ffmpeg calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them...
Encoded packets are then passed to the decoder... The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed
further by filtering...
Does that mean that you can always extract the original large size videos from all the compressed formats/codecs like h.264?
video ffmpeg compression
New contributor
add a comment |
The following is mentioned in the ffmpeg documentation.
ffmpeg calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them...
Encoded packets are then passed to the decoder... The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed
further by filtering...
Does that mean that you can always extract the original large size videos from all the compressed formats/codecs like h.264?
video ffmpeg compression
New contributor
17
uncompressed != original
– Bergi
Apr 2 at 20:00
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
2
Aside 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
2 days ago
@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.
– mjustin
2 days ago
add a comment |
The following is mentioned in the ffmpeg documentation.
ffmpeg calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them...
Encoded packets are then passed to the decoder... The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed
further by filtering...
Does that mean that you can always extract the original large size videos from all the compressed formats/codecs like h.264?
video ffmpeg compression
New contributor
The following is mentioned in the ffmpeg documentation.
ffmpeg calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them...
Encoded packets are then passed to the decoder... The decoder produces
uncompressed frames (raw video/PCM audio/...) which can be processed
further by filtering...
Does that mean that you can always extract the original large size videos from all the compressed formats/codecs like h.264?
video ffmpeg compression
video ffmpeg compression
New contributor
New contributor
edited 2 days ago
mjustin
New contributor
asked Apr 2 at 10:10
mjustinmjustin
8715
8715
New contributor
New contributor
17
uncompressed != original
– Bergi
Apr 2 at 20:00
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
2
Aside 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
2 days ago
@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.
– mjustin
2 days ago
add a comment |
17
uncompressed != original
– Bergi
Apr 2 at 20:00
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
2
Aside 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
2 days ago
@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.
– mjustin
2 days ago
17
17
uncompressed != original
– Bergi
Apr 2 at 20:00
uncompressed != original
– Bergi
Apr 2 at 20:00
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
2
2
Aside 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
2 days ago
Aside 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
2 days ago
@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.
– mjustin
2 days ago
@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.
– mjustin
2 days ago
add a comment |
4 Answers
4
active
oldest
votes
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?
- No
- 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.
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
add a comment |
A short answer for codecs in general:
Any lossless codec like FLAC or ZIP can be reversed exactly.
Any lossy codec like JPEG or MP3 cannot be reversed exactly.
This principle is also valid for video codecs.
Here HuffYUV
is an example for a lossless video-codec.
And x264
is an example for a lossy video-codec.
1
Very nicely put.
– mjustin
2 days ago
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, butffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).
– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.
– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
add a comment |
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
No. You're misinterpreting that sentence.
You can't display compressed image, just as you can't read compressed text or read file compressed with ZIP without unpacking it first. To display any image, you have to somehow represent it uncompressed in memory, pixel-for-pixel.
This doesn't imply that the uncompressed image will be identical to original - this depends on codecs used. As far as I know there are no commonly used lossless codecs. Lossy codecs aim to represent original closely enough to make the uncompressed video indistinguishable under normal circumstances, ie. when played at predicted resolution and framerate. When looking at compressed stills (ie. framerate=0) you will certainly see artifacts, unless bitrate during compression is set impractically high (ie. producing too large output files) (this answer of mine is somehow related).
By the way, MP4 is only a file format, ie. it tells you how compressed data is stored in a file, but doesn't determine how it was compressed. MP4 can work with a variety of codecs. H.264 is probably the most popular video codec used with MP4, but don't quote me on that. Audio is usually compressed with AAC, I guess.
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
|
show 1 more comment
This is a very common blunder.
You can convert from a lossy format to a lossless format, but the damage is done.
The lossless output file will show all the damage (compromised details, added artifacts) that are the reason you don't like the lossy format. You can't get that back.
The only option is to contact the publisher and see if he still has the original lossless files, and would be willing to somehow upload them to you.
There's no such thing as an Enhance button. warning: TVtropes
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "3"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
mjustin is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420358%2fcan-compressed-videos-be-decoded-back-to-their-uncompresed-original-format%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
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?
- No
- 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.
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
add a comment |
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?
- No
- 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.
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
add a comment |
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?
- No
- 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.
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?
- No
- 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.
edited 2 days ago
Cody
1032
1032
answered Apr 2 at 11:01
AttieAttie
12.8k43547
12.8k43547
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
add a comment |
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
Comments are not for extended discussion; this conversation has been moved to chat.
– DavidPostill♦
Apr 2 at 22:17
4
4
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
re: chaining lossy codecs: The easiest way to understand this is that artefacts introduced by the first lossy codec become part of the "details" that the 2nd codec has to spend bits accurately reproducing. Any post-processing (like h.264's in-loop deblocking filter), or feeding one codec to another code, will smear out the ringing / blocking so it doesn't just become easy-to-quantize input for the next codec. (Like might happen with simple jpg -> jpg -> jpg or other simple codecs where stability might be reached.)
– Peter Cordes
Apr 3 at 4:11
3
3
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
@opa US vs UK spelling differences do not merit editing.
– mbrig
2 days ago
add a comment |
A short answer for codecs in general:
Any lossless codec like FLAC or ZIP can be reversed exactly.
Any lossy codec like JPEG or MP3 cannot be reversed exactly.
This principle is also valid for video codecs.
Here HuffYUV
is an example for a lossless video-codec.
And x264
is an example for a lossy video-codec.
1
Very nicely put.
– mjustin
2 days ago
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, butffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).
– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.
– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
add a comment |
A short answer for codecs in general:
Any lossless codec like FLAC or ZIP can be reversed exactly.
Any lossy codec like JPEG or MP3 cannot be reversed exactly.
This principle is also valid for video codecs.
Here HuffYUV
is an example for a lossless video-codec.
And x264
is an example for a lossy video-codec.
1
Very nicely put.
– mjustin
2 days ago
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, butffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).
– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.
– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
add a comment |
A short answer for codecs in general:
Any lossless codec like FLAC or ZIP can be reversed exactly.
Any lossy codec like JPEG or MP3 cannot be reversed exactly.
This principle is also valid for video codecs.
Here HuffYUV
is an example for a lossless video-codec.
And x264
is an example for a lossy video-codec.
A short answer for codecs in general:
Any lossless codec like FLAC or ZIP can be reversed exactly.
Any lossy codec like JPEG or MP3 cannot be reversed exactly.
This principle is also valid for video codecs.
Here HuffYUV
is an example for a lossless video-codec.
And x264
is an example for a lossy video-codec.
edited 2 days ago
Solomon Ucko
1013
1013
answered Apr 2 at 22:08
zx485zx485
1,3691914
1,3691914
1
Very nicely put.
– mjustin
2 days ago
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, butffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).
– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.
– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
add a comment |
1
Very nicely put.
– mjustin
2 days ago
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, butffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).
– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.
– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
1
1
Very nicely put.
– mjustin
2 days ago
Very nicely put.
– mjustin
2 days ago
1
1
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, but
ffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).– llogan
2 days ago
To nitpick, you are mixing up some codecs (an encoder/decoder) and formats (what a codec outputs, or more specifically what an encoder outputs). To add to the confusion sometimes they can share the same name, and people use the term "codec" loosely. JPEG and MP3 are formats. LAME is an encoder that outputs MP3. FLAC is a format, but
ffmpeg
has a FLAC encoder/decoder (codec) named flac. x264 is an encoder that produces the H.264 video format (and to top it off x264 can output both lossy and lossless H.264).– llogan
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
@llogan: Thank you for your clarification, it is surely helpful.
– zx485
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting
[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.– Marc.2377
2 days ago
There is an interesting note to be made: h.264 does have a true lossless encoding setting
[2]
[3]
. It is of course not very common to see it in use in the real world, though, as it doesn't make much sense for the vast majority of applications.– Marc.2377
2 days ago
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
@Marc.2377: That's interesting, but as you said, it's an exception.
– zx485
yesterday
add a comment |
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
No. You're misinterpreting that sentence.
You can't display compressed image, just as you can't read compressed text or read file compressed with ZIP without unpacking it first. To display any image, you have to somehow represent it uncompressed in memory, pixel-for-pixel.
This doesn't imply that the uncompressed image will be identical to original - this depends on codecs used. As far as I know there are no commonly used lossless codecs. Lossy codecs aim to represent original closely enough to make the uncompressed video indistinguishable under normal circumstances, ie. when played at predicted resolution and framerate. When looking at compressed stills (ie. framerate=0) you will certainly see artifacts, unless bitrate during compression is set impractically high (ie. producing too large output files) (this answer of mine is somehow related).
By the way, MP4 is only a file format, ie. it tells you how compressed data is stored in a file, but doesn't determine how it was compressed. MP4 can work with a variety of codecs. H.264 is probably the most popular video codec used with MP4, but don't quote me on that. Audio is usually compressed with AAC, I guess.
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
|
show 1 more comment
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
No. You're misinterpreting that sentence.
You can't display compressed image, just as you can't read compressed text or read file compressed with ZIP without unpacking it first. To display any image, you have to somehow represent it uncompressed in memory, pixel-for-pixel.
This doesn't imply that the uncompressed image will be identical to original - this depends on codecs used. As far as I know there are no commonly used lossless codecs. Lossy codecs aim to represent original closely enough to make the uncompressed video indistinguishable under normal circumstances, ie. when played at predicted resolution and framerate. When looking at compressed stills (ie. framerate=0) you will certainly see artifacts, unless bitrate during compression is set impractically high (ie. producing too large output files) (this answer of mine is somehow related).
By the way, MP4 is only a file format, ie. it tells you how compressed data is stored in a file, but doesn't determine how it was compressed. MP4 can work with a variety of codecs. H.264 is probably the most popular video codec used with MP4, but don't quote me on that. Audio is usually compressed with AAC, I guess.
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
|
show 1 more comment
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
No. You're misinterpreting that sentence.
You can't display compressed image, just as you can't read compressed text or read file compressed with ZIP without unpacking it first. To display any image, you have to somehow represent it uncompressed in memory, pixel-for-pixel.
This doesn't imply that the uncompressed image will be identical to original - this depends on codecs used. As far as I know there are no commonly used lossless codecs. Lossy codecs aim to represent original closely enough to make the uncompressed video indistinguishable under normal circumstances, ie. when played at predicted resolution and framerate. When looking at compressed stills (ie. framerate=0) you will certainly see artifacts, unless bitrate during compression is set impractically high (ie. producing too large output files) (this answer of mine is somehow related).
By the way, MP4 is only a file format, ie. it tells you how compressed data is stored in a file, but doesn't determine how it was compressed. MP4 can work with a variety of codecs. H.264 is probably the most popular video codec used with MP4, but don't quote me on that. Audio is usually compressed with AAC, I guess.
Does that mean that you can always extract the original large size videos from all the compressed formats like mp4?
No. You're misinterpreting that sentence.
You can't display compressed image, just as you can't read compressed text or read file compressed with ZIP without unpacking it first. To display any image, you have to somehow represent it uncompressed in memory, pixel-for-pixel.
This doesn't imply that the uncompressed image will be identical to original - this depends on codecs used. As far as I know there are no commonly used lossless codecs. Lossy codecs aim to represent original closely enough to make the uncompressed video indistinguishable under normal circumstances, ie. when played at predicted resolution and framerate. When looking at compressed stills (ie. framerate=0) you will certainly see artifacts, unless bitrate during compression is set impractically high (ie. producing too large output files) (this answer of mine is somehow related).
By the way, MP4 is only a file format, ie. it tells you how compressed data is stored in a file, but doesn't determine how it was compressed. MP4 can work with a variety of codecs. H.264 is probably the most popular video codec used with MP4, but don't quote me on that. Audio is usually compressed with AAC, I guess.
edited 2 days ago
answered 2 days ago
gronostajgronostaj
29.2k1472108
29.2k1472108
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
|
show 1 more comment
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
@Attie Now bold "original"
– Lightness Races in Orbit
2 days ago
1
1
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
@Attie I'm interpreting "original", "large size" in OP's question as "lossless"
– gronostaj
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
Well, I get to understand that if the compression is lossless and is the first transcoding from the original (not concatenated), you can always decode and encode it back to the original pixel by pixel video, but not from a lossy format.
– mjustin
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@mjustin Exactly. What they mean is that decoder produces some uncompressed frames, not necessarily identical to original.
– gronostaj
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
@gronostaj But if the decoder is decoding from an uncompressed lossless format, then the result should be identical to the original ones, pixel by pixel. That's what I understood.
– mjustin
2 days ago
|
show 1 more comment
This is a very common blunder.
You can convert from a lossy format to a lossless format, but the damage is done.
The lossless output file will show all the damage (compromised details, added artifacts) that are the reason you don't like the lossy format. You can't get that back.
The only option is to contact the publisher and see if he still has the original lossless files, and would be willing to somehow upload them to you.
There's no such thing as an Enhance button. warning: TVtropes
add a comment |
This is a very common blunder.
You can convert from a lossy format to a lossless format, but the damage is done.
The lossless output file will show all the damage (compromised details, added artifacts) that are the reason you don't like the lossy format. You can't get that back.
The only option is to contact the publisher and see if he still has the original lossless files, and would be willing to somehow upload them to you.
There's no such thing as an Enhance button. warning: TVtropes
add a comment |
This is a very common blunder.
You can convert from a lossy format to a lossless format, but the damage is done.
The lossless output file will show all the damage (compromised details, added artifacts) that are the reason you don't like the lossy format. You can't get that back.
The only option is to contact the publisher and see if he still has the original lossless files, and would be willing to somehow upload them to you.
There's no such thing as an Enhance button. warning: TVtropes
This is a very common blunder.
You can convert from a lossy format to a lossless format, but the damage is done.
The lossless output file will show all the damage (compromised details, added artifacts) that are the reason you don't like the lossy format. You can't get that back.
The only option is to contact the publisher and see if he still has the original lossless files, and would be willing to somehow upload them to you.
There's no such thing as an Enhance button. warning: TVtropes
answered 2 days ago
HarperHarper
45915
45915
add a comment |
add a comment |
mjustin is a new contributor. Be nice, and check out our Code of Conduct.
mjustin is a new contributor. Be nice, and check out our Code of Conduct.
mjustin is a new contributor. Be nice, and check out our Code of Conduct.
mjustin is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1420358%2fcan-compressed-videos-be-decoded-back-to-their-uncompresed-original-format%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
17
uncompressed != original
– Bergi
Apr 2 at 20:00
Yeah, and the question is about reversing the uncompressed to it's original; which has been explained and discussed in the answers.
– mjustin
Apr 3 at 3:36
2
Aside 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
2 days ago
@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.
– mjustin
2 days ago