Here is a unix script I wrote for post processing DVR recordings.
It features job queuing so as to not overload your cpu. It will convert everything to x264 and 2 channel aac audio. You can modify the profiles for each to do something slightly different, maybe use more aggressive presets if your cpu can handle it.
You may want to change it to MKV output or copy audio. You can modify it to do those easily. I choose MP4 output and aac 2 channel as it is very portable and suits my needs.
This is designed to support the needs of people who have basic cable and only a few HD channels. That is why there is so much manipulation of SD sources.
It will convert all 4:3 SD sources to 480p 16:9
It will convert all 16:9 SD sources to 480p 16:9
It will convert 1080i to 1080p
it will convert 720p to 720p
You will need to supply ffmpeg and ffprobe. You can probably use Plex Transcoder as the encoder as its just ffmpeg. You could probably use their scanner too. You can see the sources I used in script. That’s just what I had installed/avail.
This is running on Synology DS916+ currently.
If you see room for improvements or other thoughts, let me know and I can see if I can incorporate them.
You can use the “shows” logic as shown in script to create other filter overrides. Some shows such as futurama early seasons, mash, and others actually broadcast as 4:3 and you shouldn’t crop them to 16:9. There is where you would write in filter overrides.