generated from Richienb/node-module-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support audio-only #1
Comments
It didn't know that mp4 was an audio format - I have no idea if it will work. |
You can const exec = require( 'child_process' ).exec;
function convertWebmToMP4 ( filePath ) {
exec(
`ffmpeg -i "${ filePath }" "${ filePath.replace( /.webm/, '.mp4' ) }"`,
function( error, stdout, stderr ) {
if ( error )
console.error( `Got an error trying to convert the file: ${ error }` );
else
console.log( stdout );
}
);
}
convertWebmToMP4( `${ process.env.PWD }/tmp/file.webm` ); ( Tested in NodeJS |
Accepting a PR to conditionally add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can I use this to convert webm audio file to a audio mp4 file? Don't need video, just audio.
The text was updated successfully, but these errors were encountered: