{REQ } Script for Extratcting ISO Image with 7z and than convert bluray BDMV M2TS file to MP4
Posted: December 29th, 2017, 6:57 pm
Just to start of I am a total noob at scripting, I would like to learn more. Been googling and found these, but I don't know how to combine them to work in a windows installation /environment .
My setup:
Windows Server 2016 Standard
10x3TB raid setup
Sabnzbd
Plex
Radarr
Sonarr
Git and Python installed
Setup is working great just want to make some more improvements for better automation.
This is a REQ for a script to do a combination of a few things that I have seen posted here in this forum :
My gaol is to combine this post "Unzip ISO file"
with this post "[BASH] simple script to convert bluray BDMV M2TS file to MKV"
Wanted end results would be to extract ISO with 7z to c:\convert folder and than to have the script convert the M2TS file to MP4 AC3 audio and place in C:\Completed for Radarr /Sonarr to than finish the post-processing " Rename and Move"
If anyone is willing or able to assist in this writeup. I would be most apprciated.
Weezzelboy.
My setup:
Windows Server 2016 Standard
10x3TB raid setup
Sabnzbd
Plex
Radarr
Sonarr
Git and Python installed
Setup is working great just want to make some more improvements for better automation.
This is a REQ for a script to do a combination of a few things that I have seen posted here in this forum :
My gaol is to combine this post "Unzip ISO file"
Code: Select all
#!/bin/sh
cd "$1"
mkdir unpack
cd unpack
# pwd
7z x ../*.iso
7z x ../*.ISO
7z x ../*/*.iso
7z x ../*/*.ISO
Code: Select all
#!/bin/bash
BDMV_FOLD=`find "$1" -name "BDMV" -print0`
if [[ $BDMV_FOLD == *BDMV* ]]; then
# cd to the ./BDMV/STREAM sub folder
cd "$BDMV_FOLD/STREAM/"
# Find the biggest .M2TS file, usually the movie
BIGST_M2TS=`find . -type f | xargs ls -1S | head -n 1 | rev | cut -c 6- | rev`
# MkvMerge the file
mkvmerge -o "$BIGST_M2TS".mkv --compression -1:none "$BIGST_M2TS".m2ts
# Change MKV permission to -rw-r--r-- and move file out of STREAM folder
chmod 644 "$BIGST_M2TS".mkv
mv "$BIGST_M2TS".mkv "$1"
echo "MKV created! ("$1")"
else
echo "BDMV2Mkv: no processing"
fi
If anyone is willing or able to assist in this writeup. I would be most apprciated.
Weezzelboy.