nyavramov / WEBMARIZER

WEBMARIZER: Automatically 'summarizes' a video by creating multiple WEBMs or GIFs from a single video. It breaks a video into pieces and generates a WEBM/GIF from each piece. It can do this for each video in your folder with a single click. This is similar to a video thumbnails sheet but in WEBM/GIF form.
82 stars 7 forks source link

Feature: Store output files in sub folder #2

Closed brianmangan closed 6 years ago

brianmangan commented 6 years ago

like the topic says,

Add checkbox option to put output files in sub folder.

/WEBMARIZER/ would be appropriate.

nyavramov commented 6 years ago

Sure thing, man. Adding this to my to-do list!

brianmangan commented 6 years ago

see pull request with feature added. sorry about the reformat.. stupid pycharm thinks it knows better.

nyavramov commented 6 years ago

I will take a look at this very soon. Just uploaded my refactored code at the exact same time you sent the pull-request - crazy timing :)!

brianmangan commented 6 years ago

I see... well that blows everything out of the water I was doing..

brianmangan commented 6 years ago

here is what I added, but since you refactor.. you can copy paste...

New Global Variables

output_to_subfolder = True
output_subfolder = 'output'

New Function:

def generateOuput_filename(fileName, extension, numFiles):
    if output_to_subfolder:
        if not os.path.isdir(output_subfolder):
            os.makedirs(output_subfolder)
        return os.path.join(output_subfolder, os.path.splitext(fileName)[0] + '_' + str(numFiles) + '.' + extension)

Changing the output file name value to use new fuction

fileName_webm = generateOuput_filename(fileName=fileName, extension='webm', numFiles=numFiles)
brianmangan commented 6 years ago

See #4 for feature being added.

needs UI changes to make it official, but this works for now.. lemme know what you think.

brianmangan commented 6 years ago

resolved by #4

Closing