protonemedia / laravel-ffmpeg

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
https://protone.media/en/blog/how-to-use-ffmpeg-in-your-laravel-projects
MIT License
1.66k stars 194 forks source link

Merge Video and Audio ,Video sound get muted #469

Open franssuny opened 1 year ago

franssuny commented 1 year ago

Hello how to enable audio from video and audio when i trying to merge into one cannot hear sound from the video thank you

   FFMpeg::fromDisk('public')
            ->open(['karaoke.mp3','karaoke.mp4'])
            ->export()
            ->addFormatOutputMapping(new X264, Media::make('public', 'new_video.mp4'), [ '1:a','1:v','0:a'])
            ->save();

or possible to translate this command to FFMPEG laravel?

ffmpeg -i /var/www/html/karaoke/chBGaCqQDDXCvTk4hwUgWYtxBCn5fAI0R42trJaH.mkv  -i /var/www/html/karaoke.mp3  
        -filter_complex "[0:a]volume=1,apad[A];[1:a][A]amerge[Aout]" -map 0:v -map [Aout] -y output-finalxxxx.mp4