I want to save recorded video and audio to a server. But I don't want to encode the video and audio on the client side, I want to encode them on the server side. How can I send the video and audio to the server? Do I stream it?
Asked
Active
Viewed 7,128 times
2 Answers
4
You can check this repo : Html5_Video_Audio_Recorder
Here is the basic usage of the library
var virec = new VIRecorder.initVIRecorder(
{
recorvideodsize : 0.4, // recorded video dimentions are 0.4 times smaller than the original
webpquality : 0.7, // chrome and opera support webp imags, this is about the aulity of a frame
framerate : 15, // recording frame rate
videotagid : "viredemovideoele",
videoWidth : "640",
videoHeight : "480",
} ,
function(){
//success callback. this will fire if browsers supports
},
function(err){
//onerror callback, this will fire if browser does not support
console.log(err.code +" , "+err.name);
}
);
startRecord.addEventListener("click" , function(){
virec.startCapture(); // this will start recording video and the audio
startCountDown(null);
});
stopRecord.addEventListener("click" , function(){
virec.stopCapture(oncaptureFinish);
});
playBackRecord.addEventListener("click" , function(){
virec.play(); /*Clientside playback,*/
});
discardRecordng.addEventListener("click" , function(){
virec.clearRecording();
});
uploadrecording.addEventListener("click" , function(){
var uploadoptions = {
blobchunksize : 1048576,
requestUrl : "php/fileupload.php",
requestParametername : "filename",
videoname : "video.webm",
audioname : "audio.wav"
};
virec.uploadData( uploadoptions , function(totalchunks, currentchunk){
progressNumber.innerHTML = ((currentchunk/totalchunks)*100);
console.log(currentchunk +" OF " +totalchunks);
});
});

Imal Hasaranga Perera
- 9,683
- 3
- 51
- 41
-
may I know why this is down voted ??? – Imal Hasaranga Perera Jul 14 '14 at 06:32
-
you could explain the code maybe – Rocel Feb 10 '15 at 19:22
-
Isn't the code self explanatory, it records a file audio and video and then uploads to the server if you go by each event that is easy to understand... – Imal Hasaranga Perera Feb 12 '15 at 16:42
-
1@Rocel need for explanation shouldn't be translated to downvote. imao – kmonsoor Mar 21 '16 at 10:27
1
You can send the audio and video over websockets to a WebSocket server that can then handle the packets the way you want. There are recorders out there currently and I have modified some to focus on sending over websockets, not downloading the files.

Benjamin Trent
- 7,378
- 3
- 31
- 41
-
This is interesting. An example or some docs will be much apprichated. – Luchezar May 05 '14 at 15:07
-
@semprom, yes. I will try and post some this evening but these scripts along with the plethora of webrtc examples on the web should get you started. – Benjamin Trent May 05 '14 at 15:20