[FFmpeg-user] pict_type="I"

Mark Filipak markfilipak.imdb at gmail.com
Wed Jul 17 05:21:07 EEST 2024


On 16/07/2024 07.40, Oliver Fromme wrote:
> Mark Filipak wrote:
>   > Since 00305.m2ts is AVC encoded, there are I slices in it but not I frames -- I P & B frames are
>   > MPEG-1 & MPEG-2.
> 
> That's not completely correct.  I suggest you read a bit about
> basic concepts and terminology of H.264 (AVC).  I'll try to
> summarize it:

Thank you for your summary, Oliver. That has really, really helped. As you know, H.264 is 
prescriptive, not descriptive, which makes understanding it very difficult.

It also lacks the strings: "I[- ]frame" "P[- ]frame" "B[- ]frame" "I[- ]picture" "P[- ]picture" "B[- 
]picture" and "GOP.+".

I've taken my 40 second clip of a Criterion mastered video and am trying to parse it. The TS packets 
are 192 bytes.

May I ask some questions?

What are the 4 bytes, 0..3, that precede the 0x47 sync byte? I can't find any documentation on them. 
What can you tell me?

======================================| (unknown)__ TS_HEADER__ TS_PAYLOAD___..
   0..3   unknown                      | HH HH HH HH
--------------------------------------| TS_HEADER__
   4..7                                | 47 HH HH HH
   4      sync_byte                    | 47 == == ==
                                       | == HH HH H=
                                       | .——'     '—————————————.
   5      transport_error_indicator    | b--- ---- ---- ---- ---- //1
          payload_unit_start_indicator | -b-- ---- ---- ---- ---- //2
          transport_priority           | --b- ---- ---- ---- ---- //3
   5..6   PID (Packet Identifier)      | ---b bbbb bbbb bbbb ---- //4
   7      transport_scrambling_control | ---- ---- ---- ---- bb-- //5
          adaptation_field_control     | ---- ---- ---- ---- --bb //6
          continuity_counter           | == == == =H              //0..15, cycles
--------------------------------------| TS_PAYLOAD___..
   8..191 data_byte                    | HH ..
======================================|

   1, 0,none..1,transport reports an error
   2, 0,payload continuing..1,payload starting
   3, 0,none..1,for this PID, this packet has priority over those with '0' transport_priority
   4, 0,PAT..1,CAT..2,TS description table..3,IPMP..4..15,(reserved)..16..8190,network_PID 
Program_map_PID elementary_PID or other..8191,packet is null -- may also convey PCR
   5, 0,payload is not scrambled..1..3,(user-defined)
   6, 0,(reserved)..1,has payload..2,has adaptation..3,has adaptation..payload

There is a variable number of bytes between the tags above and the first start code (that is, if 
there is a start code). Do you know what those bytes are?

References or links will be okay of course--Mark.


> H.264 (AVC) has I-frames, too.  These frames may use only spatial
> prediction, i.e. they contain only intra-predicted macroblocks.
> P-frames and B-frames may use both spatial and temporal prediction,
> i.e. they contain inter-predicted and intra-predicted macroblocks
> (where P-frames are restricted to forward prediction, and B-frames
> may use both forward and backward prediction).
> 
> Note that a slice is basically just a group of macroblocks that
> describe a certain region of a frame and share some common
> properties.  For example, an "I-slice" is a group of macroblocks
> that use only spatial prediction.  And an I-frame contains only
> intra-predicted slices (I-slices), while a P-frame may contain
> P-slices and I-slices, and a B-frame may contain all three types
> of slices.
> 
> Finally, there are IDR-frames.  These are I-frames that signify
> a closed GOP.  That is, temporal predictions may not cross the
> boundary of an IDR-frame.  I-frames that are part of an open GOP
> are not IDR-frames.
> 
> Best regards
>   -- Oliver
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list