1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 18:32:34 +01:00
This commit is contained in:
Mikael Finstad 2023-01-03 12:12:14 +08:00
parent f3e3fd708d
commit 54e377f112
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -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);