Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openAdvanced doesn't include stream #526

Open
DawidWetzler opened this issue Sep 2, 2024 · 0 comments
Open

openAdvanced doesn't include stream #526

DawidWetzler opened this issue Sep 2, 2024 · 0 comments

Comments

@DawidWetzler
Copy link

Hi there,

I'm trying to open video to apply some advanced filters (complex filters) but it looks openAdvanced isn't properly working with MediaCollection.

I've shorten in completely to get the smallest reproducible version:

$media = new MediaCollection([
    Media::make('local', 'input.mp4'),
]);

$result = $ffmpeg->openAdvanced($media)
    ->export()
    ->toDisk('local')
    ->addFormatOutputMapping(new WebM(videoCodec: 'libvpx-vp9'), Media::make('local', 'output.webm'), [])
    ->dd();
            
// -y -threads 12 -vcodec libvpx-vp9 -b:v 1000k -acodec libvorbis -b:a 128k -f webm /var/www/html/storage/app/output.webm

Meanwhile this in raw phpffmpeg is working.

$ffmpeg = \FFMpeg\FFMpeg::create();
$video  = $ffmpeg->openAdvanced([storage_path('app/input.mp4')]);
$cmd = $video->map([], new WebM(videoCodec: 'libvpx-vp9'), storage_path('app/output.webm'))
            ->getFinalCommand();

dd($cmd);
            
//output: -y -i /var/www/html/storage/app/input.mp4 -map  -vcodec libvpx-vp9 -acodec libvorbis -b:a 128k -f webm /var/www/html/storage/app/output.webm

I'm not sure what's causing this but the chain led to ->open method where the media collection this is already empty.

This results in Output file #0 does not contain any stream. error from ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant