User Tools

Site Tools


using:b-frames

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
using:b-frames [2010/04/13 19:57]
meanadmin created
using:b-frames [2012/11/11 08:51] (current)
Line 1: Line 1:
- +====== B-frames ======
-===== Introduction ​=====+
  
 This chapter is an introduction to B-frame handling. If you are familiar with the concepts you can safely skip it.  This chapter is an introduction to B-frame handling. If you are familiar with the concepts you can safely skip it. 
Line 6: Line 5:
 Video frames can be divided among 3 types: Video frames can be divided among 3 types:
  
-;[[I-frames|I-Frame]]:​ Intra frame, also called keyframe. They have no reference frame and can be decoded on their own. They can be thought of as a JPEG image. +  - **[[I-frames|I-Frame]]:​** Intra frame, also called keyframe. They have no reference frame and can be decoded on their own. They can be thought of as a JPEG image. 
- +  - **P-Frame:** Predicted frame. They are deduced from the previous frame (I or P) and cannot be built if the decoder has not decoded the previous frames. 
-;P-Frame: Predicted frame. They are deduced from the previous frame (I or P) and cannot be built if the decoder has not decoded the previous frames. +  - **B-Frame:** They are decoded from the previous and next I-P frames. ​
- +
-;B-Frame: They are decoded from the previous and next I-P frames. ​+
  
 B-frames are interesting for two facts. First, they have a slightly better prediction. And second and more important, they do not impact the quality of following frames, so they can be encoded with lower quality without degrading the whole sequence. B-frames are interesting for two facts. First, they have a slightly better prediction. And second and more important, they do not impact the quality of following frames, so they can be encoded with lower quality without degrading the whole sequence.
  
-Since B-frames depend on both past and future picture, the decoder has to be fed with future I-P frames before being able to decode them. +Since B-frames depend on both past and future picture, the decoder has to be fed with future I-P frames before being able to decode them. There comes the PTS/DTS logic.
- +
-There comes the PTS/DTS logic+
- +
-Presentation Time Stamp is the presentation time, it could be thought of as display frame number. It is the order you will see the decoded frames+
  
-The DTS is the Decoder Time Stamp, i.e. the decoding frame number.+Presentation Time Stamp is the presentation time, it could be thought of as display frame number. It is the order you will see the decoded frames. ​The DTS is the Decoder Time Stamp, i.e. the decoding frame number.
  
 Assume if you have a short video like this: Assume if you have a short video like this:
Line 30: Line 23:
 <​code>​I-0 P-3 B-1 B-2</​code>​ <​code>​I-0 P-3 B-1 B-2</​code>​
  
-To keep thing simple, the file is encoded with DTS order.+To keep things ​simple, the file is encoded with DTS order.
  
 ===== The problem ===== ===== The problem =====
Line 68: Line 61:
 In the MPEG way, there is a delay between what's fed to the codec and what's out. It is not acceptable as you would never know which actual frame your are looking at. In the MPEG way, there is a delay between what's fed to the codec and what's out. It is not acceptable as you would never know which actual frame your are looking at.
  
-The DivX/XviD way is tricky because frames 2, 3, 4 are seen a null frame and we cannot cut such a stream with frame accuracy.+The DivX/Xvid way is tricky because frames 2, 3, 4 are seen a null frame and we cannot cut such a stream with frame accuracy.
  
 ===== The solution ===== ===== The solution =====
Line 74: Line 67:
 Avidemux handles the PTS/DTS logic itself and forces the codec to popout the frames immediately. The editor part of Avidemux knows the DTS/PTS order of the frames and feeds the decoder correctly. You have frame accuracy and B-frames. ​ Avidemux handles the PTS/DTS logic itself and forces the codec to popout the frames immediately. The editor part of Avidemux knows the DTS/PTS order of the frames and feeds the decoder correctly. You have frame accuracy and B-frames. ​
  
-The problem is that DivX and XviD hide the frame type by packing them, so the editor cannot deal with that for now.+The problem is that DivX and Xvid hide the frame type by packing them, so the editor cannot deal with that for now.
  
 From Avidemux 2.0.24 and afterward, the packed bitstream is automatically unpacked upon loading. But only for AVI/​OpenDML. If the source is an OGM file, first save it as an AVI and reload. From Avidemux 2.0.24 and afterward, the packed bitstream is automatically unpacked upon loading. But only for AVI/​OpenDML. If the source is an OGM file, first save it as an AVI and reload.
Line 80: Line 73:
 ===== See also ===== ===== See also =====
  
-[[I-frames]] ​a discussion of I-frames and their role in digital video.+[[I-frames]](nbsp)(ndash) ​a discussion of I-frames and their role in digital video.
  
using/b-frames.1271181459.txt.gz · Last modified: 2012/11/11 08:51 (external edit)