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

How to save reorded video data in Base64 string format to MySQL server? #3337

Open
TAOKA-Daiki opened this issue Jul 11, 2024 · 4 comments
Open

Comments

@TAOKA-Daiki
Copy link

I am currently attempting to use a webcam to record the facial videos of the participants during an experimental task.

The following parameters are set when initializing the camera.
{include_audio: false, width: 1280, height: 720, mime_type: 'video/mp4; codecs="avc1.424028, mp4a.40.2"'}
The size of the experimental data is approximately 130 MB in csv format (2-5s video x 210 trials).

The jsPsych v7 initialize-camera, mirror-camera plugin, and record-video extensions work fine.

However, when sending the experimental data to the MySQL server at the end of the experiment, I get a "500 internal server status error".
If I do not record video, the data is sent without problems. When sending data to the MySQL server, I am using the method documented in the official jsPsych Wiki, with almost no changes.
I have also confirmed that there is no problem with the server capacity.

The column names "device_id" and "record_video_data" are added to the MySQL table. The columns' data types are specified as TEXT and LONGTEXT (up to 2^32 - 1 bytes) respectively.
Using the localSave() method, the csv data is downloaded and indeed a very long base64 string is recorded.

Is there any solution or advice to this problem?

Thank you in advance.

@jodeleeuw
Copy link
Member

You might need to change the maximum allowed packet setting. The docs for MySQL say that the default is 64mb.

https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_max_allowed_packet

@TAOKA-Daiki
Copy link
Author

Thank you for quick reply, @jodeleeuw.

I have checked MySQL server settings and the maximum allowed packet setting is being set to about 32MB.
Unfortunately, I am using rental server and I cannot get permission to change that setting...

Okay, I found that this problem is not caused by jsPsych. I will try to find another way.

Thank you.

@jodeleeuw
Copy link
Member

If you need an alternative data storage solution check out pipe.jspsych.org

@TAOKA-Daiki
Copy link
Author

Thank you for your suggestion.
That sounds good.

I'll try it.

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

2 participants