angelsla.blogg.se

Vcodec h264
Vcodec h264






Coded Macroblock Data: The actual coded video for the macroblock.Picture Parameter Set (PPS): Once per stream.Sequence Parameter Set (SPS): Once per stream.With that background in mind, for our simplest possible encoder, there are three NALs we have to emit: For this simple encoder, I won’t be compressing the video data at all, so the samples will be directly copied into the H.264 output. Each macroblock in our 4:2:0 sampling scheme contains 16×16 luma samples, and two 8×8 blocks of chroma samples.

vcodec h264

In our encoder we will use one slice per frame for simplicity, and we will use all I-frames.Īs with previous MPEG specifications, in H.264 each slice consists of one or more 16×16 macroblocks. This feature can be used in creative ways to achieve different video coding goals. It allows individual frames to be coded as multiple slices, each of which can be of type I, P, or B or even more esoteric types. Previous MPEG specifications allowed pictures to be coded as I-frames, P-frames, or B-frames. To structure this data, the bitstream consists of a sequence of Network Abstraction Layer (NAL) units.

vcodec h264

An H.264 stream contains the encoded video data along with various parameters needed by a decoder in order to decode the video data. While I don’t want to balloon this blog post with a detailed description of H.264, a little background is in order. I was able to do it in about 30 lines of code - although truth in advertising compels me to admit that it doesn’t actually compress the video at all! But all that sophistication comes at a price: H.264 also has a big, complicated specification with a plethora of options, many of which are not commonly used, and it takes expertise to understand which parts are important to solve a given problem.Īs a bit of a parlor trick, I decided to write the simplest possible H.264 encoder. H.264 a much more sophisticated codec than MPEG-2, which means that a well-implemented H.264 encoder has more compression tools at its disposal than the equivalent MPEG-2 encoder.

vcodec h264 vcodec h264

Recently I have been studying the H.264 video codec and reading the ISO spec.








Vcodec h264