0

I'm working on this repository. in this application, we can upload a video taken by a action camera or drone, and it uses GPS coordinates (lat,lang) and draw the path of the video in the map. And also we can play the video via the system too after upload.

Bt the size of the video is too much high. So it take a lot of time to process video and also download and play when we host in a server. I wanted to reduce size. So I write this code.

try {
new ffmpeg('demo.mp4', function (err, video) {
    if (!err) {
        video
            .setVideoSize('50%', true, false)
            .setVideoFrameRate(30)
            .save('output.mp4', function (error, file) {
                if (error) {
                    console.log("error : ", error);
                }
                if (!error)
                    console.log('Video file: ' + file);
            });
        console.log('The video is ready to be processed');
    } else {
        console.log('Error: ' + err);
    }
});

}

But the issue is I can't find where is the video coming from in this application. We need to pass like "demo.mp4" to my code as you can see. This is the index file if this application : https://github.com/chanakaDe/replay-lite/blob/master/frontend/index.html

And this is the player file : https://github.com/chanakaDe/replay-lite/blob/master/frontend/player.js

This is the file called api.js : https://github.com/chanakaDe/replay-lite/blob/master/frontend/api.js

This file also has some video functions : https://github.com/chanakaDe/replay-lite/blob/master/gopro/index.js

Please guys, sometimes you will see this questions as a silly question. But you have the repo to check and can you guys please check and let me know where to get a video file or stream to add my size reduce code ?

Chanaka De Silva
  • 401
  • 9
  • 20
  • You can stream the file to the client in chunks using `WebSocket`, or `EventStream` and `MediaSource` to decode the media stream rendered at ` – guest271314 Jan 26 '18 at 03:07
  • @guest271314 Thanks buddy. Can you please show me where i can use that please ? I'm really stuck in this :-( Please that a big help. a simple advice please – Chanaka De Silva Jan 26 '18 at 03:22
  • See [HTML5 audio streaming: precisely measure latency?](https://stackoverflow.com/questions/38768375/html5-audio-streaming-precisely-measure-latency), [How to use Blob URL, MediaSource or other methods to play concatenated Blobs of media fragments?](https://stackoverflow.com/questions/45217962/how-to-use-blob-url-mediasource-or-other-methods-to-play-concatenated-blobs-of), [https://stackoverflow.com/questions/46379009/how-to-use-segments-mode-at-sourcebuffer-of-mediasource-to-render-same-result](https://stackoverflow.com/q/46379009/) – guest271314 Jan 26 '18 at 03:34
  • @guest271314 I got it. The issue is i can't find anything like that in this project i have specified above. Can u show me where it's in this project ? Only if u have some free time. That would be so great – Chanaka De Silva Jan 26 '18 at 03:35
  • Have not tried the code at the repository. Have you asked the author of the repo that you forked how to use the code within the repo? – guest271314 Jan 26 '18 at 03:38

0 Answers0