feat(metadata): add video_codec field and verbose codec name resolution

This commit is contained in:
yiling
2026-05-26 15:41:12 +08:00
parent 2a04c49b95
commit da9f6574a6
6 changed files with 162 additions and 4 deletions
+9 -1
View File
@@ -43,9 +43,13 @@ describe('TranscodeService', () => {
streams: [
{
codec_type: 'video',
codec_name: 'h264',
width: 1920,
height: 1080,
r_frame_rate: '30/1',
tags: {
mime_codec_string: 'avc1.4d401e',
},
},
{
codec_type: 'audio',
@@ -53,6 +57,9 @@ describe('TranscodeService', () => {
channels: 2,
sample_rate: '48000',
bits_per_raw_sample: '16',
tags: {
mime_codec_string: 'mp4a.40.2',
},
},
],
})
@@ -70,7 +77,8 @@ describe('TranscodeService', () => {
expect(info.duration).toBe(10.5)
expect(info.frameRate).toBe(30)
expect(info.hasAudio).toBe(true)
expect(info.audioCodec).toBe('aac')
expect(info.videoCodec).toBe('Advanced Video Coding')
expect(info.audioCodec).toBe('MPEG-4 Audio')
expect(info.audioChannels).toBe(2)
expect(info.audioSampleRate).toBe(48000)
expect(info.audioBitDepth).toBe(16)