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.63k stars 194 forks source link

Possible for concat and HLS export in one step? #317

Open marsderp opened 3 years ago

marsderp commented 3 years ago

As title suggests, it seems that I'm unable to do a concat and HLS export in a single command. Only the first video gets exported and the rest of the videos are simply ignored (this occurs also even if both input videos are exactly the same).

$ffmpeg = FFMpeg::fromDisk('videos')
                ->open(['video1.mp4', 'video2.mp4'])
                ->exportForHLS()
                ->setSegmentLength(5)
                ->inFormat(new X264('aac'))
                ->toDisk('video_exports')
                ->save('video.m3u8');

Here's an example ffmpeg command for concat + hls:

ffmpeg -re -f concat -i concat.txt -c:v libx264 -vbsf h264_mp4toannexb -r 25 -g 75 -c:a libfdk_aac -hls_time 3 playlist.m3u8

My current workaround is to save the concat video first then open that to exportForHLS.

SimonErich commented 1 year ago

Having the same issue right now. Any update on this?