No idea about 4k, but no 4k OTA here, and don’t think any TV Everywhere channels have 4k. Most of my shows are TV Everywhere.
deleted
There’s my script, it uses rkmppenc and ccextractor for the subtitles. Used to use handbrake on the Mac mini, and didn’t need anything else for subtitles. But ffmpeg, the one in Armbian, doesn’t like some of the recordings subtitles, so it just fails to do anything. And too lazy to mess with rkmppenc to figure out if it can or even supports the subtitles in the Channels DVR recordings.
Had to turn the Mac mini on to get the script, not sure you can access the file easily from a Time Machine backup on a Linux computer, that it backed up to using Samba. Search engines appeared to break, as I can’t find anything anymore. Or is it because I don’t use an easy to track browser? Google sucks too, last time I used a search engine that uses Google And DuckDuckGo claims to be private, if so, I guess it just sucks. Shouldn’t need to track me. Or access anything from my browser that can be used to track me. I won’t use a different browser to search, eventually I’ll stop searching instead.
And be careful when that scripts runs, especially if you don’t manually run it. It will move the mpg to .bak, and ln -s the mkv to the old mpg name. But if Channels DVR is recording, and it can move the file, while ffmpeg is writing to it, you might, well probably, will get a failed recording.
Either modify the script to make it safer, or run it manually and when you know you have enough time to encode everything.
Is it slower then the Mac mini? Probably not by much if at all. At least with the settings I’m using in the script above. The longest time might be 10 minutes or a little less. Way better then using a CPU. And all the commercials I keep, because it isn’t exactly accurate by default, and might remove some of the show. Too lazy to make the commercial detection better, and don’t care.
File sizes are small enough for me, it’s using hevc. That can be changed as well.
I won’t use the Mac mini anymore, don’t trust Apple anymore. You get to pay more, and soon get screwed by Apple and US government. Unless you’re into mass surveillance. At least you have nothing to hide.
And I might need to remove the Motorola Installer, it’s getting blocked by my firewall. Might be hard to install the new update, that became available shortly after updating finally. The amount of work needed to get root back from a non full OTA, might not be worth it, so I may never update again.
Update
If you used the old script, you probably got some broken recordings. Apparently you should just copy the audio, not encode it, unless you know what you’re doing. Easier to copy the audio anyways.
Updated script using ffmpeg, still extracts the subtitles, since I can’t copy the subtitles from all recordings using ffmpeg directly.
#!/bin/bash
SUBBIN=ccextractor
CONVERTERBIN=ffmpeg
get_mpgs () {
cd "$1"
#echo "$1/*"
for FILE in "$1"/*
do
filename=$(basename "$FILE")
extension=${filename##*.}
filename=${filename%.*}
if [ "$extension" = "mpg" ]
then
if [ ! -e "$1"/"$filename".mkv ]
then
echo "$1/$filename.mkv doesn't exist"
#$HANDBRAKE_CLI -s "1,2,3,4,5,6,7,8,9,10" --preset-import-file "$PRESET_FILE" -Z "$PRESET" -i "$FILE" -o "$1"/"$filename".mkv
if [ ! -e "$1"/"$filename".srt ]
then
$SUBBIN "$FILE" -o "$1"/"$filename".srt
fi
if [ -e "$1"/"$filename".srt ]
then
$CONVERTERBIN -hwaccel rkmpp -hwaccel_output_format drm_prime -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -map 0:v? -c:v hevc_rkmpp -rc_mode VBR -b:v 1.5M -minrate 1.5M -maxrate 2M -map 0:a? -c:a copy -map 1:s:0 -c:s:0 copy "$1"/"$filename".mkv
fi
if [ -e "$1"/"$filename".mkv ]
then
actualsize=$(du -m "$1"/"$filename".mkv | cut -f 1)
if [ $actualsize -ge 30 ]; then
mv "$FILE" "$FILE".bak
ln -s "$filename".mkv "$filename".mpg
else
echo "$1/$filename.mkv is only $actualsize mb."
fi
fi
fi
elif [ -d "$1/$filename" ]
then
get_mpgs "$1/$filename"
fi
done
}
get_mpgs "$1"
And if you need to re encode everything from this month:
#!/bin/bash
CONVERTERBIN=ffmpeg
get_mpgs () {
cd "$1"
#echo "$1/*"
for FILE in "$1"/*
do
filename=$(basename "$FILE")
extension=${filename##*.}
filename=${filename%.*}
filename="${filename//.mpg}"
file_mod_date=$(ls -l --time-style=+%Y-%m "$FILE" | awk '{print $6}')
if [ "$extension" = "bak" ];
then
if [ ! -e "$1"/"$filename".fix.mkv ] && [ -e "$1"/"$filename".srt ] && [ "$file_mod_date" = "2025-11" ];
then
echo "$1/$filename.fix.mkv doesn't exist"
if [ -e "$1"/"$filename".srt ];
then
$CONVERTERBIN -hwaccel rkmpp -hwaccel_output_format drm_prime -i "$FILE" -sub_charenc 'UTF-8' -f srt -i "$1"/"$filename".srt -map 0:v? -c:v hevc_rkmpp -rc_mode VBR -b:v 1.5M -minrate 1.5M -maxrate 2M -map 0:a? -c:a copy -map 1:s:0 -c:s:0 copy "$1"/"$filename".fix.mkv
fi
if [ -e "$1"/"$filename".fix.mkv ];
then
actualsize=$(du -m "$1"/"$filename".fix.mkv | cut -f 1)
if [ $actualsize -ge 30 ];
then
mv "$1"/"$filename".fix.mkv "$1"/"$filename".mkv
else
echo "$1/$filename.fix.mkv is only $actualsize mb."
fi
fi
fi
elif [ -d "$1/$filename" ]
then
get_mpgs "$1/$filename"
fi
done
}
get_mpgs "$1"
That’s why the script makes a backup of the original file, now if you ran the first script and deleted the .bak files, without testing, well then I guess you’ll have to rerecord the show(s).