Stacking frames of a video file horizontally into a single image
Some suggestions aimed at more general issues rather than specific details in
your lines of code:

Computers are not our friends, no need to chat. Get user input from the command line, not from input(). Interactive user
input is a bad usage model for the default behavior of a script -- with rare
exceptions. Use interactivity only for special circumstances, and always
provide a command-line option to bypass that interactivity. In addition,
input() is terrible for development because it requires you (the coder) to go
into a dialogue with your script every damn time you run it. Super
annoying. One option for handling command-line input is
argparse. See the script
below for the template that I usually follow in my scripts.

But functions are our friends. Organize your code into functions. Have each function do one thing. Among
other things, this approach allows you to test each small piece of behavior as
you write it.

Either do or talk. Do not print() inside your functions that do the actual work (aside from some quite rare exceptions). Functions should take arguments, calculate something or do
something, and return some meaningful data (or None). If the larger program
requires printing ultimately, use the data returned from functions to do that
printing. But keep computation and printing in separate realms.

No magical tokens in the castle. Keep literal strings and values out of your code. Instead put them in one
or more containers. In many situations, I usually just use a Constants class
and module-level global (con), as shown below. Good practice, but easy and
low-tech.


The script template:
import argparse
import sys

class Constants:

    EXIT_OK = 0
    EXIT_FAIL = 1

    NEWLINE = '\n'
    NAMES = 'names'
    BAR = 'BAR'
    BAR_PROPAGANDA = 'Sucker, should have picked --bar!'

    OPTS_CONFIG = (
        {
            NAMES: 'path',
        },
        {
            NAMES: '-b --bar',
            'action': 'store_true',
        },
    )

con = Constants()

def main(args):
    ap, opts = parse_args(args)
    if opts.bar:
        print(con.BAR, opts)
        exit()
    else:
        print(opts)
        exit(con.EXIT_FAIL, con.BAR_PROPAGANDA)

def parse_args(args):
    ap = argparse.ArgumentParser()
    for oc in con.OPTS_CONFIG:
        kws = dict(oc)
        xs = kws.pop(con.NAMES).split()
        ap.add_argument(*xs, **kws)
    opts = ap.parse_args(args)
    return (ap, opts)

def exit(code = None, msg = None):
    code = con.EXIT_OK if code is None else code
    fh = sys.stderr if code else sys.stdout
    if msg:
        nl = con.NEWLINE
        msg = msg if msg.endswith(nl) else msg + nl
        fh.write(msg)
    sys.exit(code)

def your_function_foo(opts):
    pass

def your_function_bar(opts):
    pass

# Etc.

if __name__ == '__main__':
    main(sys.argv[1:])