Home » Php » php – Crop being ignored when added with resize filter

php – Crop being ignored when added with resize filter

Posted by: admin February 25, 2020 Leave a comment

Questions:

Using the following:

$video -> filters()
    -> resize(new FFMpeg\Coordinate\Dimension(480, 854))
    -> crop(new FFMpeg\Coordinate\Point("t*100", 0, true), new FFMpeg\Coordinate\Dimension(480, 640))
    ->watermark('watermark.png', array(
            'position' => 'relative',
            'bottom' => 10,
            'right' => 10,
    ));

I get a resized video but doesn’t crop the to the proportions set. Resulting video is 480×854, with a watermark but not cropped.

If I use:

$video -> filters()
    -> crop(new FFMpeg\Coordinate\Point("t*100", 0, true), new FFMpeg\Coordinate\Dimension(480, 640))
    ));

It crops the image to the right size, but only a portion of the video, as you’d expect.

How to&Answers: