mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
21 lines
543 B
TypeScript
21 lines
543 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class VideoconvertService {
|
||
|
|
|
||
|
|
constructor(
|
||
|
|
private ffmpeg: FFMpeg
|
||
|
|
) { }
|
||
|
|
|
||
|
|
async convertVideo(inputPath, outputPath, formart) {
|
||
|
|
const ffmpegCommand = `-i "${inputPath}" -c:v copy -c:a aac -strict experimental "${outputPath}output.${formart}"`;
|
||
|
|
|
||
|
|
const result = await this.ffmpeg.exec(ffmpegCommand)
|
||
|
|
|
||
|
|
console.log('Convert returns ', `${outputPath}output.${formart}`);
|
||
|
|
}
|
||
|
|
}
|