Linux/Mac script for transcoding and adding to Plex


#63

@amann180 - I can’t think of anything else that might fix it from my end. Sorry! But the solution of manually editing your transcode.db file the first time should work. Just delete all the show numbers you want to transcode, or add any that you want to skip.


#64

@karlmitchell. I’m still trying to make it work! I was reading in the comments of channels-transcode.sh and it says:

# You can run without comparing with the transcode database and use current directory thus:
#  channels-transcoder.sh 62 63 DEST_DIR="" DAYS=0 TMPDIR="$(pwd)"

What are the 62 and 63 command line options? Are they the show numbers to tanscode?
Thanks!
-Andrew


#65

I had the same issues and could never get it to work. I gave up, but I might try to get it to work on my Synology one day.


#66

@amann180 and @timstephens24: It certainly seems to be a real issue. I followed some hunches and might have tracked down the problem and fixed it (bearing in mind I can’t reproduce it).

This fix, in part, necessitates the addition of the coreutils prerequisite, which is typically installed by default in Linux distributions, but not on Macs. I know for a fact that this is available via the Mac homebrew software manager (brew install coreutils), but can’t say for sure about other package managers. Once that is installed, you should also go into your ~/.profile and remove any lines starting alias realpath.

I have updated both the install.sh script and the channels-transcoder.sh script, as well as edited the README file for some additional clarity. My solution is actually more simple now.

@amann180: Running channels-transcoder.sh with specific numbers allows transcoding of show by number, yes. It will transcode regardless of whether it already exists in transcode.db.


#67

Here’s an alternative I’ve used on macOS in the past:

myrealpath() { /usr/bin/ruby -e 'puts File.realpath(ARGV[0])' -- "[email protected]" }

#68

Nice. However, coreutils on home brew does the job perfectly.


#69

Reviving an old thread here–I’d love to get this working, but so far I am stuck on the install. I’ve already run

brew install jq curl coreutils atomicparsley parallel

And everything is installed, but when I run the installer, it tells me that pre-requisites are not installed, and it stops. Any ideas?

Some pre-requisites not installed.
Please try again or use “bash install.sh force” to proceed regardless, then edit your prefs file manually
You will need wget regardless for this install script to work


#70

I tried the script but ended up giving up. I didn’t want to risk a perfectly clean installation of the Channels server. At some point in time, developer @tmm1 mentioned the possibility of putting some post-processing into the server code. I’m crossing my fingers on that. Even the most basic post processing (transcode, copy, move) selected on a per-file o per-series base would be a killer function for many. Maybe @tmm1 can tell us if that’s still in the roadmap…


#71

A quick comment that the script does not in any way change the Channels DVR install or its directories. Sorry you’re having problems with it. Hopefully I’ll have a chance to make it more user friendly in the near future.


#72

I am coming from a mythtv backend and Kodi front end on a Mac mini and I leveraged some scripts to create something very similar.

I took the code from github and made some modifications and potential bug fixes. It was a great starting/ending point for me.

The key thing that I changed was to encode in x265 HEVC that supports iTunes. This HEVC format runs on my macOS. iOS and tvOS. I will probably parameterize it so that the default is x264 and you can turn on x265 vs the current hardcore to x264. X265 takes more encoding time but it is smaller at the same quality.

I focused on just transcoding my TV passes that I have explicitly called out . For example. “Poldark” vs all recordings in the last day. I tend to record sports and just want to time shift slightly. I created a batch file with the list of Tv shows that I kickoff at midnight.

Btw . I looked at the install script and install the prerequisites and code manually. That helped me know where things resided.

New feature request for Channels DVR: I think I saw this alreaady but I would love to have in the recording to have the ability of calling out user jobs ( like this script) to post process the recording and hsve the ability of deferring that job to a time like midnight. This capability is what I had with mythiv. You can commercial trim , encode or whatever.


#73

Excellent. Thanks! This was intended more as a seed for community contributions, and so I fully encourage this sort of modification and contribution. If you can modify it without breaking the existing functionality, that would be really handy to upload or fork from the existing code.


#74

Great work here!!!

Any way to isolate one show to transcode? As in I only want “Dr Phil” to transcode daily. Not all of my recordings.


#75

I use a modified fork version, but you should be able to do

channels-transcoder.sh “Dr Phil" or is it “Dr. Phil”

in fact, I have a script that is nothing more than a batch file that just lists them individually and I run it every night. (midnight)

If the recording was already transcode…it will see that a previous recording is already there and stop.

Batch file running at midnight…

channels-transcoder.sh “Sherlock"
channels-transcoder.sh “Grey’s"

channels-transcoder.sh “60 Minutes"

Here is the actual statement.

/usr/local/bin/channels-transcoder.sh “Designated” CLEAR_DB=1 VERBOSE=1