[+] Camera2拍照

This commit is contained in:
acgist
2023-04-15 01:16:08 +08:00
parent ce0afef889
commit 24d849cde0
17 changed files with 565 additions and 364 deletions

View File

@@ -7,6 +7,8 @@ import lombok.Setter;
/**
* 音频配置
*
* 比特率 = 采样率 * 采样位数 * 声道数 / 8 / 1024
*
* @author acgist
*/
@Getter
@@ -30,7 +32,9 @@ public class MediaAudioProperties {
@Schema(title = "格式", description = "格式", example = "G722|PCMA|PCMU|OPUS")
private Format format;
@Schema(title = "采样数", description = "采样数", example = "8|16|32")
@Schema(title = "比特率", description = "比特率", example = "96|128|256")
private Integer bitrate;
@Schema(title = "采样位数", description = "采样位数", example = "8|16|32")
private Integer sampleSize;
@Schema(title = "采样率", description = "采样率", example = "8000|16000|32000|48000")
private Integer sampleRate;

View File

@@ -27,22 +27,26 @@ public class MediaProperties {
private Integer minHeight;
@Schema(title = "最大视频高度", description = "最大视频高度")
private Integer maxHeight;
@Schema(title = "最小视频码率", description = "最小视频码率")
private Integer minBitrate;
@Schema(title = "最大视频码率", description = "最大视频码率")
private Integer maxBitrate;
@Schema(title = "最小视频帧率", description = "最小视频帧率")
private Integer minFrameRate;
@Schema(title = "最大视频帧率", description = "最大视频帧率")
private Integer maxFrameRate;
@Schema(title = "最小音频采样数", description = "最小音频采样数")
@Schema(title = "最小视频码率", description = "最小视频码率")
private Integer minVideoBitrate;
@Schema(title = "最大视频码率", description = "最大视频码率")
private Integer maxVideoBitrate;
@Schema(title = "最小音频采样位数", description = "最小音频采样位数")
private Integer minSampleSize;
@Schema(title = "最大音频采样数", description = "最大音频采样数")
@Schema(title = "最大音频采样", description = "最大音频采样")
private Integer maxSampleSize;
@Schema(title = "最小音频采样率", description = "最小音频采样率")
private Integer minSampleRate;
@Schema(title = "最大音频采样率", description = "最大音频采样率")
private Integer maxSampleRate;
@Schema(title = "最小音频码率", description = "最小音频码率")
private Integer minAudioBitrate;
@Schema(title = "最大音频码率", description = "最大音频码率")
private Integer maxAudioBitrate;
@Schema(title = "音频默认配置", description = "音频默认配置")
private MediaAudioProperties audio;
@Schema(title = "视频默认配置", description = "视频默认配置")

View File

@@ -6,6 +6,10 @@ import lombok.Setter;
/**
* 视频配置
* 原始数据 = 宽 * 高 * 3 / 2 * 8 * 帧率 / 1024 / 1024
* 视频编码 = 压缩
* 8 = 颜色位数
* 3 / 2 = YUV | RGB
*
* @author acgist
*/

View File

@@ -67,28 +67,34 @@ taoyao:
max-client-index: 99999
# 媒体配置
media:
# =============== 视频配置 ===============
# 宽度
min-width: 720
max-width: 4096
# 高度
min-height: 480
max-height: 2160
# 码率
min-bitrate: 800
max-bitrate: 1600
# 帧率
min-frame-rate: 15
max-frame-rate: 45
# 采样数
# 视频码率
min-video-bitrate: 800
max-video-bitrate: 1600
# =============== 音频配置 ===============
# 采样位数
min-sample-size: 8
max-sample-size: 32
# 采样率
min-sample-rate: 8000
max-sample-rate: 48000
# 音频码率
min-audio-bitrate: 96
max-audio-bitrate: 256
# ABR CBR VBR
# 默认音频
audio:
format: OPUS
bitrate: 96
sample-size: 32
sample-rate: 44100
# 默认视频
@@ -101,16 +107,19 @@ taoyao:
# 超清
fd-audio:
format: OPUS
bitrate: 256
sample-size: 32
sample-rate: 48000
# 高清
hd-audio:
format: OPUS
bitrate: 128
sample-size: 24
sample-rate: 44100
# 标清
sd-audio:
format: OPUS
bitrate: 96
sample-size: 24
sample-rate: 32000
videos: