add remux video and enc audio option

for html5ify
closes #870
pull/987/head
Mikael Finstad 5 years ago
parent 99656970af
commit 9e9d63fd93
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -887,8 +887,8 @@ const App = memo(() => {
let audio;
if (ha) {
if (speed === 'slowest') audio = 'hq';
else if (['slow-audio', 'fastest-audio'].includes(speed)) audio = 'lq';
else if (['fast-audio', 'fastest-audio-remux'].includes(speed)) audio = 'copy';
else if (['slow-audio', 'fast-audio', 'fastest-audio'].includes(speed)) audio = 'lq';
else if (['fast-audio-remux', 'fastest-audio-remux'].includes(speed)) audio = 'copy';
}
let video;
@ -921,7 +921,7 @@ const App = memo(() => {
}
return path;
}
if (['fastest-audio', 'fastest-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'].includes(speed)) {
if (['fastest-audio', 'fastest-audio-remux', 'fast-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'].includes(speed)) {
const shouldIncludeVideo = !usesDummyVideo && hv;
const path = await html5ify({ customOutDir: cod, filePath: fp, speed, hasAudio: ha, hasVideo: shouldIncludeVideo });
return path;
@ -1639,7 +1639,7 @@ const App = memo(() => {
if (!filePath) return;
async function getHtml5ifySpeed() {
const { selectedOption, remember } = await askForHtml5ifySpeed({ allowedOptions: ['fastest', 'fastest-audio', 'fastest-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'], showRemember: true, initialOption: rememberConvertToSupportedFormat });
const { selectedOption, remember } = await askForHtml5ifySpeed({ allowedOptions: ['fastest', 'fastest-audio', 'fastest-audio-remux', 'fast-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'], showRemember: true, initialOption: rememberConvertToSupportedFormat });
if (!selectedOption) return undefined;
console.log('Choice', { speed: selectedOption, remember });
@ -1872,7 +1872,7 @@ const App = memo(() => {
const failedFiles = [];
let i = 0;
const { selectedOption: speed } = await askForHtml5ifySpeed({ allowedOptions: ['fastest-audio', 'fastest-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'] });
const { selectedOption: speed } = await askForHtml5ifySpeed({ allowedOptions: ['fastest-audio', 'fastest-audio-remux', 'fast-audio-remux', 'fast-audio', 'fast', 'slow', 'slow-audio', 'slowest'] });
if (!speed) return;
if (workingRef.current) return;

@ -49,7 +49,8 @@ export async function askForHtml5ifySpeed({ allowedOptions, showRemember, initia
'fastest-audio': i18n.t('Fastest: Low playback speed'),
'fastest-audio-remux': i18n.t('Fastest: Low playback speed (audio remux), likely to fail'),
fast: i18n.t('Fast: Full quality remux (no audio), likely to fail'),
'fast-audio': i18n.t('Fast: Full quality remux, likely to fail'),
'fast-audio-remux': i18n.t('Fast: Full quality remux, likely to fail'),
'fast-audio': i18n.t('Fast: Remux video, encode audio (fails if unsupported video codec)'),
slow: i18n.t('Slow: Low quality encode (no audio)'),
'slow-audio': i18n.t('Slow: Low quality encode'),
slowest: i18n.t('Slowest: High quality encode'),

@ -205,7 +205,7 @@ export const html5dummySuffix = 'dummy';
export async function findExistingHtml5FriendlyFile(fp, cod) {
// The order is the priority we will search:
const suffixes = ['slowest', 'slow-audio', 'slow', 'fast-audio', 'fast', 'fastest-audio', 'fastest-audio-remux', html5dummySuffix];
const suffixes = ['slowest', 'slow-audio', 'slow', 'fast-audio-remux', 'fast-audio', 'fast', 'fastest-audio', 'fastest-audio-remux', html5dummySuffix];
const prefix = `${getFileBaseName(fp)}-${html5ifiedPrefix}`;
const outDir = getOutDir(cod, fp);

Loading…
Cancel
Save