const fileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
try {
+ await video.reload()
+ await file.reload()
+
await createTorrentAndSetInfoHash(video, file)
// Refresh videoFile because the createTorrentAndSetInfoHash could be long
const payload = job.data as MoveObjectStoragePayload
logger.info('Moving video %s in job %s.', payload.videoUUID, job.id)
+ const fileMutexReleaser = await VideoPathManager.Instance.lockFiles(payload.videoUUID)
+
const video = await VideoModel.loadWithFiles(payload.videoUUID)
// No video, maybe deleted?
if (!video) {
logger.info('Can\'t process job %d, video does not exist.', job.id, lTagsBase(payload.videoUUID))
+ fileMutexReleaser()
return undefined
}
const lTags = lTagsBase(video.uuid, video.url)
- const fileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
-
try {
if (video.VideoFiles) {
logger.debug('Moving %d webtorrent files for video %s.', video.VideoFiles.length, video.uuid, lTags)
for (const concatenatedTsFile of concatenatedTsFiles) {
const inputFileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
+ await video.reload()
const concatenatedTsFilePath = join(replayDirectory, concatenatedTsFile)
const mutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
try {
- // VOD transcoding is a long task, refresh video attributes
await video.reload()
const videoFilePath = VideoPathManager.Instance.getFSVideoFileOutputPath(playlist, videoFile)
: await VideoPathManager.Instance.lockFiles(video.uuid)
try {
+ await video.reload()
+ await videoFile.reload()
+
await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => {
const probe = await ffprobePromise(videoFilePath)
: await VideoPathManager.Instance.lockFiles(video.uuid)
try {
+ await video.reload()
+ await videoFile.reload()
+
await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), async videoFilePath => {
const probe = await ffprobePromise(videoFilePath)
})
after(async function () {
- await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
- peertubeRunner.kill()
+ if (peertubeRunner) {
+ await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
+ peertubeRunner.kill()
+ }
await cleanupTests(servers)
})
})
after(async function () {
- await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
- peertubeRunner.kill()
+ if (peertubeRunner) {
+ await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
+ peertubeRunner.kill()
+ }
await cleanupTests(servers)
})
})
after(async function () {
- await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
- peertubeRunner.kill()
+ if (peertubeRunner) {
+ await peertubeRunner.unregisterPeerTubeInstance({ server: servers[0] })
+ peertubeRunner.kill()
+ }
await cleanupTests(servers)
})
command.outputOption('-c copy')
} else {
command.outputOption('-c:v libx264')
- command.outputOption('-g 50')
- command.outputOption('-keyint_min 2')
+ command.outputOption('-g 120')
+ command.outputOption('-x264-params "no-scenecut=1"')
command.outputOption('-r 60')
}