1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 10:22:31 +01:00

don't copy dvb_teletext by default

fixes #1343
This commit is contained in:
Mikael Finstad 2022-10-20 12:33:55 +02:00
parent 7a27daee38
commit b319fce589
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
2 changed files with 8 additions and 3 deletions

View File

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

View File

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