Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'preview' flag to video file names #396

Open
becky-gilbert opened this issue Jun 25, 2024 · 0 comments
Open

Add 'preview' flag to video file names #396

becky-gilbert opened this issue Jun 25, 2024 · 0 comments

Comments

@becky-gilbert
Copy link
Contributor

Summary

We should consider adding a 'preview' flag to video filenames, to make researcher-generated/testing videos a little easier to identify and filter out.

Explanation

I encountered the problem of not being able to differentiate preview and 'real' videos while looking at our set of incomplete video uploads, and trying to understand where they came from and how to handle them. It's possible that a lot of our incomplete video uploads come from researchers previewing their own studies and exiting the browser tab while the recording is in progress. For this reason, it might be nice to have a job that deletes any partial uploads of preview video recordings after a short time (a few days?).

The reason for differentiated these from non-preview partial uploads is that we may want to be more careful about deleting non-preview uploads, e.g. in case we want to recover an incomplete upload from a real participant.

Implementation

Here's how we currently name the videos:

    _generateVideoId() {
        return [
            this.get('frameType') === 'CONSENT' ? 'consent-videoStream' : 'videoStream',
            this.get('experiment.id'),
            this.get('id'), // parser enforces that id is composed of a-z, A-Z, -, ., [space]
            this.get('session.id'),
            +Date.now(), // Timestamp in ms
            Math.floor(Math.random() * 1000)
        ].join('_');
    },

If we were to add in a 'preview' flag, I would suggest adding it before the date timestamp or after the final random number. This is because we have some regex in the AWS Lambda function (and maybe in the lookit-api?) that parses the video filename to get the various bits of meaningful information (study/frame/response IDs), so putting the 'preview' string after those bits of info will be less disruptive to that existing code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant