Merge pull request #315 from HaveAGitGat/v2_change

Update re-ordering of mp4 files
This commit is contained in:
HaveAGitGat 2022-05-25 19:26:24 +02:00 committed by GitHub
commit b13151d042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 103 additions and 3 deletions

View file

@ -102,6 +102,18 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
+ 'This may be due to a corrupt file or permissions issue when scanning the file.');
}
if (file.container === 'mp4' && file.fileMedium === 'video') {
if (file.ffProbeData.streams[0].codec_type === 'video') {
response.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';
return response;
}
response.processFile = true;
response.infoLog += 'File is mp4 and contains video but video is not first stream, remuxing';
response.preset = ',-map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy';
return response;
}
let { streams } = JSON.parse(JSON.stringify(file.ffProbeData));
streams.forEach((stream, index) => {