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

How to save (download to the computer) converted video by ffmpeg? #506

Closed
aleksey-lav opened this issue Sep 10, 2020 · 4 comments · Fixed by #541
Closed

How to save (download to the computer) converted video by ffmpeg? #506

aleksey-lav opened this issue Sep 10, 2020 · 4 comments · Fixed by #541

Comments

@aleksey-lav
Copy link

aleksey-lav commented Sep 10, 2020

Description

Hello! After recorded the video and converted it using plugin ffmpeg need to download it? How to do it? AFAIK I can't use method saveAs

Steps to reproduce

this is my options for record

record: {
    audio: useAudio,
    [type]: true,
    maxLength: 5 * 60,
    convertEngine: 'ffmpeg.js',
    convertOptions: ['-f', 'mp3', '-codec:a', 'libmp3lame', '-qscale:a', '2'],
    pluginLibraryOptions: {
      outputType: 'audio/mpeg',
    },
    convertWorkerURL: '/static/js/ffmpeg/ffmpeg.js/ffmpeg-mp4.js',
  },

and after converted I am getting the object in player.convertedData but if I want to save using saveAs from npm my video doesn't work since mp4 and each of devices (mobile also) can't open this video. What method I should use to download recorded video correctly in mp4 format? Thanks

Results

Expected

Need to download recorded video in format mp4!

Actual

my video is saved in the format webm

@igasparetto
Copy link

This would be great!

@thijstriemstra
Copy link
Member

I was able to save the .ogg file from the audio-only-ffmpegjs.html sample in Firefox/Ubuntu using player.record().saveAs({'audio': 'foo'});

This isn't working for video? E.g. player.record().saveAs({'video': 'foo'});?

@thijstriemstra
Copy link
Member

I was able to save the .ogg file from the audio-only-ffmpegjs.html sample in Firefox/Ubuntu using player.record().saveAs({'audio': 'foo'});

Hmm, not sure about this comment, because I'm also unable to download the file.

@thijstriemstra
Copy link
Member

This will be supported in videojs-record 4.2.0 or newer with:

player.record().saveAs({'video': 'foo'}, 'convert');

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

Successfully merging a pull request may close this issue.

3 participants