- const videoOutputPath = join(CONFIG.STORAGE.VIDEOS_DIR, video.getVideoFilename(newVideoFile))
- const videoTranscodedPath = join(transcodeDirectory, video.getVideoFilename(newVideoFile))
-
- const transcodeOptions = {
- type: 'video' as 'video',
- inputPath: videoInputPath,
- outputPath: videoTranscodedPath,
- resolution,
- isPortraitMode: isPortrait
- }
+ const videoOutputPath = getVideoFilePath(video, newVideoFile)
+ const videoTranscodedPath = join(transcodeDirectory, getVideoFilename(video, newVideoFile))
+
+ const transcodeOptions = resolution === VideoResolution.H_NOVIDEO
+ ? {
+ type: 'only-audio' as 'only-audio',
+ inputPath: videoInputPath,
+ outputPath: videoTranscodedPath,
+ resolution
+ }
+ : {
+ type: 'video' as 'video',
+ inputPath: videoInputPath,
+ outputPath: videoTranscodedPath,
+ resolution,
+ isPortraitMode: isPortrait
+ }