mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-23 14:57:13 +00:00
feat(video): add frame-accurate video player and CFR proxy generation
This commit is contained in:
@@ -61,7 +61,6 @@ export async function getMediaInfoActivity(params: {
|
||||
const mediaInfo: PrismaJson.MediaInfo = {
|
||||
duration: 0,
|
||||
filesize: 0,
|
||||
fps: 0,
|
||||
frames: 0,
|
||||
imageTranscodes: [],
|
||||
videoTranscodes: [],
|
||||
@@ -84,13 +83,14 @@ export async function getMediaInfoActivity(params: {
|
||||
if (isVideo) {
|
||||
const info = await transcodeService.getVideoInfo(params.filePath)
|
||||
mediaInfo.duration = info.duration
|
||||
mediaInfo.fps = info.frameRate
|
||||
mediaInfo.frames = info.totalFrames
|
||||
mediaInfo.metadata = {
|
||||
originalWidth: info.originalWidth,
|
||||
originalHeight: info.originalHeight,
|
||||
duration: info.duration,
|
||||
bitRate: info.bitRate,
|
||||
frameRate: info.frameRate,
|
||||
totalFrames: info.totalFrames,
|
||||
hasAudio: info.hasAudio,
|
||||
videoCodec: info.videoCodec,
|
||||
audioCodec: info.audioCodec,
|
||||
@@ -172,7 +172,7 @@ export async function transcodeVideoActivity(
|
||||
const outputFile = path.join(tmpDir, `video-${params.videoSpec.height}p.mp4`)
|
||||
|
||||
try {
|
||||
let targetFps: number | string = 0
|
||||
let targetFps: number | string = params.originalFps || 30
|
||||
let disableAudio = false
|
||||
|
||||
if (params.videoSpec.resolution === '180p') {
|
||||
|
||||
Reference in New Issue
Block a user