繁体   English   中英

在 HEVC 与 H264 中捕获的视频的文件大小

[英]File size of videos captured in HEVC vs H264

我正在使用我开发的一个简单的 Android 应用程序对HEVC中录制的视频的文件大小与H264中录制的视频的文件大小进行一些实验。 我的印象是,与在 H264 中录制的视频相比,在 HEVC 中录制的视频通常应该具有几乎一半的大小(或至少小得多),因为它们具有相同的持续时间和几乎相同的内容(我用手机的相机拍摄了相同的场景)。 但是当我使用mediaInfo比较他们的元数据时,它并不是很喜欢。 我想知道为什么。

这里发生了什么? 我错过了什么吗?? 我应该怎么做才能证明这个概念?

这是我设置的:

    mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    //choose HEVC or H264
    mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
    mMediaRecorder.setVideoEncodingBitRate(5000 * 1000);
    mMediaRecorder.setVideoFrameRate(30);
    mMediaRecorder.setVideoSize(1280, 720);

这是HEVC视频的 mediaInfo:

General 
Complete name : VID_20211225_210352.mp4 
Format : MPEG-4 
Format profile : Base Media / Version 2 
Codec ID : mp42 (isom/mp42) 
File size : 763 KiB 
Duration : 1 s 447 ms 
Overall bit rate : 4 322 kb/s 
Encoded date : UTC 2021-12-25 17:33:56 
Tagged date : UTC 2021-12-25 17:33:56 
com.android.version : 11 

Video 
ID : 1 
Format : HEVC 
Format/Info : High Efficiency Video Coding 
Format profile : Main@L3.1@Main 
Codec ID : hvc1 
Codec ID/Info : High Efficiency Video Coding 
Duration : 1 s 447 ms 
Source duration : 1 s 441 ms 
Bit rate : 4 316 kb/s 
Width : 1 280 pixels 
Height : 720 pixels 
Display aspect ratio : 16:9 
Frame rate mode : Variable 
Frame rate : 29.837 FPS 
Minimum frame rate : 23.112 FPS 
Maximum frame rate : 30.050 FPS 
Standard : PAL 
Color space : YUV 
Chroma subsampling : 4:2:0 
Bit depth : 8 bits 
Bits/(Pixel*Frame) : 0.157 
Stream size : 759 KiB (99%) 
Source stream size : 759 KiB (99%) 
Title : VideoHandle 
Language : English 
Encoded date : UTC 2021-12-25 17:33:56 
Tagged date : UTC 2021-12-25 17:33:56 
Color range : Limited 
Color primaries : BT.709 
Transfer characteristics : BT.709 
Matrix coefficients : BT.709 
mdhd_Duration : 1447 
Codec configuration box : hvcC 

Audio 
ID : 2 
Format : AAC LC 
Format/Info : Advanced Audio Codec Low Complexity 
Codec ID : mp4a-40-2 
Duration : 1 s 408 ms 
Bit rate mode : Constant 
Bit rate : 13.1 kb/s 
Nominal bit rate : 12.2 kb/s 
Channel(s) : 1 channel 
Channel layout : C 
Sampling rate : 8 000 Hz 
Frame rate : 7.812 FPS (1024 SPF) 
Compression mode : Lossy 
Stream size : 2.26 KiB (0%) 
Title : SoundHandle 
Language : English 
Encoded date : UTC 2021-12-25 17:33:56 
Tagged date : UTC 2021-12-25 17:33:56 

这是 H264 视频的 mediaInfo:

General 
Complete name : VID_20211225_210425.mp4 
Format : MPEG-4 
Format profile : Base Media / Version 2 
Codec ID : mp42 (isom/mp42) 
File size : 719 KiB 
Duration : 1 s 409 ms 
Overall bit rate : 4 178 kb/s 
Encoded date : UTC 2021-12-25 17:34:28 
Tagged date : UTC 2021-12-25 17:34:28 
com.android.version : 11 

Video 
ID : 1 
Format : AVC 
Format/Info : Advanced Video Codec 
Format profile : High@L3.1 
Format settings : CABAC / 1 Ref Frames 
Format settings, CABAC : Yes 
Format settings, Reference frames : 1 frame 
Codec ID : avc1 
Codec ID/Info : Advanced Video Coding 
Duration : 1 s 408 ms 
Bit rate : 4 157 kb/s 
Width : 1 280 pixels 
Height : 720 pixels 
Display aspect ratio : 16:9 
Frame rate mode : Variable 
Frame rate : 29.832 FPS 
Minimum frame rate : 23.107 FPS 
Maximum frame rate : 30.050 FPS 
Standard : PAL 
Color space : YUV 
Chroma subsampling : 4:2:0 
Bit depth : 8 bits 
Scan type : Progressive 
Bits/(Pixel*Frame) : 0.151 
Stream size : 714 KiB (99%) 
Title : VideoHandle 
Language : English 
Encoded date : UTC 2021-12-25 17:34:28 
Tagged date : UTC 2021-12-25 17:34:28 
Color range : Limited 
Color primaries : BT.709 
Transfer characteristics : BT.709 
Matrix coefficients : BT.709 
mdhd_Duration : 1408 
Codec configuration box : avcC 

Audio 
ID : 2 
Format : AAC LC 
Format/Info : Advanced Audio Codec Low Complexity 
Codec ID : mp4a-40-2 
Duration : 1 s 409 ms 
Source duration : 1 s 408 ms 
Bit rate mode : Constant 
Bit rate : 13.4 kb/s 
Nominal bit rate : 12.2 kb/s 
Channel(s) : 1 channel 
Channel layout : C 
Sampling rate : 8 000 Hz 
Frame rate : 7.812 FPS (1024 SPF) 
Compression mode : Lossy 
Stream size : 2.31 KiB (0%) 
Source stream size : 2.31 KiB (0%) 
Title : SoundHandle 
Language : English 
Encoded date : UTC 2021-12-25 17:34:28 
Tagged date : UTC 2021-12-25 17:34:28 
mdhd_Duration : 1409 

您将两种格式的比特率设置为 5 Mbps - 因此两种格式的大小大致相同。 理论上——如果你用 5 Mbps 编码 HEVC,你应该得到比 5 Mbps 的 H.264 更高的质量。 因此,您应该降低 HEVC 的比特率 - 尝试 2.5 Mbps - 然后使用例如 PSNR 比较质量。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM