debug logging

main
Gabe Farrell 9 months ago
parent b9a297b69f
commit a3933f63bd

@ -6,7 +6,7 @@ const details = () => ({
Type: 'Video',
Operation: 'Transcode',
Description:
'Re-orders streams to move default audio and subtitle tracks to be first. Multiple default tracks may result in duplicate streams.\\n',
'Re-orders streams to move default audio and subtitle tracks to be first. \\n',
Version: '1.0',
Tags: 'pre-processing,ffmpeg',
Inputs: [],
@ -48,6 +48,8 @@ const details = () => ({
let convert = false;
let processAudio = false;
let processSubtitles = false;
// [false, true, true]
for (let i = 0; i < file.ffProbeData.streams.length; i++) {
try {

@ -57,7 +57,6 @@ const details = () => ({
let audioIdx = 0;
let firstAudioInLangIdx = -1;
let convert = false;
let foundAudioInLang = false;
let defaults = [] // list of tracks currently set as default
// 0 jpn (default), 1 eng (default)
@ -72,6 +71,7 @@ const details = () => ({
if (languages.includes(file.ffProbeData.streams[i].tags.language)) {
// mark the id of the first track in lang
if (firstAudioInLangIdx === -1) {
response.infoLog += `☒Audio stream 0:a:${audioIdx} set as firstAudioInLangIdx`
firstAudioInLangIdx = audioIdx;
}
}
@ -86,6 +86,7 @@ const details = () => ({
for (let i = 0; i < defaults.length; i++) {
if (firstAudioInLangIdx === -1) {
// we never found an audio track in lang, just break
response.infoLog += `☒No audio stream in preferred lang was found`
break;
} else if (firstAudioInLangIdx === i && defaults[i] === 0) {
convert = true;

Loading…
Cancel
Save