├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows_
│ └── build_multi.yml
├── .gitignore
├── .vscode
└── extensions.json
├── LICENSE.md
├── README.md
├── docker
├── Dockerfile.base
├── Dockerfile.final
├── Makefile
└── root
│ └── etc
│ ├── cont-init.d
│ ├── 01-setup-perms
│ └── 02-hw-transcoding
│ └── services.d
│ ├── tdarr_node
│ └── run
│ └── tdarr_server
│ └── run
├── package.json
└── updater
└── README.md
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please put plugin requests/bugs at: https://github.com/HaveAGitGat/Tdarr_Plugins
11 |
12 | **Describe the bug**
13 | A clear and concise description of what the bug is.
14 |
15 | **To Reproduce**
16 | Steps to reproduce the behavior:
17 |
18 | **Expected behavior**
19 | A clear and concise description of what you expected to happen.
20 |
21 | **Screenshots**
22 | If applicable, add screenshots to help explain your problem.
23 |
24 | **Please provide the following information:**
25 | - Config files [can be found in /app/configs/ when using Docker or in the /configs folder next to Tdarr_Updater if not using Docker]
26 |
27 | - Job reports: https://docs.tdarr.io/docs/other/job-reports
28 |
29 | - Log files [can be found in /app/logs/ when using Docker or in the /logs folder next to Tdarr_Updater if not using Docker]
30 |
31 | -Worker error [can be found on the 'Tdarr' tab by pressing the 'i' button on a failed item in the staged file section or in the transcode error section at the bottom]
32 |
33 | - OS: [e.g. Linux]
34 | - Browser [e.g. chrome, safari]
35 | - Version [e.g. 2.00.00]
36 |
37 |
38 | **Additional context**
39 | Add any other context about the problem here.
40 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please put plugin requests/bugs at: https://github.com/HaveAGitGat/Tdarr_Plugins
11 |
12 | **Is your feature request related to a problem? Please describe.**
13 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14 |
15 | **Describe the solution you'd like**
16 | A clear and concise description of what you want to happen.
17 |
18 | **Describe alternatives you've considered**
19 | A clear and concise description of any alternative solutions or features you've considered.
20 |
21 | **Additional context**
22 | Add any other context or screenshots about the feature request here.
23 |
--------------------------------------------------------------------------------
/.github/workflows_/build_multi.yml:
--------------------------------------------------------------------------------
1 | name: build_multi
2 |
3 | on:
4 | # pull_request:
5 | # types: [closed]
6 | # push:
7 | # branches: ["master"]
8 | pull_request:
9 | branches: ["**"]
10 |
11 | jobs:
12 | build_multi_node:
13 | runs-on: ubuntu-20.04
14 | name: build_multi_node
15 | steps:
16 | - uses: actions/checkout@v3
17 | with:
18 | ref: ${{ github.event.pull_request.head.sha }}
19 | - name: Create Variables
20 | id: vars
21 | env:
22 | _repo: ${{github.repository}}
23 | _ref: ${{github.ref}}
24 | run: |
25 | echo "::set-output name=branch::$(echo ${_ref} | cut -d/ -f3)"
26 | echo "::set-output name=username::$(echo ${_repo} | cut -d/ -f1 | tr '[:upper:]' '[:lower:]')"
27 | echo "::set-output name=repo::$(echo ${_repo} | tr '[:upper:]' '[:lower:]')"
28 |
29 | - name: Printing Variables
30 | run: |
31 | echo "${{ steps.vars.outputs.branch }} && ${{github.ref}}"
32 | echo "${{ steps.vars.outputs.username }} && ${{github.repository}}"
33 | echo ${{ steps.vars.outputs.repo }}
34 |
35 | - name: get-npm-version
36 | id: package-version
37 | uses: martinbeentjes/npm-get-version-action@master
38 |
39 | - name: Set up QEMU
40 | uses: docker/setup-qemu-action@v1
41 | - name: Set up Docker Buildx
42 | uses: docker/setup-buildx-action@v1
43 | - name: Login to DockerHub
44 | uses: docker/login-action@v1
45 | with:
46 | username: ${{ secrets.DOCKER_HUB_USERNAME }}
47 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
48 |
49 | - name: Login to GitHub Container Registry
50 | uses: docker/login-action@v1
51 | with:
52 | registry: ghcr.io
53 | username: ${{ github.actor }}
54 | password: ${{ secrets.GH_TOKEN }}
55 |
56 | - name: Buildx
57 | run: |
58 | cd docker && make build-node USERNAME=${{ steps.vars.outputs.username }} REPO=_acc TAG=dev VERSION=${{ steps.package-version.outputs.current-version }}
59 |
60 | build_multi_server:
61 | runs-on: ubuntu-20.04
62 | name: build_multi_server
63 | steps:
64 | - uses: actions/checkout@v3
65 | with:
66 | ref: ${{ github.event.pull_request.head.sha }}
67 | - name: Create Variables
68 | id: vars
69 | env:
70 | _repo: ${{github.repository}}
71 | _ref: ${{github.ref}}
72 | run: |
73 | echo "::set-output name=branch::$(echo ${_ref} | cut -d/ -f3)"
74 | echo "::set-output name=username::$(echo ${_repo} | cut -d/ -f1 | tr '[:upper:]' '[:lower:]')"
75 | echo "::set-output name=repo::$(echo ${_repo} | tr '[:upper:]' '[:lower:]')"
76 |
77 | - name: Printing Variables
78 | run: |
79 | echo "${{ steps.vars.outputs.branch }} && ${{github.ref}}"
80 | echo "${{ steps.vars.outputs.username }} && ${{github.repository}}"
81 | echo ${{ steps.vars.outputs.repo }}
82 |
83 | - name: get-npm-version
84 | id: package-version
85 | uses: martinbeentjes/npm-get-version-action@master
86 |
87 | - name: Set up QEMU
88 | uses: docker/setup-qemu-action@v1
89 | - name: Set up Docker Buildx
90 | uses: docker/setup-buildx-action@v1
91 | - name: Login to DockerHub
92 | uses: docker/login-action@v1
93 | with:
94 | username: ${{ secrets.DOCKER_HUB_USERNAME }}
95 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
96 |
97 | - name: Login to GitHub Container Registry
98 | uses: docker/login-action@v1
99 | with:
100 | registry: ghcr.io
101 | username: ${{ github.actor }}
102 | password: ${{ secrets.GH_TOKEN }}
103 |
104 | - name: Buildx
105 | run: |
106 | cd docker && make build-server USERNAME=${{ steps.vars.outputs.username }} REPO=_acc TAG=dev VERSION=${{ steps.package-version.outputs.current-version }}
107 |
108 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
3 | .idea
4 | version.desktop
5 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "dbaeumer.vscode-eslint",
4 | "ms-azuretools.vscode-docker"
5 | ]
6 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | END USER LICENSE AGREEMENT (EULA) FOR TDARR
2 |
3 | This End User License Agreement ("EULA") is a legal agreement between you ("User") and Tdarr for the use of the Tdarr software ("Software"). By downloading, installing, or using the Software, you agree to be bound by the terms of this EULA.
4 |
5 | 1. License Grant
6 |
7 | 1.1 Tdarr grants you a non-exclusive, non-transferable license to use the Software under the terms of this EULA.
8 |
9 | 1.2 The license is provided in three tiers:
10 | - Personal Free: Free of charge.
11 | - Personal Subscription: Subscription-based, with additional features.
12 | - Business Subscription & Trial: Subscription-based, designed for business use with full features.
13 |
14 | 1.3 The Software is intended for personal and business use. Redistribution, reverse engineering, or any unauthorized use of the Software is prohibited without explicit permission from Tdarr.
15 |
16 | 2. User Responsibilities
17 |
18 | 2.1 Users are responsible for ensuring the integrity and security of their data when using the Software. Tdarr is not responsible for any data loss during processing.
19 |
20 | 2.2 Users must not reverse engineer, decompile, or disassemble the Software. Distribution of the Software without prior written permission from Tdarr is strictly prohibited.
21 |
22 | 3. Intellectual Property and Ownership
23 |
24 | 3.1 The Software, including all intellectual property rights therein, is and shall remain the property of Tdarr.
25 |
26 | 3.2 This EULA does not grant you any ownership interest in the Software, and you are granted only a limited right of use as outlined in this agreement.
27 |
28 | 4. Warranty and Liability
29 |
30 | 4.1 The Software is provided "as is" without any warranty of any kind, either express or implied.
31 |
32 | 4.2 Tdarr is not liable for any damages, including but not limited to, direct, indirect, incidental, or consequential damages, arising out of the use or inability to use the Software.
33 |
34 | 5. Termination
35 |
36 | 5.1 Tdarr may terminate this EULA at any time if the User breaches any term of this agreement.
37 |
38 | 5.2 Users may terminate this agreement at any time by ceasing to use the Software and deleting all copies from their systems.
39 |
40 | 5.3 Upon termination of the license, the User must immediately cease all use of the Software and destroy all copies in their possession.
41 |
42 | 6. Governing Law
43 |
44 | This EULA shall be governed by and construed in accordance with the laws of the United Kingdom.
45 |
46 | 7. Miscellaneous
47 |
48 | 7.1 This EULA constitutes the entire agreement between the parties with respect to the use of the Software and supersedes all prior or contemporaneous understandings regarding such subject matter.
49 |
50 | 7.2 Tdarr reserves the right to modify this EULA at any time, with or without notice. Continued use of the Software following any such modification constitutes your acceptance of the modified EULA.
51 |
52 | If you have any questions about this EULA, please contact Tdarr at support@tdarr.io.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tdarr V2: Distributed Transcoding System
2 | Audio/Video Library Analytics & Transcode/Remux Automation
3 |
4 |
5 |
6 |
7 |
8 |
9 | - FFmpeg/HandBrake + video health checking (Windows, macOS, Linux & Docker)
10 |
11 | [](https://home.tdarr.io/download) [](https://www.reddit.com/r/Tdarr/) [](https://discord.gg/GF8X8cq)
12 |
13 |
14 |
17 |
18 |
19 | About:
20 | More information can be found on the following websites:
21 |
22 | [https://tdarr.io/](https://tdarr.io/)
23 |
24 | [https://docs.tdarr.io/](https://docs.tdarr.io/)
25 |
26 | [Builds](https://docs.tdarr.io/docs/releases/changing-version#all-images)
27 |
28 | Tdarr V2 is a cross-platform conditional based transcoding application for automating media library transcode/remux management in order to process your media files as required. For example, you can set rules for the required codecs, containers, languages etc that your media should have which helps keeps things organized and can increase compatability with your devices. A common use for Tdarr is to simply convert video files from h264 to h265 (hevc), saving 40%-50% in size.
29 |
30 | The application is in the form of a click-to-run web-app, comprised of the following 2 components:
31 |
32 |
33 | - Tdarr_Server - Central process which all Nodes connect with
34 | - Tdarr_Node - Processes running on same/other devices which collect tasks from the Server
35 |
36 |
37 | Put your spare hardware to use with Tdarr Nodes for Windows, Linux (including Linux arm/arm64) and macOS.
38 |
39 | Designed to work alongside applications like Sonarr/Radarr and built with the aim of modularisation, parallelisation and scalability, each library you add has its own transcode settings, filters and schedule. Workers can be fired up and closed down as necessary, and are split into 4 types - Transcode CPU/GPU and Health Check CPU/GPU. Worker limits can be managed by the scheduler as well as manually. For a desktop application with similar functionality please see [HBBatchBeast](https://github.com/HaveAGitGat/HBBatchBeast).
40 |
41 | - Cross-platform Tdarr Nodes which work together with Tdarr Server to process your files
42 | - GPU and CPU workers
43 | - Use/create Tdarr Plugins for infinite control on how your files are processed:
44 | https://github.com/HaveAGitGat/Tdarr_Plugins
45 | - Audio and video library management
46 | - 7 day, 24 hour scheduler
47 | - Folder watcher
48 | - Worker stall detector
49 | - Load balancing between libraries/drives
50 | - Use HandBrake or FFmpeg
51 | - Tested on a 1,000,000 file dummy library
52 | - Search for files based on hundreds of properties
53 | - Library stats
54 | - Hardware transcoding container (install Nvidia plugin on unRAID/Nvidia runtime container on Ubuntu)
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | ---------------------------------------------------------------------------------------
63 | ## Stats
64 | 
65 | ---------------------------------------------------------------------------------------
66 | ## Nodes
67 | 
68 | ---------------------------------------------------------------------------------------
69 | ## Job reports
70 | 
71 | ---------------------------------------------------------------------------------------
72 | ## Property explorer
73 | 
74 | ---------------------------------------------------------------------------------------
75 | ## Worker verdict history
76 | 
77 | ---------------------------------------------------------------------------------------
78 | ## Plugin stack system
79 | 
80 | ---------------------------------------------------------------------------------------
81 | ## Property search
82 | 
83 | ---------------------------------------------------------------------------------------
84 | ## Library schedule
85 | 
86 | ---------------------------------------------------------------------------------------
87 |
88 |
89 | Tdarr is extremely modular/configurable and the main idea behind it is creating a plugin stack to clean up/standardise your files. For example, a typical plugin stack might look like this:
90 |
91 |
92 | (1) Transcode non hevc files into hevc
93 |
94 | (2) Remove subs
95 |
96 | (3) Remove meta data (if title)
97 |
98 | (4) Add aac stereo audio if none (eng preferred)
99 |
100 | (5) Remove closed captions
101 |
102 |
103 | In this example, plugins 1,2,3 and 5 are community plugins which are available for you to use immediately. Plugin 4 can be created in the plugin creator interface in Tdarr and will appear as a local plugin.
104 |
105 |
106 | Each of the plugins are conditional, so are only used if needed. They are located in Tdarr/Documents and are written in JavaScript so if none of the plugins do what you want then you can modify/create new plugins if you have a bit of coding experience (or get the gist from having a look). Steps for doing so are in the README here:https://github.com/HaveAGitGat/Tdarr_Plugins . Ask for help in the Discord channel if need be.
107 |
108 |
109 | Here is an illustration of how the plugin stack works:
110 |
111 | 
112 |
113 | For the term 'streams', here is an example of how a file appears in Tdarr search results:
114 |
115 | 
116 |
117 | That file has 3 streams - a video, audio and subtitle stream. Subtitles and closed captions are very different. Where is the closed caption data in this example? It's embedded inside the h264 video stream.
118 |
119 |
120 | Extra streams and closed captions which you don't need can cause problems with direct playing and syncing files, so you might as well remove them (it's recommended to use something like Bazarr for subtitles). Even when playing files in programs such as VLC or Kodi, subtitles/closed captions can cause playback delays and make things stuttery for a few seconds when jumping around the video.
121 |
122 |
123 | Extra streams can also take up a lot of space. Don't be surprised to see some files in your library with 15+ audio/commentary/subtitle tracks in a bunch of different languages. These can take up an extra GB+ per file.
124 |
125 |
126 | The plugin creator is split into 'Filters' and 'Actions'. Filters encapsulate the actions, so the actions will only be carried out if the filter conditions are met.
127 |
128 |
129 | Current filters:
130 |
131 | Filter by codec
132 |
133 | Filter by medium
134 |
135 | Filter by age
136 |
137 | Filter by resolution
138 |
139 | Filter by size
140 |
141 |
142 |
143 | Current actions:
144 |
145 | Transcode - HandBrake basic options
146 |
147 | Transcode - HandBrake/FFmpeg custom arguments
148 |
149 | Transcode - Standardise audio stream codecs
150 |
151 | Transcode - Add audio stream
152 |
153 | Transcode - Keep one audio stream
154 |
155 | Remux container
156 |
157 |
158 | Some actions/plugins have built-in filters (specified in the plugin creator). This means they'll automatically detect if a file needs to be processed or not (such as the remove subtitles community plugin). Additional filters can be added.
159 |
160 | Some of the actions have become quite complicated so take a bit more time. For example, the 'Keep one audio stream' has 16 different outcomes as it tries to determine the best audio stream to keep based on the codec, language and channel count you specify.
161 |
162 |
163 | If you have a request for a new filter/action, then try and think of it generically so I can implement it in way that other people can configure and apply it to their (slightly) different circumstances. Request on GitHub,Reddit or Discord.
164 |
165 |
166 | For example, to maximize direct play, a plugin stack like this can be used:
167 |
168 |
169 | (1) If not in h264, transcode into h264 [h264 is a more universal video codec than others]
170 |
171 | (2) If not in mp4, remux into mp4 [mp4 is the most universal container]
172 |
173 | (3) Remove subs
174 |
175 | (4) Remove closed captions
176 |
177 | (5) Add aac stereo audio if none (eng preferred) [very universal audio codec/channel count]
178 |
179 | (6) Remove meta-data if title meta detected [Stops annoying titles appearing in Plex]
180 |
--------------------------------------------------------------------------------
/docker/Dockerfile.base:
--------------------------------------------------------------------------------
1 | FROM lsiobase/ubuntu:jammy
2 |
3 | ENV \
4 | LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri" \
5 | LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu" \
6 | NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \
7 | NVIDIA_VISIBLE_DEVICES="all" \
8 | HANDBRAKE=1.7.3
9 |
10 | ENV WEB_UI_PORT="8265" SERVER_PORT="8266" NODE_PORT="8267" PUID="1000" PGID="1000" UMASK="002" TZ="Etc/UTC" HOME="/home/Tdarr"
11 |
12 | # handle deps
13 | RUN apt-get update && \
14 | apt-get install -y \
15 | software-properties-common \
16 | git \
17 | trash-cli && \
18 | mkdir -p \
19 | /app \
20 | /logs \
21 | /temp \
22 | "${HOME}" && \
23 | # useradd -u ${PUID} -U -d ${HOME} -s /bin/false Tdarr && \
24 | # usermod -G users Tdarr && \
25 |
26 | apt-get update && \
27 | apt-get install -y curl unzip wget comskip \
28 | # for apprise
29 | python3-pip && \
30 | pip3 install apprise && \
31 |
32 | # MkvToolNIX
33 | wget -O /usr/share/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg && \
34 | echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/mkvtoolnix.download.list && \
35 | echo "deb-src [arch=amd64 signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/ubuntu/ jammy main" | tee -a /etc/apt/sources.list.d/mkvtoolnix.download.list && \
36 | apt-get update && apt-get install -y mkvtoolnix && \
37 |
38 | #cc-extractor
39 | apt-get install -y \
40 | libglew-dev \
41 | libglfw3-dev \
42 | cmake \
43 | gcc \
44 | libcurl4-gnutls-dev \
45 | tesseract-ocr \
46 | libtesseract-dev \
47 | libleptonica-dev \
48 | clang \
49 | libclang-dev && \
50 | # libgpac-dev && \
51 | git clone https://github.com/CCExtractor/ccextractor.git && \
52 | cd ccextractor/linux && \
53 | git checkout 35e73c1c90ce3ca69394d3523836bb1cdec28f11 && \
54 | ./build -without-rust && \
55 | mv ./ccextractor /usr/bin/ccextractor && \
56 |
57 | cd / && rm -rf /ccextractor && \
58 | if uname -m | grep -q x86; then \
59 |
60 | # Setup Intel Package Repository
61 | curl -sSL https://repositories.intel.com/gpu/intel-graphics.key | \
62 | gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
63 | echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \
64 | tee /etc/apt/sources.list.d/intel-gpu-jammy.list && \
65 | apt-get update && \
66 |
67 | apt install -y \
68 | intel-opencl-icd \
69 | intel-level-zero-gpu \
70 | level-zero \
71 | intel-media-va-driver-non-free \
72 | libmfx1 \
73 | libmfxgen1 \
74 | libvpl2 \
75 | libegl-mesa0 \
76 | libegl1-mesa \
77 | libegl1-mesa-dev \
78 | libgbm1 \
79 | libgl1-mesa-dev \
80 | libgl1-mesa-dri \
81 | libglapi-mesa \
82 | libgles2-mesa-dev \
83 | libglx-mesa0 \
84 | libigdgmm12 \
85 | libxatracker2 \
86 | mesa-va-drivers \
87 | mesa-vdpau-drivers \
88 | mesa-vulkan-drivers \
89 | va-driver-all \
90 | vainfo \
91 | hwinfo \
92 | clinfo && \
93 |
94 | # FFmpeg 6
95 | ffmpegversion=$(curl --silent https://api.github.com/repos/jellyfin/jellyfin-ffmpeg/releases/latest | grep -oP '"tag_name":\s*"v\K[^"]+' | sort -h | tail -n1) && \
96 | wget https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v$ffmpegversion/jellyfin-ffmpeg6_$ffmpegversion-jammy_amd64.deb && \
97 | apt install -y \
98 | ./jellyfin-ffmpeg6_$ffmpegversion-jammy_amd64.deb && \
99 | rm -rf ./jellyfin-ffmpeg6_$ffmpegversion-jammy_amd64.deb && \
100 | ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \
101 | ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/tdarr-ffmpeg && \
102 | # apt-get install -y ffmpeg && \
103 | # HandBrake dependencies
104 | apt-get install -y \
105 | autoconf \
106 | automake \
107 | build-essential \
108 | cmake \
109 | git \
110 | libass-dev \
111 | libass9 \
112 | libbz2-dev \
113 | libfontconfig-dev \
114 | libfreetype-dev \
115 | libfribidi-dev \
116 | libharfbuzz-dev \
117 | libjansson-dev \
118 | liblzma-dev \
119 | libmp3lame-dev \
120 | libnuma-dev \
121 | libogg-dev \
122 | libopus-dev \
123 | libsamplerate0-dev \
124 | libspeex-dev \
125 | libtheora-dev \
126 | libtool \
127 | libtool-bin \
128 | libturbojpeg0-dev \
129 | libvorbis-dev \
130 | libx264-dev \
131 | libxml2-dev \
132 | libvpx-dev \
133 | m4 \
134 | make \
135 | meson \
136 | nasm \
137 | ninja-build \
138 | patch \
139 | pkg-config \
140 | # python \
141 | tar \
142 | zlib1g-dev \
143 | # QSV dependencies
144 | libva-dev \
145 | libdrm-dev && \
146 |
147 | rm -rdf /tmp/handbrake && \
148 | mkdir -p /tmp/handbrake && \
149 | git clone \
150 | --branch ${HANDBRAKE} \
151 | --depth 1 https://github.com/HandBrake/HandBrake.git \
152 | /tmp/handbrake && \
153 | cd /tmp/handbrake && \
154 | ./configure \
155 | --enable-nvenc \
156 | --enable-qsv \
157 | --enable-x265 \
158 | --disable-gtk \
159 | --launch-jobs=14 \
160 | --launch \
161 | --force && \
162 | make --directory=build install && \
163 | cp /tmp/handbrake/build/HandBrakeCLI /usr/local/bin/HandBrakeCLI && \
164 | rm -rdf /tmp/handbrake/ ; \
165 | fi && \
166 | if uname -m | grep -q aarch64; then \
167 | apt-get install -y handbrake-cli ffmpeg && \
168 | ln -s /usr/bin/ffmpeg /usr/local/bin/tdarr-ffmpeg ; \
169 | fi && \
170 | if uname -m | grep -q armv7l; then \
171 | apt-get install -y handbrake-cli ffmpeg && \
172 | ln -s /usr/bin/ffmpeg /usr/local/bin/tdarr-ffmpeg ; \
173 | fi && \
174 |
175 | trash-empty && \
176 | if uname -m | grep -q x86; then \
177 | apt-get clean && \
178 | apt purge -y \
179 | g++-9 \
180 | gcc-9 \
181 | # libc6-dev \
182 | libstdc++-9-dev \
183 | cpp-9 \
184 | libgcc-9-dev \
185 | libstd-rust-dev \
186 | # libllvm12 \
187 | libicu-dev \
188 | cargo \
189 | libstd-rust-1.65 \
190 | libstd-rust-dev \
191 | git \
192 | cmake \
193 | python3-pip ; \
194 | fi && \
195 | apt autoremove -y
196 |
--------------------------------------------------------------------------------
/docker/Dockerfile.final:
--------------------------------------------------------------------------------
1 | ARG VERSION
2 | ARG DATE
3 |
4 | FROM docker.io/haveagitgat/tdarr_acc:base_${VERSION}_${DATE}
5 |
6 | ARG VERSION
7 | ARG MODULE
8 | ARG DATE
9 |
10 | ENV WEB_UI_PORT="8265" SERVER_PORT="8266" NODE_PORT="8267" PUID="1000" PGID="1000" UMASK="002" TZ="Etc/UTC" HOME="/home/Tdarr"
11 |
12 |
13 | ENV MODULE_LINK=""
14 | ENV NODE_LINK=""
15 | ENV BASE_LINK="https://tdarrs.s3.us-west-000.backblazeb2.com/dev/versions/$VERSION"
16 | ENV inContainer="true"
17 |
18 | # handle tdarr binaries
19 | RUN echo $MODULE && echo $VERSION && echo $DATE && \
20 | if [ "$MODULE" = "Tdarr_Node" ]; then \
21 | echo removing /tdarr_server && \
22 | rm -rdf /etc/services.d/tdarr_server ; \
23 | fi && \
24 |
25 | apt-get update && apt-get install -y curl unzip mkvtoolnix libtesseract-dev && \
26 | if uname -m | grep -q x86; then \
27 | MODULE_LINK="${BASE_LINK}/linux_x64/${MODULE}_$DATE.zip" && \
28 | NODE_LINK="${BASE_LINK}/linux_x64/Tdarr_Node_$DATE.zip" ; \
29 | fi && \
30 | if uname -m | grep -q aarch64; then \
31 | MODULE_LINK="${BASE_LINK}/linux_arm64/${MODULE}_$DATE.zip" && \
32 | NODE_LINK="${BASE_LINK}/linux_arm64/Tdarr_Node_$DATE.zip" ; \
33 | fi && \
34 | if uname -m | grep -q armv7l; then \
35 | MODULE_LINK="${BASE_LINK}/linux_arm/${MODULE}_$DATE.zip" && \
36 | NODE_LINK="${BASE_LINK}/linux_arm/Tdarr_Node_$DATE.zip" ; \
37 | fi && \
38 |
39 | echo MODULE_LINK=$MODULE_LINK && \
40 | echo NODE_Link=$NODE_LINK && \
41 | curl --connect-timeout 120 --retry 5 -o /tmp/$MODULE.zip -L \
42 | "$MODULE_LINK" && \
43 | unzip -q /tmp/$MODULE.zip -d /app/$MODULE -x *.exe && \
44 | if [ "$MODULE" = "Tdarr_Server" ]; then \
45 | curl --connect-timeout 120 --retry 5 -o /tmp/Tdarr_Node.zip -L \
46 | "$NODE_LINK" && \
47 | unzip -q /tmp/Tdarr_Node.zip -d /app/Tdarr_Node -x *.exe ; \
48 | fi && \
49 | rm -rdf /tmp/$MODULE.zip && \
50 | rm -rdf /tmp/Tdarr_Node.zip && \
51 |
52 | cp -r /app /app_test && \
53 | runTests=true runDockerTests=true /app_test/$MODULE/$MODULE && \
54 | if [ "$MODULE" = "Tdarr_Server" ]; then \
55 | runTests=true runDockerTests=true /app_test/Tdarr_Node/Tdarr_Node ; \
56 | fi && \
57 | rm -rdf /app_test && \
58 |
59 | trash-empty && \
60 | apt-get autoremove -y
61 |
62 | EXPOSE ${NODE_PORT}
63 | EXPOSE ${WEB_UI_PORT}
64 | EXPOSE ${SERVER_PORT}
65 | ENTRYPOINT ["/init"]
--------------------------------------------------------------------------------
/docker/Makefile:
--------------------------------------------------------------------------------
1 | USERNAME=haveagitgat
2 | REPO=_acc
3 | TAG=dev
4 | VERSION=2.00.18
5 | # PLATFORMS=linux/amd64
6 | # PLATFORMS=linux/amd64,linux/arm/v7
7 | PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7
8 |
9 | build-server:
10 | docker buildx build -f Dockerfile -t ${USERNAME}/tdarr${REPO}:${TAG} --build-arg VERSION=$(VERSION) --build-arg MODULE=Tdarr_Server --platform ${PLATFORMS} --push .
11 | build-node:
12 | docker buildx build -f Dockerfile -t ${USERNAME}/tdarr_node${REPO}:${TAG} --build-arg VERSION=$(VERSION) --build-arg MODULE=Tdarr_Node --platform ${PLATFORMS} --push .
--------------------------------------------------------------------------------
/docker/root/etc/cont-init.d/01-setup-perms:
--------------------------------------------------------------------------------
1 | #!/usr/bin/with-contenv bash
2 |
3 | groupmod -o -g "${PGID}" Tdarr
4 | usermod -o -u "${PUID}" Tdarr
5 |
6 | echo "
7 | User uid: $(id -u Tdarr)
8 | User gid: $(id -g Tdarr)
9 | -------------------------------------
10 | "
11 |
12 | chown -R ${PUID}:${PGID} \
13 | "${HOME}" \
14 | /temp \
15 | /logs
16 |
17 |
18 | if [ ! -f /firstRun ]; then
19 | echo "Chowning the appassets, this make take some time"
20 | chown -R ${PUID}:${PGID} /app
21 | chmod a+rwx -R /app/Tdarr_Node/assets/{app/fileScanner/,app/ffmpeg/}
22 | chmod a+rwx -R /app/Tdarr_Server/node_modules/@ffprobe-installer/linux-x64/ffprobe
23 | touch /firstRun
24 | fi
25 |
--------------------------------------------------------------------------------
/docker/root/etc/cont-init.d/02-hw-transcoding:
--------------------------------------------------------------------------------
1 | #!/usr/bin/with-contenv bash
2 |
3 | DEVICES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/vcsm /dev/vc-mem /dev/video1? -type c -print 2>/dev/null)
4 |
5 | if hash nvidia-smi 2>/dev/null; then
6 | echo "Runtime detected"
7 | echo "GPU: $(nvidia-smi --query-gpu=name --format=csv,noheader)"
8 | echo "Capabilities: ${NVIDIA_DRIVER_CAPABILITIES} Devices: ${NVIDIA_VISIBLE_DEVICES}"
9 | fi
10 |
11 | for i in ${DEVICES}; do
12 | # Get the group ID and NAME (if exists) for the current device in the list
13 | DEVICE_GROUP_ID=$(stat -c '%g' "$i")
14 | DEVICE_GROUP_NAME=$(getent group "${DEVICE_GROUP_ID}" | awk -F: '{print $1}')
15 |
16 | # If group NAME doesn't exist, create it and assign it the group ID
17 | if [[ -z "${DEVICE_GROUP_NAME}" ]]; then
18 | DEVICE_GROUP_NAME="video${RANDOM}"
19 | groupadd -g "${DEVICE_GROUP_ID}" "${DEVICE_GROUP_NAME}"
20 | fi
21 |
22 | getent group "${DEVICE_GROUP_NAME}" | grep -q Tdarr || usermod -a -G "${DEVICE_GROUP_NAME}" Tdarr
23 | done
24 |
--------------------------------------------------------------------------------
/docker/root/etc/services.d/tdarr_node/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/with-contenv bash
2 |
3 | cd /app/Tdarr_Node || exit 1
4 |
5 | if [ -d "/etc/services.d/tdarr_server" ] && [ "$internalNode" = true ]; then \
6 | echo "Starting Tdarr_Node"
7 | exec s6-setuidgid Tdarr ./Tdarr_Node
8 | fi
9 |
10 | if [ ! -d "/etc/services.d/tdarr_server" ]; then \
11 | echo "Starting Tdarr_Node"
12 | exec s6-setuidgid Tdarr ./Tdarr_Node
13 | fi
14 |
--------------------------------------------------------------------------------
/docker/root/etc/services.d/tdarr_server/run:
--------------------------------------------------------------------------------
1 | #!/usr/bin/with-contenv bash
2 |
3 | echo "Starting Tdarr_Server"
4 |
5 | cd /app/Tdarr_Server || exit 1
6 |
7 | exec s6-setuidgid Tdarr ./Tdarr_Server
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tdarr",
3 | "version": "2.28.01",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {},
7 | "repository": {
8 | "type": "git",
9 | "url": "git+https://github.com/HaveAGitGat/tdarr.git"
10 | },
11 | "author": "",
12 | "license": "See LICENSE.md",
13 | "bugs": {
14 | "url": "https://github.com/HaveAGitGat/tdarr/issues"
15 | },
16 | "homepage": "https://github.com/HaveAGitGat/tdarr#readme",
17 | "dependencies": {
18 | "babel-eslint": "^10.1.0"
19 | },
20 | "devDependencies": {}
21 | }
22 |
--------------------------------------------------------------------------------
/updater/README.md:
--------------------------------------------------------------------------------
1 | # Tdarr v2 Preview
2 |
3 | Updated instructions: https://tdarr.io/
4 |
5 | 1.99.11 Module Matrix
6 |
7 | | Platform/Module | Updater | Server | Node | WebUI | Desktop |
8 | |----------------------|---------|--------|------|-------|---------|
9 | | linux_x64 | ✔ | ✔ | ✔ | ✔ | ✔ |
10 | | win32_x64 | ✔ | ✔ | ✔ | ✔ | ✔ |
11 | | darwin_x64 | ✔ | ✔ | ✔ | ✔ | ✔ |
12 | | linux_arm (Armv7) | ✔ | ✔ | ✔ |✔ | - |
13 | | Docker | - | ✔ tdarr:1.99.11| ✔ tdarr_node:1.99.11| ✔ tdarr:1.99.11| - |
14 |
15 | Descriptions:
16 |
17 | | Module\Desc. | |
18 | |--------------|--------------------------------------------------------------------------------------------------------------------------------|
19 | | Updater | Module used to update the other modules |
20 | | Server | The core of Tdarr. All modules connect with it. Does not do any encoding. |
21 | | Node | Module used for encoding. Can be run on same machine as server or remotely. |
22 | | WebUI | Module used for web user interface. Can be run on same machine as server or remotely. |
23 | | Desktop | Module used for desktop user interface. Can be run on same machine as server or remotely. Has options to start up server/node. |
24 |
25 |
26 | Download the relevant Tdarr_Updater:
27 |
28 | Tdarr_Updater linux_x64
29 |
30 | Tdarr_Updater win32_x64
31 |
32 | Tdarr_Updater darwin_x64
33 |
34 | Tdarr_Updater linux_arm
35 |
36 |
37 | Unzip it.
38 |
39 | If on linux or mac it's best to run the packages from a terminal so you can see the output.
40 |
41 | Run /Tdarr_Updater
42 |
43 | 4 Modules will be downloaded.
44 |
45 | Run:
46 |
47 | /Tdarr_Server/Tdarr_Server
48 |
49 | You should be able to see 7 tests run in the logs:
50 |
51 | [Info] Tdarr_Server - Binary test 1: handbrakePath working
52 | [INFO] Tdarr_Server - Binary test 2: ffmpegPath working
53 | [INFO] Tdarr_Server - Binary test 3: mkvpropeditPath working
54 |
55 | [INFO] Tdarr_Server - Scanner test 1: FFprobe working
56 | [INFO] Tdarr_Server - Scanner test 2: Exiftool working
57 | [INFO] Tdarr_Server - Scanner test 3: Mediainfo working
58 | [INFO] Tdarr_Server - Scanner test 4: CCExtractor working
59 |
60 | If the handbrakePath or ffmpegPath aren't working, you need to set the paths in the config below. mkvpropeditPath is currently not use for anything.
61 |
62 | Run:
63 |
64 | /Tdarr_Node/Tdarr_Node
65 |
66 | You should be able to see 3 tests run in the logs:
67 |
68 | [Info] Tdarr_Node - Binary test 1: handbrakePath working
69 | [INFO] Tdarr_Node - Binary test 2: ffmpegPath working
70 | [INFO] Tdarr_Node - Binary test 3: mkvpropeditPath working
71 |
72 | If the handbrakePath or ffmpegPath aren't working, you need to set the paths in the config below. mkvpropeditPath is currently not use for anything.
73 |
74 | Close both down once init has finished.
75 |
76 | Open /configs/Tdarr_Server_Config.json:
77 |
78 | {
79 | "serverPort": "8266",
80 | "handbrakePath": "",
81 | "ffmpegPath": ""
82 | }
83 |
84 | Set the server port as desired.
85 | Add handbrakePath and ffmpegPath, make sure to use double back slash or a single forward slash in the paths e.g.:
86 |
87 | C:\\ffmpeg\\ffmpeg
88 |
89 | C:/ffmpeg/ffmpeg
90 |
91 | Open /configs/Tdarr_WebUI_Config.json:
92 |
93 | {
94 | "webUIPort": 8265,
95 | "serverIP": "0.0.0.0",
96 | "serverPort": 8266
97 | }
98 |
99 | Set the webUIPort as desired. If running the webUI on the same machine as the server, leave serverIP as is else change it to the server machine IP. Set the serverPort
100 | to the same as in the previous config.
101 |
102 | Open /configs/Tdarr_Node_Config.json:
103 |
104 | {
105 | "nodeID": "QUkJYfSSD",
106 | "nodeIP": "0.0.0.0",
107 | "nodePort": "8267",
108 | "serverIP": "0.0.0.0",
109 | "serverPort": "8266",
110 | "handbrakePath": "",
111 | "ffmpegPath": "",
112 | "pathTranslators": [
113 | {
114 | "server": "",
115 | "node": ""
116 | }
117 | ]
118 | }
119 |
120 | If runnig the node and server on the same machine leave the IPs as-is else set the machine IPs.
121 |
122 |
123 | Add handbrakePath and ffmpegPath. Set whichever nodePort you like. If running a node on a different machine to the server,
124 | make sure to specify the serverIP address. Also make sure the node and server machines have the same library and cache paths. For example,
125 | y:\Movies on the server should point to the same location as y:\Movies on the node machine. Else you can use the pathTranslators
126 | in the config above, similar to Docker. e.g.:
127 |
128 | {
129 | "server": "y:/Movies",
130 | "node": "z:/Stuff/Movies"
131 | }
132 |
133 | In the above config, when the server sends a file path to the node, the base path will be translated and vice versa.
134 |
135 | Make sure ports are open (8266 for server and 8267 for a default node).
136 |
137 | Run /Tdarr_Server/Tdarr_Server
138 |
139 | Run /Tdarr_Node/Tdarr_Node
140 |
141 | Run /Tdarr_WebUI/Tdarr_WebUI
142 |
143 | Visit http://localhost:8265/ and the Tdarr UI should be visible. The connected node should appear on the 'Tdarr' tab.
144 |
145 |
146 |
147 |
148 | For Tdarr Desktop, run /Tdarr_Desktop/Tdarr_Desktop which will by default start a server and a local node.
149 |
150 | A new config /configs/Tdarr_Desktop_Config.json will be created:
151 |
152 | {
153 | "Tdarr_Node": true,
154 | "Tdarr_Server": true,
155 | "Tdarr_WebUI": false,
156 | "serverIP": "0.0.0.0",
157 | "serverPort": 8266
158 | }
159 |
160 | Above you can specify which modules will run when you start Tdarr_Desktop
161 |
162 | If all is working, you should be able to start up workers on different nodes on the 'Tdarr' tab if you have a library set up and some files scanned.
163 | 
164 |
165 | Logs for all modules stored in:
166 |
167 | /logs/
168 |
169 | Using docker, all server plugins, samples, database files etc are stored in '/app/server' so make sure to map that folder to your host.
170 | The 'tdarr' container contains both Tdarr_Server and Tdarr_WebUI.
171 |
172 | Note: The server and nodes must have the same library folders and cache mounted.
173 |
174 | Docker run examples:
175 |
176 | docker run -ti \
177 | -v /home/h/Desktop/server:/app/server \
178 | -v /home/h/Desktop/Transcode:/mount \
179 | --network host \
180 | -e "serverIP=0.0.0.0" \
181 | -e "serverPort=8266" \
182 | -e "webUIPort=8265" \
183 | -e "TZ=Europe/London" \
184 | -e PUID=1000 \
185 | -e PGID=1000 \
186 | haveagitgat/tdarr:1.99.11
187 |
188 | docker run -ti \
189 | -v /home/h/Desktop/Transcode:/mount \
190 | -e "serverIP=0.0.0.0" \
191 | -e "serverPort=8266" \
192 | --network host \
193 | -e "TZ=Europe/London" \
194 | -e PUID=1000 \
195 | -e PGID=1000 \
196 | haveagitgat/tdarr_node:1.99.11
197 |
198 | Note: All the variables in the config files can be set through environment variables
199 |
200 | Work in progress. Feedback welcome!
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
--------------------------------------------------------------------------------