if output:
            with open(output, 'w') as loc:
                loc.write(ctx.obj['frame'].serialize())