diff --git a/README.md b/README.md index 6a2666d..4f1efa4 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ Use the approach with the library promise console.log(e.msg); } ``` +Can be used an url to video: +```js + var process = new ffmpeg('https://videos_bacucket.s3.amazonaws.com/testl.mp4'); +``` + ## The video object Each time you create a new instance, this library provides a new object to retrieve the information of the video, the ffmpeg configuration and all methods to make the necessary conversions: @@ -119,6 +124,7 @@ Params: , keep_aspect_ratio : true // Mantain the original aspect ratio , padding_color : 'black' // Padding color , file_name : null // File name + , png_frame : false // PNG frame instead of JPG } ``` * __callback__: *(optional)* If specified at the end of the process will be returned list of paths of frames created: diff --git a/lib/ffmpeg.js b/lib/ffmpeg.js index b655e50..2d6ac2d 100644 --- a/lib/ffmpeg.js +++ b/lib/ffmpeg.js @@ -197,8 +197,9 @@ var ffmpeg = function (/* inputFilepath, settings, callback */) { // Get the input filepath var inputFilepath = args[0]; // Check if file exist - if (!fs.existsSync(inputFilepath)) - throw errors.renderError('fileinput_not_exist'); + if (!/^http/.test(inputFilepath.toLowerCase()) && !fs.existsSync(inputFilepath)){ + throw errors.renderError('fileinput_not_exist'); + } // New instance of the base configuration var settings = new configs(); diff --git a/lib/video.js b/lib/video.js index 903efdb..77fda9a 100644 --- a/lib/video.js +++ b/lib/video.js @@ -553,9 +553,12 @@ module.exports = function (filePath, settings, infoConfiguration, infoFile) { var deferred = typeof callback != 'function' ? when.defer() : { promise : null }; // Deal with input paths that have spaces in them, by quoting them for (i=0; i