Created
August 20, 2020 09:42
-
-
Save teezzan/ed6b886371be760840992d08afced754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios({ | |
method: "get", | |
url: rec_Url, | |
responseType: "stream" | |
}).then(function (response) { | |
response.data.pipe(fs.createWriteStream("./my.mp3")); | |
}).then(() => { | |
// From a local path... | |
mm.parseFile('./my.mp3') | |
.then(metadata => { | |
console.log(metadata); | |
}) | |
// make sure you set the correct path to your video file | |
var proc = ffmpeg('./images/image.png') | |
// loop for 5 seconds | |
// .loop() | |
.input(rec_Url) | |
// setup event handlers | |
.on('end', function () { | |
console.log('file has been converted succesfully'); | |
}) | |
.on('error', function (err) { | |
console.log('an error happened: ' + err.message); | |
}) | |
// save to file | |
.save('./newpost.mp4'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment