OSX: Pal-Speedup-Script from 23.976 -> 25.000. Completely automatic.
Posted: December 29th, 2009, 8:06 am
Hi folx.
The Situation:
You have a MKV-File with 23.976 FPS, 24.000 FPS or 29.970 FPS and want to convert it to PAL 25 FPS (30 FPS at a FPS of 29.970) to see the movie totaly smooth on your tv which is not supporting 24p correct. If you Speedup the Movie to 25FPS (or 30 FPS) you have the problem that the Audio-Track must be edited. There are 2 Ways:
1. Timestretch (that keeps the original Pitch but has the big disadvantage of creating Audio-Artefacts which doesn´t sounds well)
2. Speedup (The Audio-Track plays with approx. 4% more Speed. This method is used by Pal-DVDs because orig. Film-Material is ever in 23.976 FPS)
I want to go the 2nd way. Unfortunately for OSX doesnt exists a tool which can Speedup AC3 and DTS on thy fly. We will use eac3to from Windows-World.
Now i build a post-process-script the extracts the whole MKV-File (if it´s not already in 25 FPS) in his elementary streams. After that the script runs eac3to via Wine.
The script looks if the movie is in 23.976, 24.000 or 29.970 FPS and start to convert it to 25 FPS (30 FPS at a FPS of 29.970). If the File has 25 FPS the script do nothing.
For my script you need additional programs which i have bundled:
http://x7.to/f1ab97
And here is my Script:
If you have questions ... ask ....
The Situation:
You have a MKV-File with 23.976 FPS, 24.000 FPS or 29.970 FPS and want to convert it to PAL 25 FPS (30 FPS at a FPS of 29.970) to see the movie totaly smooth on your tv which is not supporting 24p correct. If you Speedup the Movie to 25FPS (or 30 FPS) you have the problem that the Audio-Track must be edited. There are 2 Ways:
1. Timestretch (that keeps the original Pitch but has the big disadvantage of creating Audio-Artefacts which doesn´t sounds well)
2. Speedup (The Audio-Track plays with approx. 4% more Speed. This method is used by Pal-DVDs because orig. Film-Material is ever in 23.976 FPS)
I want to go the 2nd way. Unfortunately for OSX doesnt exists a tool which can Speedup AC3 and DTS on thy fly. We will use eac3to from Windows-World.
Now i build a post-process-script the extracts the whole MKV-File (if it´s not already in 25 FPS) in his elementary streams. After that the script runs eac3to via Wine.
The script looks if the movie is in 23.976, 24.000 or 29.970 FPS and start to convert it to 25 FPS (30 FPS at a FPS of 29.970). If the File has 25 FPS the script do nothing.
For my script you need additional programs which i have bundled:
http://x7.to/f1ab97
And here is my Script:
Code: Select all
#!/bin/bash
################## Change to Unpack-Path ##################
base=`basename "$1"`
cd "$1"
###########################################################
######## Pathes to the needed Binaries (change this)#######
eac3to="/Users/luigi/.wine/drive_c/Programme/eac3to/eac3to.exe"
winebin="/Applications/Wine.app/Contents/Resources/bin/wine"
mediainfo="/usr/local/bin/mediainfo"
###########################################################
################ Ignore upper and lowercase ###############
shopt -s nocaseglob
###########################################################
################## Scan every Sub-Folder ##################
find . -type d | while read VERZEICHNIS
do
cd "$VERZEICHNIS"
###########################################################
##### Decide if 25 FPS. If not … extract the MKV-File #####
for i in *.mkv; do
fps=`/usr/local/bin/mediainfo --Inform=Video\;%FrameRate% "$i"`
base=`basename "$i"`
if [ "$fps" = "25.000" ]; then
echo -e "\033[1;30mAlready 25 FPS\033[0m"
else
"$mediainfo" "$i" > "$base-info.txt"
"$winebin" "$eac3to" "$i" -demux -keepDialnorm
fi
###########################################################
### Looking for the FPS and initiate the right speedup ####
if [ "$fps" = "23.976" ]; then
for a in *.{ac3,dts}; do
"$winebin" "$eac3to" "$a" "$a-speedup.ac3" -speedup -keepDialnorm
done
rm *Log.txt*
elif [ "$fps" = "24.000" ]; then
for a in *.{ac3,dts}; do
"$winebin" "$eac3to" "$a" "$a-speedup.ac3" -24.000 -speedup -keepDialnorm
done
rm *Log.txt*
elif [ "$fps" = "29.970" ]; then
for a in *.{ac3,dts}; do
"$winebin" "$eac3to" "$a" "$a-speedup.ac3" -29.970 -changeTo30.000 -keepDialnorm
done
rm *Log.txt*
fi
###########################################################
done
rm "*.mkv-info.txt" "*.mkv-chapters.xml" >/dev/null 2>&1
cd -
done