From 54e377f112d35c8bb9c4718c515bf8496015f9a7 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 3 Jan 2023 12:12:14 +0800 Subject: [PATCH] simplify --- src/smartcut.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/smartcut.js b/src/smartcut.js index 009344ce..7fa304be 100644 --- a/src/smartcut.js +++ b/src/smartcut.js @@ -4,11 +4,6 @@ import { readFramesAroundTime } from './ffmpeg'; const { stat } = window.require('fs-extra'); -function mapInputToOutputCodec(inputCodec) { - // if (inputCodec === 'hevc') return 'libx265'; - return inputCodec; -} - // eslint-disable-next-line import/prefer-default-export export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, streams }) { const videoStreams = getRealVideoStreams(streams); @@ -54,7 +49,7 @@ export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, s videoBitrate = stats.size / videoDuration; } - const videoCodec = mapInputToOutputCodec(videoStream.codec_name); + const { codec_name: videoCodec } = videoStream; if (videoCodec == null) throw new Error('Unable to determine codec for smart cut'); const timebase = getVideoTimebase(videoStream);