Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@qgustavor
Created July 11, 2021 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qgustavor/af5e4665febfc31e68fe0db101bbded5 to your computer and use it in GitHub Desktop.
Save qgustavor/af5e4665febfc31e68fe0db101bbded5 to your computer and use it in GitHub Desktop.
// ----------------------- recipe -----------------------
// -- Convert files from queue until the buffer gets 12 files
// Files are converted based on the source
// * 10 bit videos are converted to 8 bit
// * 4:4:4 videos are converted to 8 bit with -pix_fmt yuv420p
// * AC3 audios are converted to AAC
// * (maybe) splited MKVs are merged (needs to run before ffmpeg)
// -- Check if the next 12 to 24 files were downloaded
// Seems hard making it download files, so it just alerts
// It tries to find a matching torrent and checks SHA-1
// if it's not possible it tries to check CRC32 from file name
// in the last case it just checks if the file exist
// -- Check if there is more than 36 items remaining in the queue

It was the first thing I wrote back in 2016 when I started my anime handler project.

The downloading feature turned to be one of the most important in this project, because of it I don't need to handle downloads manually anymore.

Merging splitted MKVs was implemented, but as I almost never used it (just for Gunslinger Girl) this code was eventually disabled.

File convertion turned to be a lot more complex. Also 4:4:4 is chroma subsampling, 8 is bit depth, different things!

SHA-1 checking was never implemented.

It checks for 40 files instead of 24.

The buffer is now limited by time, not count.

The 36 items limit was raised to 100, but this warning never was reached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment