Giter Club home page Giter Club logo

video-editor's Introduction

API based Online Video Editor

NodeJs, AngularJs & FFMPEG based web video editor. I have showing the backend logic for editing video. Actually when someone try to edit video using NodeJs, ffmpeg, he cant think how to start & how he can do it. So I have implemented this video editor with very simple logic with ffmpeg. All resource are together here & anybody can start from here. If someone analysis these codes, he can understand the basic for video editor

Feature Implemented :

  • Mute a Video
  • Remove Video & save Only audio.
  • Showing Video Metadata.
  • Genarate Thumbnail.
  • Cropping Video
  • Effect : Fadein, Fadeout,Blur, Sharpen.

Working on :

  • Watermark
  • More Video Effects
  • Add new sound
  • Add Text

Configure mechine: ( Linux )

1. SSH into your instance and become root
sudo su -

2. Go to the the /usr/local/bin directory
cd /usr/local/bin

3. Inside the /usr/local/bin directory, create an "ffmpeg" directory
mkdir ffmpeg

4. Go into the new directory
cd ffmpeg

5. Go to static build directory at http://ffmpeg.gusari.org/static/64bit/ and pick the 
latest version of FFMPEG - as of this writing, it was ffmpeg.static.64bit.2014-02-16.tar.gz
wget http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-02-16.tar.gz

6. The file should now be in /usr/local/bin/ffmpeg. Untar it...
tar -xzf ffmpeg.static.64bit.2014-02-16.tar.gz

5. Run it and check what the latest version is 
./ffmpeg -version
6. If you want to be able to execute FFMPEG from any directory, simply create a symlink into /usr/bin like this:
ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
ln -s /usr/local/bin/ffmpeg/ffprobe /usr/bin/ffprobe

The first part (/usr/local/bin/ffmpeg/ffmpeg) is where the file is located after I untarred 
the file. The second part (/usr/bin/ffmpeg) is where we want the symlink to go

Configure mechine: ( Mac )

$ brew install ffmpeg --force
$ brew link ffmpeg

How ffmpeg, NodeJs works:

Mute Video : To disable audio you can use noAudio( ) method.

    ffmpeg('public/raw/test.mp4') //Input Video File
    .output('public/edited/noaudio/output.mp4') // Output File
    .noAudio().videoCodec('copy')
    .on('end', function(err) {
        if(!err)
        {
            console.log("Conversion Done");
        }

    });
    .on('error', function(err){
        console.log('error: ', +err);

    }).run();

Remove Video & save Only audio :

    ffmpeg('public/raw/test.mp4')  // Input Video File
    .output('public/edited/removevideo/output.mp3') // Output  File
    .on('end', function(err) {
        if(!err)
        {
        	console.log("Remove video is done");
        }

    })
    .on('error', function(err){
        console.log('error: '+err);
    }).run();

Showing Video Metadata:

ffmpeg.ffprobe('public/raw/test.mp4', function(err, metadata) { // Input video File
   if(err){
    console.log("MetaData not Found. "+err);
   }
   else{
    console.log(metadata)
   }
});

Genarate Thumbnail:

    var ffmpeg = require('fluent-ffmpeg'); 
    var probe = require('node-ffprobe');
    probe('public/raw/test.mp4', function(err, probeData) 
    {

        var proc = new ffmpeg('public/raw/test.mp4'); // Input File

        proc.screenshots({
            timestamps: ['50%','80%'],
            folder: 'public/edited/thumbnail/output', // Thumbnail Location
            size: '392x220'
        }).on('end', function() {
           console.log('Screenshots taken');
        });

    });

Cropping Video:

    ffmpeg('public/raw/input.mp4') //Input Video File
    .output('public/edited/cropvideo/output.mp4') // Output File
    .audioCodec('libmp3lame') // Audio Codec
    .videoCodec('libx264')  // Video Codec
    .setStartTime(03) // Start Position
    .setDuration(5) // Duration
    .on('end', function(err) {
        if(!err)
        {

            console.log("Conversion Done");
            res.send('Video Cropping Done');

        }

    })
    .on('error', function(err){
        console.log('error: ', +err);

    }).run();

Copyright

Copyright (c) 2016 Nazmul Hossain

License : The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

video-editor's People

Contributors

bilashcse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

video-editor's Issues

sound

when you add sound to video ?

Could you provide a demo

Hi,

Could you somehow create a Demo?
i can give you free Server Access to my Servers (+4915161018772).

Best,
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.