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

Very interesting issue: video/mp2t #528

Open serdarkok opened 2 months ago

serdarkok commented 2 months ago

Test assets: PHP: v8.1, v8.2, v8.3, v8.4 Laravel: v10, v8 pbmedia/laravel-ffmpeg: v8.5, v.8.4 ffmpeg: v7, v4.4.4

When I try to play a rendered video (I created a simple video.js html) m3u8s are loaded as "Content Type: application/vnd.apple.mpegurl". .ts files are also loaded as "ContentType: application/vnd.apple.mpegurl" and the video does not play. The interesting thing is that I can play the rendered video files under a static folder. I am attaching the screenshots. I can also play the rendered video with a player like VLC. What do you think could be the reason for this problem? I have been suffering for 4 days.

web route:

Route::get('/video/{playlist}', function ($playlist) {
      return FFMpeg::DynamicHLSPlaylist()
        ->fromDisk('converted')
        ->open($playlist)
        ->setMediaUrlResolver(function ($mediaFilename){
            return Storage::disk('converted')->url($mediaFilename);
        })
        ->setPlaylistUrlResolver(function ($playlistFilename) {
            return route('video.playlist', ['playlist' => $playlistFilename]);
        });
})->name('video.playlist');

filesystem.php:

'converted' => [
            'driver' => 'local',
            'root' => storage_path('app/converted'),
            'url' => env('APP_URL').'/video',
            'visibility' => 'public',
            'throw' => true,
        ],
image image