Jump to content

Inter-frame- vs. Intra-frame compression

.spider.

Today someone posted a misconception about intra-frame compression, namely an advantage in quality. I think that's a very popular myth so I ran a quick analysis. 

As you can see quality improves a lot with longer gop (inter-frame compression) for a given datarate.  

 

 

Untitled-1.png

 

The only advantage of intra-frame compression is frame accurate cutting without reencoding and it is to some extend easier to decode. 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, wrathoftheturkey said:

What's signal-to-noise ratio? Is that a measure of jaggies?

Not jaggies, those are normally caused by a low resulution, but banding and other compress arfitacts.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, M.Yurizaki said:

Correct me if I'm wrong...

 

But isn't "inter frame" a type of encoding schema while "intra frame" something as part of that encoding schema? So this title isn't making sense to me.

Both are compression methods for video.  A video is basically made up of frames that play back at a certain number of frames per second.  Each frame is an image.

 

Interframe compresses each frame based on the information contained in the frames before and after.  It groups a certain number of frames together before compressing.

Intraframe compresses each frame individually, ignoring whatever is happening in adjacent frames.

http://www.leckman.com/articles/codecs_05.html

 

What the OP said is based on only theory without practice.  In reality,

  • Camera manufacturers that design cameras which allow the camera operator to select the type of codec or compression method in camera usually design it this way:
    • If the camera supports both Intraframe and Interframe compression codecs, the Intraframe version will always record with a higher bit rate.
    • Which means given a certain capacity memory card, selecting Intraframe compression in camera means the camera operator can record less video duration than if he/she had selected to use Interframe compression.
      • An example is a camera like the Sony FS7 which lets the camera operator choose between XAVC-I (Intraframe) and XAVC-L (Long GOP, Interframe).  4K 60p on a single 128GB memory card, with XAVC-I you get approximately 30 minutes of recording time, with XAVC-L you get a little bit over double that amount of recording time.
  • Second, people who work in video production know the pros and cons of Intraframe and Interframe and understand how to handle various compression methods.

Intraframe does not have a quality advantage if the video has the same bit rate as the Interframe version, it may even look worse.  However only a fool would use Intraframe and set the encoding to the same (as Interframe) or too low a bit rate.

 

Interframe Compression
Pros:

  • Can achieve similar picture quality at lower bit rate than Intraframe if there's not too much motion - as bit rate lowers, it affects primarily motion quality, not image quality
  • Can take advantage of multipass approaches to really optimize compression (but, in general, not during acquisition)

Cons:

  • Picture quality is not consistent between frames - especially with lots of motion in the frame (or at scene changes), the picture may fall apart for a few frames.
  • Editing is harder and may introduce some quality loss at edit points


Intraframe Compression
Pros:

  • Consistent image quality from frame to frame, regardless of motion/scene changes
  • Easier editing without Interframe compression quality loss issues

Cons:

  • As bit rate lowers, it affects image quality of all video, regardless of motion, so bit rates tend to be higher


Or, in brief, for a given bit rate, Intraframe compression prioritizes consistency and motion quality, while Interframe prioritizes image quality (when there is not that much motion going on in the scene).

 

EDIT:

If you take already compressed footage and re-encode it to Interframe and Interframe versions to do any comparison tests, it's a pointless test.  But if you take something like a video that was filmed in Cinema RAW (e.g. RED RAW) and compare between it being transcoded to ProRes 422 which is going to be Intraframe vs encoding it to H.264 Interframe profile, guess which one is going to be better.

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

44 minutes ago, M.Yurizaki said:

 

Here's a mantra that's generally followed by professional DPs and Cinematographers, if you don't have access to Cinema RAW.

"Intraframe for acquisition, Interframe for distribution."

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, AkiraDaarkst said:

Interframe Compression
Pros:

  • Can achieve similar picture quality at lower bitrate than Intraframe if there's not too much motion - as bitrate lowers, it affects primarily motion quality, not image quality

Interframe will always be better even at very high motion scenes

 

Quote

Can take advantage of multipass approaches to really optimize compression (but, in general, not during acquisition)

Multipass is not used for optimizing the compression it is used for encodings which need an exact bitrate 

 

Quote

Picture quality is not consistent between frames - especially with lots of motion in the frame (or at scene changes), the picture may fall apart for a few frames.

That's pretty wrong. Picture quality is never consistent and most encoders are having psy optimizations. 

 

Quote

Editing is harder and may introduce some quality loss at edit points

There's no quality loss  if the intermediate codec is lossless. 

 

Quote

Consistent image quality from frame to frame, regardless of motion/scene changes

Motion/scene changes are no the only factor for image complexity. 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, wrathoftheturkey said:

What's signal-to-noise ratio? Is that a measure of jaggies?

It's basically the difference of two signals (images)

The higher the value the lower the difference between to signals.

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, AkiraDaarkst said:

Here's a mantra that's generally followed by professional DPs and Cinematographers, if you don't have access to Cinema RAW.

"Intraframe for acquisition, Interframe for distribution."

A mantra that got stuck in someone's head from the good old MPEG2 days.

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, .spider. said:

Interframe will always be better even at very high motion scenes

 

27 minutes ago, .spider. said:

A mantra that got stuck in someone's head from the good old MPEG2 days.

Do you or have you filmed with anything more advanced than a DSLR?  In fact, do you actually work in video production at all?

 

Because if all you use is a DSLR to film, only then is your statement about Interframe being better than Intraframe true.  DSLRs (most of them anyway) film internally to an Interframe compressed codec.  It's pointless to take the file from the memory card and transcode it into an Intraframe format.  The only advantage it may give to transcode DSLR Interframe to Intraframe would probably be to get better computer performance during editing.

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

45 minutes ago, AkiraDaarkst said:

-Snip-

I'm going to say I took a digital media class in college, so I learned about how JPEG and MPEG-2 work (in theory).

 

So all I'm getting is Interframe compression is using just the I-frames and whatever image compression method you want to compress it. Like I dunno, MJPEG. Intraframe compression is using I-frames plus P-frames and B-frames if you're using B-frames.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, M.Yurizaki said:

So all I'm getting is Interframe compression is using just the I-frames and whatever image compression method you want to compress it. Like I dunno, MJPEG. Intraframe compression is using I-frames plus P-frames and B-frames if you're using B-frames.

Intraframe is I-frame only, where every frame is an I-frame.  Interframe should be the one that looks at adjacent frames (i.e. P and B frames).

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, AkiraDaarkst said:

 

Do you or have you filmed with anything more advanced than a DSLR?  In fact, do you actually work in video production at all?

 

 

Yes, did you? I doubt it.

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, .spider. said:

Yes, did you? I doubt it.

Which one(s), a 20 year old camcorder?

I own several cinema camera systems, and have worked with a number more.

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, AkiraDaarkst said:

Which one(s), a 20 year old camcorder?

I own several cinema camera systems, and have worked with a number more.

Ok, discussion with you is useless you are the one and only true professional.

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, .spider. said:

 

Any discussion is really pointless, especially with you.  You don't seem to have any real experience to actually understand anything I say.  And even worse, you make a statement like this.

 

11 hours ago, .spider. said:

Interframe will always be better even at very high motion scenes

No, Interframe will not always be better.  There are times Interframe can be better and there are times when Intraframe will be better.  It depends on when and where it is being used.

 

Intraframe is generally better for acquisition if you plan to do a lot of heavy editing because each frame is basically a keyframe.  Each frame is independent of any adjacent frame.  That's why it can be considered to be the next best thing to Cinema RAW where each frame is an individual file.  This is also why a single frame grab from an Intraframe clip can generally be better than a frame grab from an Interframe clip, because unless you hit the I-frame, the P or B frames being grabbed will have to extrapolate missing data from the neighboring frames.

 

Interframe is better if you can get many of the things already correct in camera or if you are filming a scene with very little motion.  It saves storage space.

 

Quality differences will also depend on how the camera manufacturer implements the compression.  If the manufacturer implements Intraframe badly, it will look worse than Interframe.

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, AkiraDaarkst said:

 

Intraframe is generally better for acquisition if you plan to do a lot of heavy editing because each frame is basically a keyframe.  Each frame is independent of any adjacent frame.  That's why it can be considered to be the next best thing to Cinema RAW where each frame is an individual file.  This is also why a single frame grab from an Intraframe clip can generally be better than a frame grab from an Interframe clip, because unless you hit the I-frame, the P or B frames being grabbed will have to extrapolate missing data from the neighboring frames.

Even if you'll say it 1000 times more.

It's still wrong

Link to comment
Share on other sites

Link to post
Share on other sites

17 hours ago, AkiraDaarkst said:


Intraframe Compression
Pros:

  • Consistent image quality from frame to frame, regardless of motion/scene changes

stdev(psnrhvsm(inter.gop72))= 16.88 dB

stdev(psnrhvsm(intra))= 18.25 dB

 

stdev(psnr(inter,gop72))= 7.32 dB

stdev(psnr(intra))= 9.93 dB

 

nope, standard deviation of intra-frame compression is higher 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, .spider. said:

stdev(psnrhvsm(inter.gop72))= 16.88 dB

stdev(psnrhvsm(intra))= 18.25 dB

 

stdev(psnr(inter,gop72))= 7.32 dB

stdev(psnr(intra))= 9.93 dB

 

nope, standard deviation of intra-frame compression is higher 

 

What samples are you using and what's the data rate of the samples?

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, AkiraDaarkst said:

What samples are you using and what's the data rate of the samples?

1400 frames from "tears of steel" 5 mbit/s 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, .spider. said:

1400 frames from "tears of steel" 5 mbit/s 

So you're comparing footage that's already compressed.  That's just fucking retarded.

 

Why don't you try comparing Intraframe and Interframe compression footage from a camera that has both types of compression?

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, AkiraDaarkst said:

So you're comparing footage that's already compressed.  That's just fucking retarded.

It doesn't matter because the quality of the source is much higher!

 

Quote

Why don't you try comparing Intraframe and Interframe compression footage from a camera that has both types of compression?

If you would know what you are talking about you'd understand that this approach isn't possible because you can not feed the exact same bit-identical data twice through the camera's encoder. That's a ridiculous and retarded idea. 

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, .spider. said:

It doesn't matter because the quality of the source is much higher!

 

If you would know what you are talking about you'd understand that this approach isn't possible because you can not feed the exact same bit-identical data twice through the camera's encoder. That's a ridiculous and retarded idea. 

 

1. You can film the same scene twice, with the same camera, but different compression types. For example, Sony XAVC-I and XAVC-L.

2. I think you've just proven you don't have any actual experience with a professional camera, or actually working as a cinematographer.

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, AkiraDaarkst said:

1. You can film the same scene twice, with the same camera, but different compression types. For example, Sony XAVC-I and XAVC-L.

2. I think you've just proven you don't have any actual experience with a professional camera, or actually working as a cinematographer.

1. Noise, do you know noise? Did you know that noise is totally random? Do you really want to tell me that multiple recordings of the same scene are bit-identical? Are you joking?

2. I think you've just proven you don't have any actual experience in image processing, physics, image analysis and video compression..

Link to comment
Share on other sites

Link to post
Share on other sites

46 minutes ago, .spider. said:

1400 frames from "tears of steel" 5 mbit/s 

Okey, I'm not a pro at any of this stuff but shouldn't RAW footage be used for comparisons like this? An already compressed video will have discared important information and probably made the footage better suit one type of compression? And isn't 5mbit/s quite low for something like this?

 

Isn't this like taking a 60fps clip, exporting it in 24fps and then trying to scale it up to 60fps again and expecting you to get the full 60fps you had from the start? 

 

Sure I don't know that much on video compression and so on but I do know that you have to be very careful in every scientifc study you do as I have done lots of physics and chemistry labs. Firstly you should start with a theory, then back it up with mathematical or similar proofs and then finally do several experiments to prove it. You should state how you do it, what you use (this is very important so other can do the tests themselves to verify the "discovery". You should have exact numbers and hardware and material specs). No offence but to me this seems poorly made and has a nothing to really back it up as it lacks a lot of info and proper techniques to actually prove something. (Several video sources and different recording formats for example?)

FX-8350 GTX760 16GB RAM 250GB SSD + 1TB HDD

 

"How many roads must a man walk down?" "42"

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, xQubeZx said:

 

Isn't this like taking a 60fps clip, exporting it in 24fps and then trying to scale it up to 60fps again and expecting you to get the full 60fps you had from the start? 

 

No

 

18 minutes ago, xQubeZx said:

No offence but to me this seems poorly made and has a nothing to really back it up as it lacks a lot of info and proper techniques to actually prove something. (Several video sources and different recording formats for example?)

Nobody is stopping you from doing your own analysis. 

 

Quote

And isn't 5mbit/s quite low for something like this?

I think 5mbit/s is reasonable for 36.8Mpix/s

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×