def add_parser(parent): parser = parent.add_parser('slideshow', prog="Slideshow / Timelapse", help='Where does this show??') input_group = parser.add_argument_group( 'Input', gooey_options=options.ArgumentGroup(show_border=True)) # basic details input_group.add_argument( 'dir', metavar='Input', help='Directory which has the images', widget='DirChooser', gooey_options=options.FileChooser(full_width=True)) input_group.add_argument( 'pattern', metavar='Pattern', help='Naming convention of the images (e.g. img%03.png)', gooey_options=options.FileChooser( placeholder='File pattern (e.g. img%03d.png)', full_width=True)) output_group = parser.add_argument_group( 'Output', gooey_options=options.ArgumentGroup(show_border=True)) output_group.add_argument('output', help='Choose where to save the output video', default=r'C:\Users\Chris\Desktop\output.mp4', widget='FileSaver', gooey_options=options.FileSaver( wildcard='video files (*.mp4)|*.mp4', default_file='output.mp4', full_width=True)) output_group.add_argument( '--overwrite', metavar='Overwrite existing', help='Overwrite the output video if it already exists?', action='store_const', const='-y', widget='CheckBox') settings = parser.add_argument_group( 'Settings', gooey_options=options.ArgumentGroup(show_border=True)) settings.add_argument('--framerate', type=int, default=24, widget='Slider', help='The input framerate', gooey_options=options.DecimalField( min=1, max=100, increment_size=1, )) return parser
def add_parser(parent): parser = parent.add_parser('trim_crop', prog="Trim, Crop & Scale Video", help='Where does this show??') input_group = parser.add_argument_group( 'Input', gooey_options=options.ArgumentGroup(show_border=True)) # basic details input_group.add_argument( 'input', metavar='Input', help='The video you want to add a watermark to', default= r'C:\Users\Chris\Dropbox\pretty_gui\Gooey\demo-screen-recording.mp4', widget='FileChooser', gooey_options=options.FileChooser(wildcard='video files (*.mp4)|*.mp4', full_width=True)) settings = parser.add_argument_group( 'Trim Settings', gooey_options=options.ArgumentGroup(show_border=True)) start_position = settings.add_mutually_exclusive_group( gooey_options=options.MutexGroup(initial_selection=0)) start_position.add_argument('--start-ss', metavar='Start position', help='Start position in seconds', widget='IntegerField', gooey_options=options.IntegerField( min=0, max=99999, increment_size=1)) start_position.add_argument( '--start-ts', metavar='Start position', help='start-position as a concrete timestamp', gooey_options=options.TextField( placeholder='HH:MM:SS', validator=options.RegexValidator( test='^\d{2}:\d{2}:\d{2}$', message='Must be in the format HH:MM:SS'))) end = settings.add_mutually_exclusive_group( gooey_options=options.MutexGroup(initial_selection=0)) end.add_argument('--end-ss', metavar='End position', help='Total duration from the start (seconds)', widget='IntegerField', gooey_options=options.IntegerField(min=0, max=99999, increment_size=1)) end.add_argument('--end-ts', metavar='End position', help='End position as a concrete timestamp', gooey_options=options.TextField( placeholder='HH:MM:SS', validator=options.RegexValidator( test='^\d{2}:\d{2}:\d{2}$', message='Must be in the format HH:MM:SS'))) crop_settings = parser.add_argument_group( 'Crop Settings', gooey_options=options.ArgumentGroup(show_border=True)) crop_settings.add_argument('--enable-crop', metavar='Crop Video', help='Enable the cropping filters', action='store_true', gooey_options=options.LayoutOptions( full_width=True, show_label=False)) crop_settings.add_argument('--crop-width', metavar='Width', help='Width of the cropped region', default=640, widget='IntegerField', gooey_options=options.IntegerField(min=1, max=1920)) crop_settings.add_argument('--crop-height', metavar='Height', help='Height of the cropped region', default=480, widget='IntegerField', gooey_options=options.IntegerField(min=1, max=1080)) crop_settings.add_argument( '--crop-x', metavar='Margin left', help='X position where to position the crop region', widget='IntegerField', gooey_options=options.IntegerField(min=0, max=1920)) crop_settings.add_argument( '--crop-y', metavar='Margin top', help='Y position where to position the crop region', widget='IntegerField', gooey_options=options.IntegerField(min=0, max=1080)) scale = parser.add_argument_group( 'Crop Settings', gooey_options=options.ArgumentGroup(show_border=True)) scale.add_argument( '--scale-width', metavar='Width', help='Scale the video to this width (-1 preserves aspect ratio)', default=-1, widget='IntegerField', gooey_options=options.IntegerField(min=-1, max=1920)) scale.add_argument( '--scale-height', metavar='Height', help='Scale the video to this height (-1 preserves aspect ratio)', default=-1, widget='IntegerField', gooey_options=options.IntegerField(min=-2, max=1080)) output_group = parser.add_argument_group( 'Output', gooey_options=options.ArgumentGroup(show_border=True)) output_group.add_argument('output', help='Choose where to save the output video', default=r'C:\Users\Chris\Desktop\output.mp4', widget='FileSaver', gooey_options=options.FileSaver( wildcard='video files (*.mp4)|*.mp4', default_file='output.mp4', full_width=True)) output_group.add_argument( '--overwrite', metavar='Overwrite existing', help='Overwrite the output video if it already exists?', action='store_const', default=True, const='-y', widget='CheckBox') return parser
def add_parser(parent): parser = parent.add_parser('screen_recorder', prog="Record Screen", help='Where does this show??') input = parser.add_argument_group('Configure Input', gooey_options=options.ArgumentGroup( show_border=True, )) input.add_argument( '--width', metavar='Width', help='Width of the recorded region', widget='IntegerField', default=480, gooey_options=options.IntegerField( min=1, max=1920 )) input.add_argument( '--height', metavar='Height', help='Height of the recorded region', widget='IntegerField', default=640, gooey_options=options.IntegerField( min=1, max=1080 )) input.add_argument( '--offset-x', metavar='Margin left', help='Offsets the recording region from the left', widget='IntegerField', default=0, gooey_options=options.IntegerField( min=0, max=1080 )) input.add_argument( '--offset-y', metavar='Margin top', help='Offsets the recording region from the top', widget='IntegerField', default=0, gooey_options=options.IntegerField( min=0, max=1080 )) asdf = parser.add_argument_group('Options', gooey_options=options.ArgumentGroup( show_border=True, )) asdf.add_argument( '--framerate', type=int, default=10, widget='IntegerField', help='How many frames per second to record', gooey_options=options.IntegerField( min=1, max=100, increment_size=1, )) asdf.add_argument( '--show_region', choices=['0', '1'], default='1', help='Show the Region being recorded') asdf.add_argument( '--duration', help='How long to record the screen (in seconds)', metavar='Duration', default=10, widget='IntegerField', gooey_options=options.IntegerField( min=1, max=99999 ) ) output_group = parser.add_argument_group('Output', gooey_options=options.ArgumentGroup( show_border=True )) output_group.add_argument( 'output', help='Choose where to save the output video', default=r'C:\Users\Chris\Desktop\output.mp4', widget='FileSaver', gooey_options=options.FileSaver( wildcard='video files (*.mp4)|*.mp4', default_file='output.mp4', full_width=True )) output_group.add_argument( '--overwrite', metavar='Overwrite existing', help='Overwrite the output video if it already exists?', action='store_const', default=True, const='-y', widget='CheckBox') return parser
def watermark_parser(parent): parser = parent.add_parser('watermark', prog="Watermark Video", help='Where does this show??') input_group = parser.add_argument_group( 'Input', gooey_options=options.ArgumentGroup(show_border=True)) input_group.add_argument( 'input', metavar='Input', help='The video you want to add a watermark to', default=r'C:\Users\Chris\Desktop\Recording #1.mp4', widget='FileChooser', gooey_options=options.FileChooser(wildcard='video files (*.mp4)|*.mp4', full_width=True)) input_group.add_argument( 'watermark', metavar='Watermark', help='The watermark', default=r'C:\Users\Chris\Desktop\avatar.png', widget='FileChooser', gooey_options=options.FileChooser( wildcard= 'PNG files (*.png)|*.png|JPEG files (*.jpeg;*.jpg)|*.jpeg;*.jpg|BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif', full_width=True)) output_group = parser.add_argument_group( 'Output', gooey_options=options.ArgumentGroup(show_border=True)) output_group.add_argument('output', help='Choose where to save the output video', default=r'C:\Users\Chris\Desktop\output.mp4', widget='FileSaver', gooey_options=options.FileSaver( wildcard='video files (*.mp4)|*.mp4', default_file='output.mp4', full_width=True)) output_group.add_argument( '--overwrite', metavar='Overwrite existing', help='Overwrite the output video if it already exists?', action='store_const', default=True, const='-y', widget='CheckBox') settings = parser.add_argument_group( 'Settings', gooey_options=options.ArgumentGroup(show_border=True)) settings.add_argument('--opacity', type=float, default=75, widget='Slider', help='Choose the opacity of the watermark (0-100)', gooey_options=options.DecimalField( min=0, max=100, increment_size=1, )) settings.add_argument('--position', choices=list(positions.keys()), default='Center', help='Position of the watermark') return parser
def add_parser(parent): parser = parent.add_parser('gif', prog="High Quality GIF", help='Where does this show??') input_group = parser.add_argument_group('Input', gooey_options=options.ArgumentGroup( show_border=True )) input_group.add_argument( 'input', metavar='Input', help='Source video you want to convert to a high quality gif (pronounced "jif")', widget='FileChooser', gooey_options=options.FileChooser( wildcard='Video files (*.mp4)|*.mp4|All files (*.*)|*.*', full_width=True )) scale = parser.add_argument_group('Crop Settings', gooey_options=options.ArgumentGroup( show_border=True )) scale.add_argument( '--scale-width', metavar='Width', help='Scale the video to this width (-1 preserves aspect ratio)', default=-1, widget='IntegerField', gooey_options=options.IntegerField( min=-1, max=1920 )) scale.add_argument( '--scale-height', metavar='Height', help='Scale the video to this height (-1 preserves aspect ratio)', default=-1, widget='IntegerField', gooey_options=options.IntegerField( min=-2, max=1080 )) output_group = parser.add_argument_group('Output', gooey_options=options.ArgumentGroup( show_border=True )) output_group.add_argument( 'output', help='Choose where to save the output video', default=r'C:\Users\Chris\Desktop\output.mp4', widget='FileSaver', gooey_options=options.FileSaver( wildcard='video files (*.gif)|*.gif', default_file='output.mp4', full_width=True )) output_group.add_argument( '--overwrite', metavar='Overwrite existing', help='Overwrite the output video if it already exists?', action='store_const', default=True, const='-y', widget='CheckBox') output_group.add_argument( '--fps', metavar='Frames per second', help='FPS of the output GIF', default=15, widget='IntegerField', gooey_options=options.IntegerField( min=1, max=100 ))