<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def analyze_frames(cls, workdir):
        '''generate draft from recorded frames'''
        record = cls(None, workdir)
        obj = {}
        with open(os.path.join(workdir, 'frames', 'frames.json')) as f:
            obj = json.load(f)
        record.device_info = obj['device']
        record.frames = obj['frames']
        record.analyze_all()
        record.save()