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

Unable to store long duration Videos in my server. #224

Open
venkatRamisetty opened this issue Jun 13, 2014 · 3 comments
Open

Unable to store long duration Videos in my server. #224

venkatRamisetty opened this issue Jun 13, 2014 · 3 comments

Comments

@venkatRamisetty
Copy link

while trying the video recording in the link given below
https://www.webrtc-experiment.com/RecordRTC/PHP/
the video recording and storing is running successfully.

But when I am trying in my shared server I am unable to store more than 3 min video.

Here is the link of my hostserver
http://tvisha.com/votocrat/recorder_php/RecordRTC/RecordRTC-to-PHP/

Uncaught RangeError: Invalid array buffer length RecordRTC.js:695
mergeBuffers RecordRTC.js:695
onRecordingStopped

Please advice me to get recording of more than 10 to 15 min.

Thanks!

@muaz-khan
Copy link
Owner

Its a common case on all PHP default installations. You should define following values in ".htaccess" file if you've root-level privileges.

<IfModule mod_php4.c>
php_value session.gc_maxlifetime 10800
php_value max_input_time 10800
php_value max_execution_time 10800
php_value upload_max_filesize 500M
php_value post_max_size 500M
</IfModule>

Above technique rarely works on Amazon EC2. You need to login as root-user to the terminal; then search for all "php.ini" files:

find / -name "php.ini"

There should be "php.ini" file located in your appache installation directory. Its location varies for each installation that's why you should check all "php.ini" files.

vim php.ini

// or otherwise you can use "vi"
vi php.ini

Above command will open editing mode; then you should search and edit following values:

/session.gc_maxlifetime
/max_input_time
/max_execution_time
/upload_max_filesize
/post_max_size

Each line is searching a specific string. Note: Above command may work in "replace" mode instead of "insert" mode.

You should change default values to:

session.gc_maxlifetime=10800
max_input_time=10800
max_execution_time=10800
upload_max_filesize=500M
post_max_size=500M

Remember, NEVER forget "max_execution_time" because usually ffmpeg execution process takes time to transcode and merge webm. Though, in your demo, you're not using ffmpeg.

:wq command can be used to save changes and close editing mode. You need to type this command in "replace" mode.

Note: You can navigate between "insert" and "replace" modes by simply pressing "insert" key.

Please don't forget to set a temporary PHP page where you can check PHP-info:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Now, open that PHP page and search for all above values e.g. post_max_size etc.

P.S. Sometimes you need to manually set read/write access for directories like "uploads" however your demo has privileges to read/write WAV/WebM files in uploads directory.

@muaz-khan
Copy link
Owner

Uncaught RangeError: Invalid array buffer length RecordRTC.js:695
mergeBuffers RecordRTC.js:695 onRecordingStopped

Please advice me to get recording of more than 10 to 15 min.

I think I already answered a similar question.

ArrayBuffer object accepts length varies browser to browser. It should be accepting signed or unsigned integer value and integer always has maximum length, something like 32kb.

Maybe we should choose indexed-db or other solutions to write DataURLs to disk and when stopRecording method is invoked, we need to convert DataURLs back into Blob and concatenate all blobs.

Or otherwise, need to chunkify/fragmentify recordings and make list of blobs accordingly.

This solution will provide an additional advantage, which is that we can check recorded blob-size prior to calling stopRecording method.

@venkatRamisetty
Copy link
Author

Thanks for the information Muaz. As per your first reply.. I updated all the required things in the php.ini and checked in the php info page for confirmation http://tvisha.com/phpinfo.php . Issue I am facing is after recording the video is showing the total length of the video but when I am playing, it get stop just after 27 seconds. 90% video is saving please check the 18 min video linked here.. it's stopping after 30 secs
http://tvisha.com/votocrat/recorder_php/RecordRTC/RecordRTC-to-PHP/uploads/Venkat_102931211.webm
please help to get resolve it. I will be thankful to you if you can elaborate about buffer length.. where we can change it?

Thanks!!

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