Update re-ordering of mp4 files

This commit is contained in:
HaveAGitGat 2022-05-25 08:19:25 +01:00
parent f8f5172765
commit 91b12d5b83
2 changed files with 95 additions and 3 deletions

View file

@ -1,10 +1,11 @@
/* eslint max-len: 0 */
const _ = require('lodash');
const run = require('../helpers/run');
const tests = [
{
input: {
file: require('../sampleData/media/sampleH264_1.json'),
file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')),
librarySettings: {},
inputs: {},
otherArguments: {},
@ -15,7 +16,7 @@ const tests = [
container: '.mp4',
handBrakeMode: false,
FFmpegMode: true,
infoLog: 'Streams are in the correct order!',
infoLog: 'File is mp4 and already has the video stream in the correct order! Due to FFmpeg issues when reordering streams in mp4 files, other stream ordering will be skipped',
},
},
{
@ -47,7 +48,7 @@ const tests = [
// }))
input: {
file: require('../sampleData/media/sampleH264_2.json'),
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
librarySettings: {},
inputs: {
processOrder: 'codecs,channels,languages,streamTypes',
@ -67,6 +68,91 @@ const tests = [
infoLog: 'Streams are not in the correct order!',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json'));
const s4 = file.ffProbeData.streams[4];
file.ffProbeData.streams[4] = file.ffProbeData.streams[4];
file.ffProbeData.streams[5] = s4;
return file;
})(),
librarySettings: {},
inputs: {
processOrder: 'codecs,channels,languages,streamTypes',
languages: 'eng,fre',
streamTypes: 'video,audio,subtitle',
codecs: 'flac,ac3,eac3,aac',
channels: '7.1,5.1,2,1',
},
otherArguments: {},
},
output: {
processFile: false,
preset: '',
container: '.mkv',
handBrakeMode: false,
FFmpegMode: true,
infoLog: 'Streams are in the correct order!',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json'));
file.container = 'mp4';
return file;
})(),
librarySettings: {},
inputs: {
processOrder: 'codecs,channels,languages,streamTypes',
languages: 'fre,eng',
streamTypes: 'video,audio,subtitle',
codecs: 'ac3,flac,eac3,aac',
channels: '7.1,5.1,2,1',
},
otherArguments: {},
},
output: {
processFile: false,
preset: '',
container: '.mp4',
handBrakeMode: false,
FFmpegMode: true,
infoLog: 'File is mp4 and already has the video stream in the correct order! Due to FFmpeg issues when reordering streams in mp4 files, other stream ordering will be skipped',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json'));
const s0 = file.ffProbeData.streams[0];
// eslint-disable-next-line prefer-destructuring
file.ffProbeData.streams[0] = file.ffProbeData.streams[1];
file.ffProbeData.streams[1] = s0;
file.container = 'mp4';
return file;
})(),
librarySettings: {},
inputs: {
processOrder: 'codecs,channels,languages,streamTypes',
languages: 'fre,eng',
streamTypes: 'video,audio,subtitle',
codecs: 'ac3,flac,eac3,aac',
channels: '7.1,5.1,2,1',
},
otherArguments: {},
},
output: {
processFile: true,
preset: '<io> -c copy -map 0:1 -map 0:4 -map 0:2 -map 0:0 -map 0:3 -map 0:5 -map 0:6',
container: '.mp4',
handBrakeMode: false,
FFmpegMode: true,
infoLog: 'Streams are not in the correct order!',
},
},
];
run(tests);