VideoResolution,
VideoState
} from '@shared/models'
-import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils'
+import { ffprobePromise, getVideoStreamDuration, getVideoStreamFPS, getVideoStreamDimensionsInfo } from '../../../helpers/ffmpeg'
import { logger } from '../../../helpers/logger'
import { getSecureTorrentName } from '../../../helpers/utils'
import { createTorrentAndSetInfoHash, downloadWebTorrentVideo } from '../../../helpers/webtorrent'
const { resolution } = await isAudioFile(tempVideoPath, probe)
? { resolution: VideoResolution.H_NOVIDEO }
- : await getVideoFileResolution(tempVideoPath)
+ : await getVideoStreamDimensionsInfo(tempVideoPath)
- const fps = await getVideoFileFPS(tempVideoPath, probe)
- const duration = await getDurationFromVideoFile(tempVideoPath, probe)
+ const fps = await getVideoStreamFPS(tempVideoPath, probe)
+ const duration = await getVideoStreamDuration(tempVideoPath, probe)
// Prepare video file object for creation in database
const fileExt = getLowercaseExtension(tempVideoPath)
}
if (video.state === VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) {
- return addMoveToObjectStorageJob(videoImportUpdated.Video)
+ return addMoveToObjectStorageJob({ video: videoImportUpdated.Video, previousVideoState: VideoState.TO_IMPORT })
}
// Create transcoding jobs?
if (video.state === VideoState.TO_TRANSCODE) {
- await addOptimizeOrMergeAudioJob(videoImportUpdated.Video, videoFile, videoImport.User)
+ await addOptimizeOrMergeAudioJob({ video: videoImportUpdated.Video, videoFile, user: videoImport.User })
}
} catch (err) {