X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Foptimize-old-videos.ts;h=01d30244fb62fe5f58bf73064f404791735ed35b;hb=9aa67e905f8972106d1a712ef2190d32f2410cbb;hp=9595efd9c6623af298b4369d80db272bc2d89176;hpb=80fdaf064562aff968f4c9cea1cf220bc12a70da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/optimize-old-videos.ts b/scripts/optimize-old-videos.ts index 9595efd9c..01d30244f 100644 --- a/scripts/optimize-old-videos.ts +++ b/scripts/optimize-old-videos.ts @@ -2,7 +2,7 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths' registerTSPaths() import { VIDEO_TRANSCODING_FPS } from '../server/initializers/constants' -import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffmpeg-utils' +import { getDurationFromVideoFile, getVideoFileBitrate, getVideoFileFPS, getVideoFileResolution } from '../server/helpers/ffprobe-utils' import { getMaxBitrate } from '../shared/models/videos' import { VideoModel } from '../server/models/video/video' import { optimizeOriginalVideofile } from '../server/lib/video-transcoding' @@ -34,7 +34,9 @@ async function run () { const localVideos = await VideoModel.listLocal() - for (const video of localVideos) { + for (const localVideo of localVideos) { + const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(localVideo.id) + currentVideoId = video.id for (const file of video.VideoFiles) {