Hey boss,
I'm actually working on one right now that is working, but I'm ironing out some kinks.
It uses the "mkv2mp4.py" (found here:
https://aur.archlinux.org/packages/mkv2mp4-svn/)
I made a very minor addition to that script to add a -r argument to tell it to remove the source file when remuxing is complete. It's not necessary if you run the script solely by SABnzbd's/Sickbeard's post-processing since it will auto-remove the directories when you're done downloading/processing the episode, but I put it in there for myself so I can run conversions on old files on my NAS. I excluded the -r switch from my script that I posted below so you don't have any issues if you just copy/paste it.
The dependencies are:
ffmpeg
gpac
mkvtoolnix
python2
The catch is, for ffmpeg, they removed the libfaac codec for legal reasons. You have to custom compile it with some specific arguments/flags to get it to compile with libfaac (I don't remember the specifics! Sorry! I'm relatively new to linux and this was a freaking brain killer for me). I believe the main ones are "--enable_libfaac" and "--nonfree" or something like that (arguments are listed in the ffmpeg configure file, so that should help).
MY code is a bash script that I placed in /c/.sickbeard/autoProcessTV/ named "processhd.sh"
Here is the current, working contents of the code. I just ironed out some issues 5 minutes ago about files/directories with spaces and file names with a comma in it.
The way the code works is, it processes and converts everything, then has Sickbeard do it's post-processing. It's seamless.
Code: Select all
#!/bin/bash
filedir=$1
echo "test"
echo ""
if [ -d "$filedir" ]; then
cd "$filedir"
for file in ./* ;
do
if [[ $file = *.mkv ]] ; then
if [[ $file == *","* ]] ; then
newfile=${file//,/}
mv "$file" "$newfile"
file="$newfile"
fi
file=${file##*/}
donefile=${file:0:${#file}-4}".mp4"
mkv_in="$file"
mkvinfo_cues=$(mkvinfo ${mkv_in} | grep 'Algorithm')
if [ -n "$mkvinfo_cues" ]; then
nocues_file="nocues_"$file
mkvmerge -o "$nocues_file" --no-cues "$file" -q
rm $file
mv "$nocues_file" "$file"
fi
mkv2mp4.py -i "$file" -o "$donefile"
fi
done
/c/.sickbeard/autoProcessTV/sabToSickBeard.py "$1" "$2" "$3" "$4" "$5" "$6" "$7"
fi
Sorry about some of the commented code and lack of informational comments... I didn't intend to distribute this because when I was researching this, I didn't see any interest, so I thought I was the only one...
Make sure you give execute permissions on the script file..
Also, obviously change the paths where appropriate for your sickbeard processing script. Mine's an odd folder structure because I have this all set up with Newznab on my ReadyNAS. This whole deal has been an adventure since mid December...