Files
doneit-web/src/app/services/videoconvert.service.ts
T

21 lines
543 B
TypeScript
Raw Normal View History

2024-03-01 14:37:42 +01:00
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}`);
}
}