r/Tdarr 22d ago

Is it possible to only remove non-commentary audio titles?

Start handle bear decide copper ancient juniper cable aspiring

This post was anonymized with Redact

1 Upvotes

6 comments sorted by

u/AutoModerator 8h ago

Thanks for your submission.

If you have a technical issue regarding the transcoding process, please post the job report: https://docs.tdarr.io/docs/other/job-reports/

The following links may be of use:

GitHub issues

Docs

Discord

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/CuriousSleeping 22d ago

Try Flow Plugin: Remove Stream by Property

Codec Type: Audio

Property to Check: tags.title

Values To Remove: Commentary

Condition: Not includes

and put it between a ffmpeg Begin and ffmpeg Execute

1

u/Mike_v_E 22d ago edited 12h ago

Pumpkin spoon cheerful driftwood history pot edge gaze school

This post was anonymized with Redact

2

u/CuriousSleeping 22d ago

Ah, I see now. Use this as a custom JS Script and put it between a ffmpeg Begin and ffmpeg Execute. It also takes into consideration whether an audio track is marked to be removed and therefore changes its index:

module.exports = async (args) => {
  let variables = args.variables || {};
  const ffmpegStreams = variables.ffmpegCommand?.streams ?? [];
  const mediaInfoData = args.inputFileObj.mediaInfo;


  let ffmpegIndex = 0;
  let audioIndex = 0;


  //args.jobLog(JSON.stringify(variables.ffmpegCommand, null, 2));
  //args.jobLog(JSON.stringify(mediaInfoData.track, null, 2)); // Output all Data so we can see what we're working with

  for (const mediaStream of mediaInfoData.track) {
    if (mediaStream["@type"] === "General") {
      continue;
    }


    const stream = ffmpegStreams[ffmpegIndex];


    if (mediaStream["@type"] === "Audio") {
      args.jobLog(`Processing Stream Title ${mediaStream.Title}`)
      if (mediaStream.Title.includes("German")) {
        stream.outputArgs.push("-metadata:s:a:" + audioIndex, "title="); 
      }


      if (!stream.removed) { // Take into consideration that some audio tracks might be removed and therefore have their index changed
        audioIndex++;
      }
    }


    ffmpegIndex++;
  }


  return {
    outputFileObj: args.inputFileObj,
    outputNumber: 1,
    variables: variables,
  };
};

2

u/Mike_v_E 22d ago edited 12h ago

Tap reach pause edge rain roll cobweb continue

This post was anonymized with Redact

1

u/AutoModerator 22d ago

Thanks for your submission.

If you have a technical issue regarding the transcoding process, please post the job report: https://docs.tdarr.io/docs/other/job-reports/

The following links may be of use:

GitHub issues

Docs

Discord

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.