This repo contains several application or tools related to H264 standard
This maybe the smallest H264 encoder sample in the world.
You can visit here for details.
-
Build the code
gcc -Wall -ansi Hello264.c -o hello264
-
Perpare the necessary input(YUV rawdata)
ffmpeg -i <input_compressed_clip> -s sqcif -pix_fmt yuv420p angel.yuv
For a convenient, I already upload a yuv pic with 16 sqcif frames.
-
Run it
hello264 < angel.yuv > angel.264
After step 3, you can got your encoded file angle.264 which is larger than the input. Cause in this Encoder, we don't compress anything at all.
This is a simple method to calculate the aligned width/height
-
Build the code
gcc RoundTo.c -o RoundTo
-
Run the binary
./RounTo
Please input the parameters as: ori_width ori_height width_alignment height_alignment
<User Input>176 144 64 32
<Output>aligned_width = 192 aligned_height = 160