michaelsolati / nativescript-ffmpeg Goto Github PK
View Code? Open in Web Editor NEWA Nativescript wrapper for the FFmpeg library. (ONLY SUPPORTS ANDROID)
Home Page: https://www.npmjs.com/package/nativescript-ffmpeg
License: Apache License 2.0
A Nativescript wrapper for the FFmpeg library. (ONLY SUPPORTS ANDROID)
Home Page: https://www.npmjs.com/package/nativescript-ffmpeg
License: Apache License 2.0
Steps for reproduce
System.err: StackTrace: System.err: Frame: function:'', file:'file:///data/data/org.nativescript.youtubemusic/files/app/tns_modules/nativescript-ffmpeg/ffmpeg.js', line: 7, column: 28 System.err: Frame: function:'require', file:'', line: 1, column: 266 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.youtubemusic/files/app/item/item-detail.component.js', line: 5, column: 29 System.err: Frame: function:'require', file:'', line: 1, column: 266 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.youtubemusic/files/app/app.routing.js', line: 6, column: 31 System.err: Frame: function:'require', file:'', line: 1, column: 266 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.youtubemusic/files/app/app.module.js', line: 5, column: 21 System.err: Frame: function:'require', file:'', line: 1, column: 266 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.youtubemusic/files/app/main.js', line: 5, column: 20 System.err: Frame: function:'require', file:'', line: 1, column: 266
https://github.com/icarofm/ffmpeg-cmd-ios
https://github.com/abc19abc91/FFmpegMain-ios
https://github.com/iswear/ffmpeg_for_ios_with_commandline
Found the following cmd ffmpeg library for IOS that support command line tool way. Hope to be able to work with you and have IOS working soon
When the compression is done. it seems that the thread in background is still busy. because when I start a nieuwe compression then I get the error that the compression is still busy. does any body know the command to stop ffmpeg thread.
onSuccess: function (message) {
if (debug) {
console.log('Successfully run FFmpeg');
}
if (callback) {
callback();
}
return;
},
onFinish: function () {
// here ? ---------------------------------------------------------------------
if (callback) {
callback();
}
return;
}
});
try {
ffmpeg.execute(command, new ExecuteBinaryResponseHandler());
//Or here ??-------------------------------------------------------------------
ffmpeg.process.terminate();
}
I´m doing app which records a interview with plugin nativescript-recorder but after record, the output file size is very big. I want to compress it to send it to server.
I´m facing troubles when I use the comand execute which doesn´t compress file.
It seems this algorithm enter on both conditionals
MOTO X 2nd
this.recorder.on("finished", args => {
clearInterval(this.interval);
if (this.get("duration")) {
const file = args.object.get('file');
this._compress(file);
}
});
private _compress(src: string): void {
console.log("Original file size " + this._getSize(src));
const out = src.replace(/\.[^/.]+$/, "_COMPRESSED.mp4");
FFmpeg.execute(["-i", src, "-vcodec", "h264", "-acodec", "mp4", out], (err) => {
if (err) {
console.log(err);
console.log('it was error')
} else {
console.log(src);
console.log(out);
console.log("Compressed file size " + this._getSize(out));
}
});
}
private _getSize(path: string): string {
let length: number = 0;
if (isAndroid) {
const file = new java.io.File(path);
length = file.length();
} else {
const defManager = NSFileManager.defaultManager;
const fileAttributes = defManager.attributesOfItemAtPathError(path);
length = fileAttributes.objectForKey(NSFileSize);
}
return `${(length / (1000 * 1000)).toFixed(2)} MB`;
}
is it possible for me to use this plugin to just compress video file without using other functionalities
I see that the compression works but the xxxxx__COMPRESSED.mp4 is only visable when restarting device. is there something to be refresh after compressing? Any help is much appretiated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.