Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcode issue #18

Open
pixellet14 opened this issue Jul 15, 2023 · 1 comment
Open

Transcode issue #18

pixellet14 opened this issue Jul 15, 2023 · 1 comment

Comments

@pixellet14
Copy link

pixellet14 commented Jul 15, 2023

The transcoded video doesn't play in the html5 video element.

@MaximBelov
Copy link

MaximBelov commented Jul 18, 2023

example

  private async encodeVideo(inputFilePath: string, outputFilePath: string) {
    // https://superuser.com/questions/1155186/convert-mov-video-to-mp4-with-ffmpeg
    if (inputFilePath) {
      const command = [
        `-i ${inputFilePath}`,
        '-vcodec libx264',
        '-preset veryfast',
        '-vf scale=w=1280:h=1280:force_original_aspect_ratio=decrease',
        '-pix_fmt yuv420p',
        '-c:a aac',
        '-ss 00:00',
        '-to 00:30',
        '-movflags +faststart',
        outputFilePath,
      ].join(' ');
      await this.ffMpeg.exec(command);
    }
  }

Npm package
https://www.npmjs.com/package/cordova-plugin-ffmpeg

Active fork https://github.com/MaximBelov/cordova-plugin-ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants