How to return generated command string only when using PHP-FFMpeg libarary

241 views Asked by At

How can I see which command string generated for below example code

$advancedMedia = $ffmpeg->openAdvanced(array('video_1.mp4', 'video_2.mp4'));
$advancedMedia->filters()
    ->custom('[0:v][1:v]', 'hstack', '[v]');
$advancedMedia
    ->map(array('0:a', '[v]'), new X264('aac', 'libx264'), 'output.mp4')
    ->save();

looking for toString() for FFMpeg class or https://github.com/protonemedia/laravel-ffmpeg libs

1

There are 1 answers

0
Dan On BEST ANSWER

Apparently there's a method called getFinalCommand in the audio and video classes by the PHP-FFMpeg package.

Access it via the get method:

$advancedMedia
    ->get()
    ->getFinalCommand();

Untested code.