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

enable gopro tmcd track by default

closes #2134
This commit is contained in:
Mikael Finstad 2024-08-28 22:14:34 +02:00
parent c66cb88de7
commit 56cd37dde8
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -2,17 +2,6 @@ import invariant from 'tiny-invariant';
import { FFprobeStream, FFprobeStreamDisposition } from '../../../../ffprobe';
import { AllFilesMeta, ChromiumHTMLAudioElement, ChromiumHTMLVideoElement, CopyfileStreams, LiteFFprobeStream } from '../types';
// https://www.ffmpeg.org/doxygen/3.2/libavutil_2utils_8c_source.html#l00079
const defaultProcessedCodecTypes = new Set([
'video',
'audio',
'subtitle',
'attachment',
]);
const unprocessableCodecs = new Set([
'dvb_teletext', // ffmpeg doesn't seem to support this https://github.com/mifi/lossless-cut/issues/1343
]);
// taken from `ffmpeg -codecs`
export const pcmAudioCodecs = [
@ -235,9 +224,26 @@ export function getMapStreamsArgs({ startIndex = 0, outFormat, allFilesMeta, cop
}
export function shouldCopyStreamByDefault(stream: FFprobeStream) {
if (!defaultProcessedCodecTypes.has(stream.codec_type)) return false;
if (unprocessableCodecs.has(stream.codec_name)) return false;
// https://www.ffmpeg.org/doxygen/3.2/libavutil_2utils_8c_source.html#l00079
switch (stream.codec_type) {
case 'audio':
case 'attachment':
case 'video': {
return true;
}
case 'subtitle': {
return stream.codec_name !== 'dvb_teletext'; // ffmpeg doesn't seem to support this https://github.com/mifi/lossless-cut/issues/1343
}
case 'data': {
// can handle gopro gpmd https://github.com/mifi/lossless-cut/issues/2134
// no other data tracks are known to be supported (might be added later)
return stream.codec_name === 'bin_data' && stream.codec_tag_string === 'gpmd';
}
default: {
return false;
}
}
}
export const attachedPicDisposition = 'attached_pic';