From b416be8460a226d5ed3dfe764085a5c313e22e30 Mon Sep 17 00:00:00 2001 From: Greg Darke Date: Tue, 2 Sep 2008 20:02:45 +1000 Subject: [PATCH] Better attempt at trying to support the apple iPod --- encipod.py => encipxv.py | 0 encode.py | 15 +++++++++++++-- tomp4.sh | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) rename encipod.py => encipxv.py (100%) diff --git a/encipod.py b/encipxv.py similarity index 100% rename from encipod.py rename to encipxv.py diff --git a/encode.py b/encode.py index b074a2c..1c54b95 100755 --- a/encode.py +++ b/encode.py @@ -11,11 +11,12 @@ codecs = { "-oac", "faac", "-faacopts", "br=%(abitrate)d:mpeg=4:object=2", "-channels", "2", "-srate", "48000", ], -"ipod": +### "-ovc", "x264", "-x264encopts", "pass=%(pass)d:bitrate=%(vbitrate)d:me=umh:partitions=+parti4x4+partp8x8+partb8x8:trellis=1:subq=5:bframes=1:direct_pred=auto:threads=0:vbv_maxrate=10000:vbv_bufsize=10000", +"ip64": [ "mencoder", "%(input)s", "-o", "%(output)s", "-vf", "%(filters)s", - "-ovc", "x264", "-x264encopts", "pass=%(pass)d:bitrate=%(vbitrate)d:me=umh:threads=auto:partitions=all:trellis=1:subq=7:bframes=1:direct_pred=auto", + "-ovc", "x264", "-x264encopts", "pass=%(pass)d:bitrate=%(vbitrate)d:me=dia:partitions=+parti4x4+partp8x8+partb8x8:trellis=1:subq=5:bframes=1:direct_pred=auto:threads=0:vbv_maxrate=10000:vbv_bufsize=10000", "-oac", "faac", "-faacopts", "br=%(abitrate)d:mpeg=4:object=2", "-channels", "2", "-srate", "48000", ], @@ -27,6 +28,14 @@ codecs = { "-ovc", "xvid", "-xvidencopts", "pass=%(pass)d:bitrate=%(vbitrate)d:vhq=4", "-oac", "mp3lame", "-lameopts", "abr:br=%(abitrate)d", ], + +"ipxv": +[ + "mencoder", "%(input)s", "-o", "%(output)s", + "-vf", "%(filters)s", + "-ovc", "xvid", "-xvidencopts", "pass=%(pass)d:bitrate=%(vbitrate)d:vhq=4:turbo:max_bframes=0", + "-oac", "faac", "-faacopts", "br=%(abitrate)d:mpeg=4:object=2", "-channels", "2", "-srate", "48000", +], } @@ -48,6 +57,7 @@ def parseArgs(): parser.add_option("--audioid", action="store", dest="audioid") parser.add_option("--codec", action="store", dest="codec", default=codec) parser.add_option("--dump", action="store_true", dest="dump") + parser.add_option("--sid", action="store", dest="sid") try: opts, (input, output) = parser.parse_args(sys.argv[1:]) except: @@ -80,6 +90,7 @@ def main(): insertOpt("-dvd-device", opts.dvd) insertOpt("-chapter", opts.chapter) insertOpt("-aid", opts.audioid) + insertOpt("-sid", opts.sid) subst = { "vbitrate": opts.vbitrate, diff --git a/tomp4.sh b/tomp4.sh index 2a8e59b..15a2f26 100755 --- a/tomp4.sh +++ b/tomp4.sh @@ -7,6 +7,7 @@ if [ -z "$input" ]; then exit 1 fi +rm -f "$output" && mencoder "$input" -ovc copy -oac copy -of rawvideo -o tmp.h264 && mencoder "$input" -ovc copy -oac copy -of rawaudio -o tmp.aac && MP4Box -add tmp.h264 -add tmp.aac "$output" -- 2.39.2