From 9e993ae31584464906cb837031787b81c60ca2b9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 2 Jan 2010 16:55:40 +0100 Subject: convert2mp4: remove -e and add ++; add desc to help Signed-off-by: Florian Pritz --- convert2mp4 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'convert2mp4') 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 # # Licensed under WTFPL v2 @@ -12,6 +11,10 @@ # Audio: MPEG-4 AAC #---------------------------------------------------- +'''"usage: %prog [options] ''' +__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] " - p = OptionParser(usage) + p = OptionParser(version=__version__, usage=__doc__, description=__desc__) p.add_option("-s", "--size", dest="size", default=False, help="use instead of input dimensions (e.g. 123x123)", metavar="") p.add_option("--vb", dest="vbitrate", default="400000", @@ -28,8 +31,6 @@ def main(): help="change the audio bitrate", metavar="") p.add_option("-m", "--map", action="append", dest="maps", default=None, help="change the mappings", metavar="") - p.add_option("-e", "--extra", action="append", dest="extras", default=None, - help="pass extra options to ffmpeg", nargs=2, metavar=" ") 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" -- cgit v1.2.3-24-g4f1b