-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Interval upload to Web Server #438
Comments
i have noticed that after the first one other files have .bin extension try to change it and see if work. |
@oixan I couldn't find the .bin file you mention. The video uploaded format is (.webm). Could you elaborate it a bit? Thank for helping. |
@Sokunthaneth either concatenate all blobs into single WebM/Mp4/FLV file using Ffmpeg. Or otherwise stop and restart the recorder after each specific interval. It seems that you're using MediaRecorder API; here is how to use it: var recorder;
var counter = 1;
(function looper() {
var name = 'file_' + counter + '.webm';
var blobs = [];
recorder = new MediaRecorder(stream, {
mimeType: 'video/vp9'
});
recorder.ondataavailable = function(blob) {
blobs.push(blob);
};
recorder.onstop = function() {
var file = new File(blobs, name, {
type: 'video/webm'
});
var data = new FormData();
data.append('data_blob', file, name);
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://127.0.0.1:8000/video_upload/', true);
xhr.send(data);
counter++;
looper();
};
recorder.start(999999999999);
setTimeout(function() {
recorder.stop();
}, 5 * 1000);
})(); |
@muaz-khan thank for the guidance. I decide to use
|
Hi, I want to upload the recorded video at each specified time to web server. The below code upload the video to my Django web server fine. The first upload video can be played, however, the next videos can't be played. It just blank. Any idea why this occur? Thank you so much!
` // Upload video to Web Server occassionally, change "setInterval" parameter in millisecond
Why all uploads after the first one couldn't be played?
The text was updated successfully, but these errors were encountered: