diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-01-02 16:55:40 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-01-02 16:55:40 +0100 |
commit | 9e993ae31584464906cb837031787b81c60ca2b9 (patch) | |
tree | d90b114c9d1ae103096a98f88d5bea4b5a155525 | |
parent | aa0a4552a755e1899fb3d409440b05e53ebcba64 (diff) | |
download | bin-9e993ae31584464906cb837031787b81c60ca2b9.tar.gz bin-9e993ae31584464906cb837031787b81c60ca2b9.tar.xz |
convert2mp4: remove -e and add ++; add desc to help
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-x | convert2mp4 | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/convert2mp4 b/convert2mp4 index 8350a2f..fb285c9 100755 --- a/convert2mp4 +++ b/convert2mp4 @@ -1,6 +1,5 @@ #!/usr/bin/python #---------------------------------------------------- -# Version: 0.2.0 # Author: Florian "Bluewind" Pritz <flo@xssn.at> # # Licensed under WTFPL v2 @@ -12,6 +11,10 @@ # Audio: MPEG-4 AAC #---------------------------------------------------- +'''"usage: %prog [options] <files>''' +__version__ ='0.2' +__desc__ = 'Use ++ before any argument to pass it directly to ffmpeg.(i.e. ++-r ++25)' + import sys import os import subprocess @@ -19,7 +22,7 @@ from optparse import OptionParser def main(): usage = "usage: %prog [options] <files>" - p = OptionParser(usage) + p = OptionParser(version=__version__, usage=__doc__, description=__desc__) p.add_option("-s", "--size", dest="size", default=False, help="use <dimension> instead of input dimensions (e.g. 123x123)", metavar="<dimension>") p.add_option("--vb", dest="vbitrate", default="400000", @@ -28,8 +31,6 @@ def main(): help="change the audio bitrate", metavar="<bitrate>") p.add_option("-m", "--map", action="append", dest="maps", default=None, help="change the mappings", metavar="<input_stream_id:sync_stream_id>") - p.add_option("-e", "--extra", action="append", dest="extras", default=None, - help="pass extra options to ffmpeg", nargs=2, metavar="<ffmpeg switch> <argument>") p.add_option("--nd", action="store_false", dest="deinterlace", default=True, help="don't deinterlace the video") @@ -57,13 +58,14 @@ def main(): for cur_map in options.maps: ffmpeg_args.append("-map") ffmpeg_args.append(cur_map) - if options.extras: - for switch, arg in options.extras: - ffmpeg_args.append(switch) - ffmpeg_args.append(arg) + for name in args: + if name.startswith('++'): + ffmpeg_args.append(name[2:]) for name in args: + if name.startswith('++'): + continue p1 = subprocess.Popen(["echo", "-n", name], stdout=subprocess.PIPE) p2 = subprocess.Popen(["sed", "s/\(.*\)\..*/\\1/"], stdin=p1.stdout, stdout=subprocess.PIPE) name_mp4 = p2.communicate()[0] + ".mp4" |