Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to create a set of flow plugins that use a metadata tag to indicate that Tdarr has transcoded a mkv video file. #737

Open
Media588 opened this issue Jan 3, 2025 · 1 comment

Comments

@Media588
Copy link

Media588 commented Jan 3, 2025

I am new to Tdarr and I can’t seem to figure out how to write the flow plugins I need, but I am trying to add a tag to the metadata of a mkv video file to be used as an indicator for Tdarr to show that it has previously transcoded a video file. I have looked in the community plugins folder and I can’t seem to find anything that will perform this task.

I know the status queue keeps track of the videos that Tdarr has transcoded but it can be easily reset if I accidently click “Scan Fresh” in the library or if I reinstall Tdarr on another PC and I have to re-create the library.

I am currently adding “TdarrOptimized” to the end of the video file name as the last step in my transcode flow. My transcode flow also checks for the “TdarrOptimized” phrase in the file name and skips any video file that has already been transcoded. My solution works fine but renaming the file breaks the link to the associated subtitle file in the video folder.

I feel like a better solution would be to have 2 flow plugins that:

  1. Write a keypair similar to “TdarrOptimized=yes” into the metadata of the mkv video file.
  2. Check for the phrase “TdarrOptimized=yes” in the metadata of the mkv video file and return 2 results, true/false.
    The keypair could alternatively reference the codec that was used to transcode the video file. Example: “TdarrOptimized=hevc”.

With these 2 flow plugins, I could be sure that I would not re-transcode a video file even if it was added to a new library. I would also resolve the issue of breaking the subtitle links and would not have to have a separate folder for non-transcoded files as some have suggested.

Please let me know if there are any such plugins available that I may have overlooked.

Thanks,

@quadcom
Copy link

quadcom commented Jan 6, 2025

It is already possible with the available flow nodes. I have one running for this exact purpose.

I have two nodes that add tags to the track0 stream (video stream) to monitor processing and at what settings.

image

The first one in the above SS sets a tag to track the CQ rate I had set at the time.

image

I use a global variable to allow for ease of change and reuse. You can set those on the Tools page.

image

This second node adds a tag to note that the file was reencoded by Tdarr.
image

Then, at the start of the flow, I have a node that looks for these values.
image

Where this gets confusing is the output ports of the nodes. The goal is that if the tag is found, you want the file skipped, so the output port logic needs to be flipped in your head.

image

In this case, if the tag is found, it should be passed out port 2. If it is NOT found, it should go out of port 1 or port 3. It needs both in my flow as the Tdarr tag could be there but has a different value than TRUE. If the tag is missing altogether, it goes out of port 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants