H.264编码
- 一、H.264编码实验
-
- 1.1 H.264文件解码得到YUV文件
- 1.1 YUV文件编码得到H.264文件(GOP=15,2B)
- 1.2 YUV文件编码得到H.264文件(GOP=1,全I帧)
- 1.3 YUV文件编码得到H.264文件(GOP=15,2B帧,码率修改)
- 1.4 用码流分析软件检查所生成的码流中各种编码模式和运动矢量等信息
- 1.5 用播放器观看所生成码流的质量【改变GOP组长度和B帧】
-
- 1.5.1 GOP=15,2B帧,1000kb/s
- 1.5.2 GOP=12,2B帧,1000kb/s
- 1.5.3 GOP=9,2B帧,1000kb/s
- 1.5.4 GOP=12,1B帧,1000kb/s
- 1.5.5 GOP=12,无B帧,1000kb/s
- 1.5.6 GOP=1,全I帧,1000kb/s
- 1.5.7 GOP=15,2B帧,800kb/s
- 1.5.8 GOP=15,2B帧,400kb/s
- 1.5.9 GOP=12,2B帧,800kb/s
- 1.5.10 GOP=12,2B帧,400kb/s
- 1.5.11 GOP=9,2B帧,800kb/s
- 1.5.12 GOP=9,2B帧,400kb/s
- 1.5.13 GOP=12,1B帧,800kb/s
- 1.5.14 GOP=12,1B帧,400kb/s
- 1.5.15 GOP=12,无B帧,800kb/s
- 1.5.16 GOP=12,无B帧,400kb/s
- 1.5.17 GOP=1,全I帧,800kb/s
- 1.5.18 GOP=1,全I帧,400kb/s
- 1.5.19 码流不同时播放器质量
- 1.5.20 GOP组长度不同时播放器质量
- 1.5.21 B帧长度不同时播放器质量
- 1.6 生成率失真曲线
- 二、H.264编码原理
一、H.264编码实验
1.1 H.264文件解码得到YUV文件
1. 将MP4格式文件转成264文件
MP4to264
2. 将264文件进行解码得到YUV文件
修改decoder.cfg文件中的输入文件和输出文件。
InputFile = "mov.264" # H.264/AVC coded bitstream
OutputFile = "mov.yuv" # Output file, YUV/RGB
3. 实验结果
MP4和yuv截取的帧并不是同一帧。命令行代码为ldecod.exe -d decoder.cfg
| mov.mp4 | mov.yuv | trailer.mp4 | trailer.yuv |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
1.1 YUV文件编码得到H.264文件(GOP=15,2B)
以上文中生成的mov.yuv作为实验材料。命令行代码为lencod.exe -d encoder.cfg
修改配置文件修改encoder.cfg。
...
##########################################################################################
# Files
##########################################################################################
InputFile = "mov.yuv" # Input sequence
InputHeaderLength = 0 # If the inputfile has a header, state it's length in byte here
StartFrame = 0 # Start frame for encoding. (0-N)
FramesToBeEncoded = 30 # Number of frames to be coded
...
SourceWidth = 320 # Source frame width
SourceHeight = 176 # Source frame height
SourceResize = 0 # Resize source size for output
OutputWidth = 320 # Output frame width
OutputHeight = 176 # Output frame height
...
ReconFile = "mov_test1_rec.yuv" # Reconstruction YUV file
OutputFile = "mov_test1.264" # Bitstream
##########################################################################################
# Encoder Control
##########################################################################################
...
IntraPeriod = 15 # Period of I-pictures (0=only first)
...
##########################################################################################
# B Slices
##########################################################################################
NumberBFrames = 2 # Number of B coded frames inserted (0=not
disable, N <= NumberReferenceFrames)
...
HierarchicalCoding = 0 # B hierarchical coding (0= off, 1= 2 layers, 2= 2 full hierarchy,





最低0.47元/天 解锁文章
1133

被折叠的 条评论
为什么被折叠?



