mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 16:58:42 +00:00
feat(video): add SMPTE timecode support and format selection dropdown
This commit is contained in:
@@ -19,6 +19,7 @@ export interface MediaMetadata {
|
||||
bitRate: number
|
||||
frameRate: number
|
||||
totalFrames: number
|
||||
startTimecode?: string
|
||||
hasAudio: boolean
|
||||
videoCodec?: string
|
||||
audioCodec?: string
|
||||
@@ -123,6 +124,7 @@ export class TranscodeService {
|
||||
if (!totalFrames && fps > 0 && !isNaN(duration)) {
|
||||
totalFrames = Math.round(duration * fps)
|
||||
}
|
||||
const startTimecode = videoStream.tags?.timecode || info.format?.tags?.timecode
|
||||
|
||||
return {
|
||||
originalWidth: videoStream.width,
|
||||
@@ -131,6 +133,7 @@ export class TranscodeService {
|
||||
bitRate: parseFloat(info.format.bit_rate),
|
||||
frameRate: fps || 30,
|
||||
totalFrames: totalFrames || 0,
|
||||
startTimecode,
|
||||
hasAudio: !!audioStream,
|
||||
videoCodec: this.resolveCodecName(videoStream),
|
||||
audioCodec: audioStream ? this.resolveCodecName(audioStream) : undefined,
|
||||
@@ -161,6 +164,7 @@ export class TranscodeService {
|
||||
bitRate: 0,
|
||||
frameRate: 0,
|
||||
totalFrames: 0,
|
||||
startTimecode: undefined,
|
||||
hasAudio: false,
|
||||
mimeType: metadata.format || '',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user