https://github.com/jordicenzano/h264simplecoder
Converts a video YUV420p file to a h264 compliant stream. It Is NOT a video coder.
https://github.com/jordicenzano/h264simplecoder
encoder h264 video
Last synced: 6 months ago
JSON representation
Converts a video YUV420p file to a h264 compliant stream. It Is NOT a video coder.
- Host: GitHub
- URL: https://github.com/jordicenzano/h264simplecoder
- Owner: jordicenzano
- Created: 2014-08-31T19:01:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T16:32:17.000Z (over 5 years ago)
- Last Synced: 2025-03-26T07:11:15.823Z (7 months ago)
- Topics: encoder, h264, video
- Language: C++
- Homepage: http://jordicenzano.name/2014/08/31/the-source-code-of-a-minimal-h264-encoder-c/
- Size: 11.7 KB
- Stars: 33
- Watchers: 4
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
h264simpleCoder
===============With the aim to improve my understanding of h264 bitstream and its techniques I have created the following code in C++ that generates a compliant h264 file from a YUV420p file.
First of all I have to say that the following source code is NOT a h264 encoder but it generates a compliant (playable) h264 stream, this means that the size of output file will be slightly bigger than the size of the input file. This it is because I have used only I_PCM macroblock codification (non compressed format) to describe the images in h264 stream.
I think that to read and understand this code could be a good starting point to start flirting with the h264 standard, better than dive into the standard (more than 700 pages of dense text).
Usage example:
> h264simpleCoder AVsyncTest.yuv OutTest.h264 128 96 25 16 9
More information on: http://jordicenzano.name/2014/08/31/the-source-code-of-a-minimal-h264-encoder-c/
Generating a YUV file
A 10 second yuv file (SQCIF 128x96) with a test image can be made with this ffmpeg command
> ffmpeg -f lavfi -i testsrc -t 10 -s sqcif -pix_fmt yuv420p AVsyncTest.yuv