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

fix missing codecs

This commit is contained in:
Mikael Finstad 2022-02-24 17:58:16 +08:00
parent 55f2eb83ca
commit 3f91f70e7f
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
2 changed files with 44 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import i18n from 'i18next';
import Timecode from 'smpte-timecode';
import { getOutPath, isDurationValid, getExtensionForFormat, isWindows, platform } from './util';
import { encodeablePcmCodecs } from './util/streams';
import { pcmAudioCodecs } from './util/streams';
const execa = window.require('execa');
const { join } = window.require('path');
@ -232,7 +232,7 @@ export async function createChaptersFromSegments({ segmentPaths, chapterNames })
function mapDefaultFormat({ streams, requestedFormat }) {
if (requestedFormat === 'mp4') {
// Only MOV supports these, so switch to MOV https://github.com/mifi/lossless-cut/issues/948
if (streams.some((stream) => encodeablePcmCodecs.includes(stream.codec_name))) {
if (streams.some((stream) => pcmAudioCodecs.includes(stream.codec_name))) {
return 'mov';
}
}

View File

@ -7,30 +7,67 @@ export const defaultProcessedCodecTypes = [
];
// taken from `ffmpeg -codecs`
export const encodeablePcmCodecs = [
export const pcmAudioCodecs = [
'adpcm_4xm',
'adpcm_adx',
'adpcm_afc',
'adpcm_agm',
'adpcm_aica',
'adpcm_argo',
'adpcm_ct',
'adpcm_dtk',
'adpcm_ea',
'adpcm_ea_maxis_xa',
'adpcm_ea_r1',
'adpcm_ea_r2',
'adpcm_ea_r3',
'adpcm_ea_xas',
'adpcm_g722',
'adpcm_g726',
'adpcm_g726le',
'adpcm_ima_alp',
'adpcm_ima_amv',
'adpcm_ima_apc',
'adpcm_ima_apm',
'adpcm_ima_cunning',
'adpcm_ima_dat4',
'adpcm_ima_dk3',
'adpcm_ima_dk4',
'adpcm_ima_ea_eacs',
'adpcm_ima_ea_sead',
'adpcm_ima_iss',
'adpcm_ima_moflex',
'adpcm_ima_mtf',
'adpcm_ima_oki',
'adpcm_ima_qt',
'adpcm_ima_rad',
'adpcm_ima_smjpeg',
'adpcm_ima_ssi',
'adpcm_ima_wav',
'adpcm_ima_ws',
'adpcm_ms',
'adpcm_mtaf',
'adpcm_psx',
'adpcm_sbpro_2',
'adpcm_sbpro_3',
'adpcm_sbpro_4',
'adpcm_swf',
'adpcm_thp',
'adpcm_thp_le',
'adpcm_vima',
'adpcm_xa',
'adpcm_yamaha',
'adpcm_zork',
'pcm_alaw',
'pcm_bluray',
'pcm_dvd',
'pcm_f16le',
'pcm_f24le',
'pcm_f32be',
'pcm_f32le',
'pcm_f64be',
'pcm_f64le',
'pcm_lxf',
'pcm_mulaw',
'pcm_s16be',
'pcm_s16be_planar',
@ -47,6 +84,7 @@ export const encodeablePcmCodecs = [
'pcm_s64le',
'pcm_s8',
'pcm_s8_planar',
'pcm_sga',
'pcm_u16be',
'pcm_u16le',
'pcm_u24be',