Giter VIP home page Giter VIP logo

transcoder's Introduction

DEPRECATED

This repository is discontinued in favor of https://github.com/Vilsol/transcoder-go

Transcoder

Docker container to transcode videos in mounted volume to H265

To run

  1. Change the volume to point at your root media folder
  2. docker-compose up -d

To view live transcoding

docker logs transcoder_transcoder_1 && docker attach --no-stdin transcoder_transcoder_1

(CTRL-C is safe to exit with)

Telegram notifications

  1. Create a .env file
  2. Set BOT_KEY and CHAT_ID variables
  3. Recreate the container

Ignoring files

You can ignore files using .transcodeignore, which will make it not transcode any files in that directory or subdirectories.

Re-Transcoding H265 -> H265

By default, the option to re-transcode H265 -> H265 is enabled. You can turn it off by setting environment variable H265_TRANSCODE to False

The other variable H265_MB_H defines how many MB/h is your target. If a file is below that target, it will not attempt to re-transcode the file.

It uses the formula size / duration instead of the reported bit rate by ffmpeg, as it seems it is often incorrect and not representative of the resulting file size.

All Environment Variables

Variable Description Default
ROOT_PATH The path of media to transcode (inside the container) /media
BOT_KEY The Telegram bot key
CHAT_ID The Telegram chat ID to report to
HOST The Host to specify in Telegram messages
CRF The Constant Rate Factor quality setting. Lower number, better quality 16
H265_TRANSCODE Whether to re-transcode H265 content True
H265_MB_H Minimum MB/h to attempt to re-transcode H265 content 1000

transcoder's People

Contributors

aaomidi avatar vilsol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

transcoder's Issues

Implement transcode cancel functionality

It should be possible for the user to cancel the ongoing transcode through a button attached to the telegram message. This could happen for example when the user feels like the transcode will be cut off anyways, so it can be stopped from wasting time. The UI implementation for this would be trivial, but I am not certain on how exactly to cancel the running transcode task, especially if it should exit gracefully and mark the file as processed/skipped.

Checking media codec before transcode

if data['stream'][i]['codec_name'] == 'h264':

I would recommend against doing this, unfortunately some media that is already h265 has been transcoded with terrible settings. This causes the files to have very large sizes already and retranscoding them would properly decrease the file sizes.

PUID and PGID arguments

Allow me to specify PUID and PGID values as env variables. This will make sure that the files created by the transcoder have the correct owner & group.

For reference, linuxserver docker containers all allow this.

Setting H265_TRANSCODE doesn't do anything

Looking at the Python script, H265_TRANSCODE isn't tied to anything, so it's being totally ignored. I have it set to H265_TRANSCODE=False, but it's still transcoding H265 compressed files. Of course, it's transcoding again as the setting isn't referenced in the code at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.