Question

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?

Was it helpful?

Solution 2

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.

Link to Repo.

OTHER TIPS

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);
            });
     });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top