Linux/Mac script for transcoding and adding to Plex

Got further with that now something is failing to map

Original line was:

image

You're still passing in options that only apply to the software encoder, such as -preset verfast

Hmmm. I think I'm going to drop it. Too much code to read through

I'm working on settting this up for the remote transcoding (I want to run it on my MAC to do the transcodes which is NOT the same box channels is on). First off I'm getting this error:Channels DVR API not present at defined host. Is Channels DVR installed. I am specifying the IP of my Channels Box:8089. I ran the force install and that went through. But it did gripe about the dest dir and extra characters after \ at the end of c command so I don't think it ran right. As far as setting up for remote transcodes I looked at the documentation and didn't see any instructions for setting that up on the server. I'd presume I need to use samba or NFS to mount the share on my mac, correct?

I have my NFS shares setup.. Trying to finish this setup now. Found the manual spots in the config file that I needed to use to set this up.

Now I'm back to the script not being able to find the API on one line but then on the next it says it found it:

Cannot find API at http://dvr.shiersfamily.com:8089/
Channels DVR API Interface Found

It's also saying ffmpeg is missing although I installed it via brew:
/usr/local/bin/ffmpeg

And I have confirmed I'm seeing the port open:

PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
2049/tcp open nfs
8089/tcp open unknown

Do you have a local DNS server on your network to resolve dvr.shiersfamily.com to its local IP? Or does your router automatically handle a split-horizon situation or NAT hairpinning?

If not, then you'd do best to address your script to its local IP instead.

Yes sir I have the address hardcoded in my Pi-holes on my network and I've confirmed that it's resolving properly off the mac:

PING dvr.shiersfamily.com (192.168.7.86): 56 data bytes

The port scan 2 posts above was run from the mac I have the transcoder script setup on.

I was so excited to see this script, and had issues right out of the gate. I have Channels DVR running on a Pi 4, and I've followed all instructions. on the Pi 4 It says that the API could not be found - is channels installed, and then states I might not have pre requisites installed. I tried it on my Plex server (which is on the same network - Linux Mint machine) and it also says the same errors. Anyone successfully get this working (recently) that could maybe assist me with some tips on how?

I tried setting this up on my MAC and it wouldn't work. I installed it locally on the debian server I have hosting the Channels DVR and I get it to run, i tried with DAYS=1000 to catch my backlog of recordings and it just keeps telling me no new shows to transcode, but it does find the API. I susepct maybe an API change occured and this script isn't working anymore.

I have this installed locally on my DVR but it's still not working. I cleared my db out and started fresh and I'm getting output such as:

Option map_metadata (set metadata information of outfile from infile) cannot be applied to input url 1916.ffmeta -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file 1916.ffmeta.
Error opening input files: Invalid argument
Say Yes to the Dress - S19E03 - Big Brother Hits Kleinfeld transcode failed.
Tagging of Say Yes to the Dress - S19E03 - Big Brother Hits Kleinfeld failed
mv: cannot stat '1877.m4v': No such file or directory
Say Yes to the Dress - S19E03 - Big Brother Hits Kleinfeld.m4v failed to write to /Transcoded/TV/TV Shows/Say Yes to the Dress/Season 19/.
Transcoding complete. There were issues with: 1917 1916 1915 1914 1913 1912 1911 1910 1909 1908 1907 1906 1905 1904 1903 1902 1901 1900 1899 1898 1897 1896 1895 1894 1893 1892 1891 1889 1888 1887 1886 1885 1884 1883 1881 1880 1879 1878 1877 . See log file for more details.

Here's some additonal output.
usr/local/bin/channels-transcoder.sh: line 356: [: : integer expression expected
Attempting to transcode 1917.mpg ...
/usr/local/bin/channels-transcoder.sh: line 405: [: : integer expression expected
/usr/local/channels-dvr/latest/ffmpeg -hide_banner -i 1917.mpg -i 1917.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart 1917.mp4
[h264 @ 0x22d3e00] non-existing SPS 0 referenced in buffering period
Last message repeated 3 times
Input #0, mpegts, from '1917.mpg':
Duration: 01:04:11.14, start: 31870.125289, bitrate: 4564 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:10x101: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 90 kb/s
Input #1, ffmetadata, from '1917.ffmeta':
Metadata:
hd_video : 2
media_type : 10
title : null
show : The Young and the Restless
episode_id : 162
season_number : 47
network : CBS
comment : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina.
synopsis : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina; Abby has a bone to pick with Phyllis.
Duration: N/A, start: 0.000000, bitrate: N/A
Stream map '0:2' matches no streams.
To ignore this, add a trailing '?' to the map.
The Young and the Restless - S47E162 - null transcode failed.
Tagging of The Young and the Restless - S47E162 - null failed
mv: cannot stat '1917.m4v': No such file or directory
The Young and the Restless - S47E162 - null.m4v failed to write to /Transcoded/TV/TV Shows/The Young and the Restless/Season 47/.
Attempting to transcode 1916.mpg ...
/usr/local/channels-dvr/latest/ffmpeg -hide_banner -i 1916.mpg -i 1917.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart -i 1916.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart 1916.mp4
Input #0, mpegts, from '1916.mpg':
Duration: 00:34:01.69, start: 1810.403033, bitrate: 5164 kb/s
Program 1
Stream #0:0[0x101]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 128 kb/s
Stream #0:1[0x102]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn, 96k tbc
Stream #0:2[0x103]: Data: timed_id3 (ID3 / 0x20334449)
Input #1, ffmetadata, from '1917.ffmeta':
Metadata:
hd_video : 2
media_type : 10
title : null
show : The Young and the Restless
episode_id : 162
season_number : 47
network : CBS
comment : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina.
synopsis : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina; Abby has a bone to pick with Phyllis.
Duration: N/A, start: 0.000000, bitrate: N/A
Option map_metadata (set metadata information of outfile from infile) cannot be applied to input url 1916.ffmeta -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file 1916.ffmeta.
Error opening input files: Invalid argument
Christina on the Coast - S03E00 - Fab New Life: Blowing Walls transcode failed.
Tagging of Christina on the Coast - S03E00 - Fab New Life: Blowing Walls failed
mv: cannot stat '1916.m4v': No such file or directory
Christina on the Coast - S03E00 - Fab New Life: Blowing Walls.m4v failed to write to /Transcoded/TV/TV Shows/Christina on the Coast/Season 3/.
Attempting to transcode 1915.mpg ...
/usr/local/channels-dvr/latest/ffmpeg -hide_banner -i 1915.mpg -i 1917.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart -i 1916.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart -i 1915.ffmeta -map_metadata 1 -map 0:0 -c:v libx264 -preset veryfast -crf 21 -profile:v high -level 4.0 -map 0:1 -c:a:0 aac -b:a:0 160k -map 0:2 -c:a:1 copy -movflags faststart 1915.mp4
Input #0, mpegts, from '1915.mpg':
Duration: 00:34:12.53, start: 0.033378, bitrate: 5154 kb/s
Program 1
Stream #0:0[0x101]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 127 kb/s
Stream #0:1[0x102]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1920x1080, Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 96k tbc
Stream #0:2[0x103]: Data: timed_id3 (ID3 / 0x20334449)
Input #1, ffmetadata, from '1917.ffmeta':
Metadata:
hd_video : 2
media_type : 10
title : null
show : The Young and the Restless
episode_id : 162
season_number : 47
network : CBS
comment : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina.
synopsis : Jack turns to Ashley and Traci to unravel a mystery surrounding Dina; Abby has a bone to pick with Phyllis.
Duration: N/A, start: 0.000000, bitrate: N/A
Option map_metadata (set metadata information of outfile from infile) cannot be applied to input url 1916.ffmeta -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file 1916.ffmeta.
Error opening input files: Invalid argument
Christina on the Coast - S03E00 - Fab New Life: Counting Down transcode failed.
Tagging of Christina on the Coast - S03E00 - Fab New Life: Counting Down failed
mv: cannot stat '1915.m4v': No such file or directory
Christina on the Coast - S03E00 - Fab New Life: Counting Down.m4v failed to write to /Transcoded/TV/TV Shows/Christina on the Coast/Season 3/.