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

How to add multiple subtitles? #468

Open irakan opened 1 year ago

irakan commented 1 year ago

I am using this to add a subtitle which if working fine:

FFMpeg::openUrl($videoUrl)
    ->addFilter(function (VideoFilters $filters) use ($subtitleFilePath) {
            $filters->custom("subtitles={$subtitleFilePath}");
    })
    ->export()
    ->inFormat(new X264())
    ->toDisk('s3')
    ->save($savePath);

I tried to add another filter for the second subtitle file but they get on top of each other.. How can I add a multiple subtitles, so that the user can select which one to display on the video player..