Powershell Script to transcode MP4 & MKV files to HEVC/AAC - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic) +--- Forum: Self-hosting & Homelabs (https://forum.jellyfin.org/f-self-hosting-homelabs) +--- Thread: Powershell Script to transcode MP4 & MKV files to HEVC/AAC (/t-powershell-script-to-transcode-mp4-mkv-files-to-hevc-aac) |
Powershell Script to transcode MP4 & MKV files to HEVC/AAC - Maximus1 - 2023-11-07 Hello folks, I needed space on the disks and have written one (two) script(s) in PowerShell to convert my MP4 and MKV files into HEVC/AAC. I decided to use Handbrake for Video and Audio Transcoding and FFmpeg for Audio Transcoding only because Handbrake has a better resulting quality at a lower file size. FFmpeg works better with multiple instances simultaneously. So FFmpeg was better for Audio transcoding. I would like to share the result with you. You need to install a PowerShell module called Get-MediaInfo Instructions on powershellgallery Warning!! I Transcoded hundreds of files with no error, but this doesn't mean it will do the same at your PC. Please take a look at the code and change it to your needs. What does the 1st script do:
How the script decides to convert: Checking for Codecs used in the Files
Audio Transcoding (FFmpeg) : The script differentiates between Mono/Stereo and Surround Mono/Stereo :
Video Transcoding (Handbrake): Handbrake Series :
Here is my 2nd Script. This Script cleans up after the 1st script has done his job. What does the 2nd script do:
Files to search for: '.neu' + $file.Extension '.nfo' '.neu' + '.nfo' '.neu-clearlogo.png' '.neu-fanart.jpg' '.neu-poster.jpg' '.neu-discart.png' '.neu-thumb.jpg' '.neu-landscape.jpg' '.neu-banner.jpg' '.neu-clearart.png' Proof will come, I have to make something to clean :-) |