]> code.delx.au - transcoding/commitdiff
Better attempt at trying to support the apple iPod
authorGreg Darke <greg+pc-3w14-0@tsukasa.net.au>
Tue, 2 Sep 2008 10:02:45 +0000 (20:02 +1000)
committerGreg Darke <greg+pc-3w14-0@tsukasa.net.au>
Tue, 2 Sep 2008 10:02:45 +0000 (20:02 +1000)
encipxv.py [moved from encipod.py with 100% similarity]
encode.py
tomp4.sh

similarity index 100%
rename from encipod.py
rename to encipxv.py
index b074a2cdcb50c8e6b30c50ae9ddd9ec9f9b3873e..1c54b95b51610fe27abcb6596fff86a7267fc51d 100755 (executable)
--- 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,
index 2a8e59b57f45fa8140be30041df7619422b95292..15a2f26bb1728f5c1a018d52d476f6fd68c83cbb 100755 (executable)
--- 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"