Open tfsjohan opened 3 years ago
It didn't know that mp4 was an audio format - I have no idea if it will work.
You can apt
install ffmpeg
and run the following code below in NodeJS.
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 14.13.1
)
Accepting a PR to conditionally add -vn
(skip inclusion of video flag) when an option is passed.
Can I use this to convert webm audio file to a audio mp4 file? Don't need video, just audio.