├── .github ├── dependabot.yml └── workflows │ └── docker-publish.yml ├── Dockerfile ├── LICENSE └── README.md /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions. 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | # Maintain dockerfile latest version 9 | - package-ecosystem: "docker" 10 | directory: "/" 11 | schedule: 12 | interval: "daily" 13 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:22-alpine 2 | MAINTAINER Adriel Kloppenburg 3 | 4 | LABEL h265ize_version="latest" architecture="amd64" 5 | 6 | RUN apk add --no-cache --update-cache git ffmpeg && \ 7 | npm install FallingSnow/h265ize --global --no-optional && \ 8 | apk del git && \ 9 | mkdir /input && mkdir /output 10 | 11 | VOLUME ["/input", "/output"] 12 | WORKDIR /h265ize 13 | 14 | ENTRYPOINT ["/usr/local/bin/h265ize", "/input", "-d", "/output"] 15 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docker image 2 | on: 3 | push: 4 | branches: [ master ] 5 | jobs: 6 | push_to_registry: 7 | name: Push Docker image to Docker Hub 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Set DATE var 11 | run: echo "DATE=$(date '+%Y-%m-%d_%H.%M.%S')" >> $GITHUB_ENV 12 | 13 | - name: Check out the repo 14 | uses: actions/checkout@v4 15 | 16 | - name: Log in to Docker Hub 17 | uses: docker/login-action@v3.2.0 18 | with: 19 | username: ${{ secrets.DOCKER_USERNAME }} 20 | password: ${{ secrets.DOCKER_PASSWORD }} 21 | 22 | - name: Build and push Docker image 23 | uses: docker/build-push-action@v6.2.0 24 | with: 25 | context: . 26 | push: true 27 | tags: | 28 | ${{ secrets.DOCKER_USERNAME }}/h265ize:latest 29 | "${{ secrets.DOCKER_USERNAME }}/h265ize:${{ env.DATE }}" 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Adriel Kloppenburg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # h265ize 2 | 3 | A [Docker](http://docker.com) image for [h265ize](https://github.com/FallingSnow/h265ize), to make it easy to convert videos to h.265. 4 | 5 | ## Getting Started 6 | 7 | ```sh 8 | docker run -d --init \ 9 | --name h265ize \ 10 | -u \ 11 | --restart unless-stopped \ 12 | -v :/input \ 13 | -v :/output \ 14 | adriel/h265ize 15 | ``` 16 | 17 | Replace `` with your user's ID, you can get this by running `id -u`, e.g. `-u 1002 `. 18 | 19 | This is to make sure the container can read/write your input and output directories. 20 | 21 | #### How does it work? 22 | 23 | Once your container is up and running move or copy a video to your input directory and h265ize will automatically start converting it to h.265 as per your settings. It **won't** convert any files already in the input folder when the docker container is started, only **new/added** files. 24 | 25 | A file will appear straight away in the output directory while it's **still** being converted, please wait for it to finish converting before moving it out, or else you'll have a half converted file. In a [future update to h265ize](https://github.com/FallingSnow/h265ize/issues/77) it will append, `.h265tmp` to the end of a file while it's being converted. 26 | 27 | ## Optional parameters 28 | 29 | You can add your own parameters. 30 | 31 | #### Set quality 32 | 33 | For example, you may want to change the default quality from 19 to 25 (higher number = lower quality/smaller file) 34 | 35 | ```sh 36 | docker run -d --init \ 37 | --name h265ize \ 38 | -u \ 39 | --restart unless-stopped \ 40 | -v /location/to/video/files/input:/input \ 41 | -v /location/to/video/files/output:/output \ 42 | adriel/h265ize -q 25 43 | ``` 44 | Note the `-q 25` added after `adriel/h265ize`. 45 | 46 | You can add any of the options mentioned on the [official h265ize GitHub page](https://github.com/FallingSnow/h265ize#options) after the image name. 47 | 48 | #### Paths in container 49 | 50 | Directory where video files are you want to convert to h.265: `/input` 51 | 52 | Directory where converted h.265 videos will be created: `/output` 53 | 54 | ## Production use 55 | 56 | It's [recommended](https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md) to add the NODE_ENV environment variable and Node.js memory limits. 57 | 58 | ```sh 59 | docker run -d --init \ 60 | --name h265ize \ 61 | -e "NODE_ENV=production" \ 62 | -u \ 63 | -m "300M" --memory-swap "1G" \ 64 | --restart unless-stopped \ 65 | -v /home/yo/dockers/h265ize/docker_files/input:/input \ 66 | -v /home/yo/dockers/h265ize/docker_files/output:/output \ 67 | adriel/h265ize 68 | ``` 69 | 70 | ### Info - program versions 71 | 72 | [h265ize](https://github.com/FallingSnow/h265ize) - latest code on the master branch as the latest NPM version doesn't support the `--watch` option. 73 | 74 | [Node.js ]([https://hub.docker.com/_/node/) - latest version, 7.8.0. 75 | 76 | ##### Shell access 77 | 78 | ```sh 79 | docker exec -it h265ize /bin/sh 80 | ``` 81 | 82 | ##### Logs 83 | 84 | ```sh 85 | docker logs -f h265ize 86 | ``` 87 | 88 | #### Change log 89 | 12/11/2022 - Updated to node v19 90 | 11/04/2017 - initial build. 91 | 92 | ---- 93 | 94 | Please feel free to leave a comment if you have any questions. 95 | --------------------------------------------------------------------------------