mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 10:22:31 +01:00
parent
7a27daee38
commit
b319fce589
@ -58,7 +58,7 @@ import {
|
||||
getDuration, getTimecodeFromStreams, createChaptersFromSegments, extractSubtitleTrack,
|
||||
getFfmpegPath, RefuseOverwriteError,
|
||||
} from './ffmpeg';
|
||||
import { shouldCopyStreamByDefault, getAudioStreams, getRealVideoStreams, defaultProcessedCodecTypes, isAudioDefinitelyNotSupported, doesPlayerSupportFile } from './util/streams';
|
||||
import { shouldCopyStreamByDefault, getAudioStreams, getRealVideoStreams, isAudioDefinitelyNotSupported, doesPlayerSupportFile } from './util/streams';
|
||||
import { exportEdlFile, readEdlFile, saveLlcProject, loadLlcProject, askForEdlImport } from './edlStore';
|
||||
import { formatYouTube, getFrameCountRaw } from './edlFormats';
|
||||
import {
|
||||
@ -785,7 +785,7 @@ const App = memo(() => {
|
||||
|
||||
// Streams that are not copy enabled by default
|
||||
const extraStreams = useMemo(() => mainStreams
|
||||
.filter((stream) => !defaultProcessedCodecTypes.includes(stream.codec_type)), [mainStreams]);
|
||||
.filter((stream) => !shouldCopyStreamByDefault(stream)), [mainStreams]);
|
||||
|
||||
// Extra streams that the user has not selected for copy
|
||||
const nonCopiedExtraStreams = useMemo(() => extraStreams
|
||||
|
@ -1,11 +1,15 @@
|
||||
// https://www.ffmpeg.org/doxygen/3.2/libavutil_2utils_8c_source.html#l00079
|
||||
export const defaultProcessedCodecTypes = [
|
||||
const defaultProcessedCodecTypes = [
|
||||
'video',
|
||||
'audio',
|
||||
'subtitle',
|
||||
'attachment',
|
||||
];
|
||||
|
||||
const unprocessableCodecs = [
|
||||
'dvb_teletext', // ffmpeg doesn't seem to support this https://github.com/mifi/lossless-cut/issues/1343
|
||||
];
|
||||
|
||||
// taken from `ffmpeg -codecs`
|
||||
export const pcmAudioCodecs = [
|
||||
'adpcm_4xm',
|
||||
@ -189,6 +193,7 @@ export function getMapStreamsArgs({ startIndex = 0, outFormat, allFilesMeta, cop
|
||||
|
||||
export function shouldCopyStreamByDefault(stream) {
|
||||
if (!defaultProcessedCodecTypes.includes(stream.codec_type)) return false;
|
||||
if (unprocessableCodecs.includes(stream.codec_name)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user