Attached file original size is 256x240
Target dimension is 1280x720
Aspect mode is 'preserve'

Result size is 86x720

Expected Result size is 768x720

To fix this issue I make small fix

--- a/transcoders/TranscoderAbstractionFactoryFfmpeg.inc
+++ b/transcoders/TranscoderAbstractionFactoryFfmpeg.inc

@@ -688,7 +688,7 @@
           $height = $sourcedimensions[1] * $factor;
         }
         else {
-          $factor = $targetdimensions[1] < $sourcedimensions[1] ? $targetdimensions[1] / $sourcedimensions[1] : $sourcedimensions[1] / $targetdimensions[1];
+          $factor = $targetdimensions[1] > $sourcedimensions[1] ? $targetdimensions[1] / $sourcedimensions[1] : $sourcedimensions[1] / $targetdimensions[1];
           $width = $sourcedimensions[0] * $factor;
           $height = $targetdimensions[1];
         }

Please validate

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andreyks created an issue. See original summary.

heshanlk’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, video-TranscodersAbstractionFactoryFfmpeg.patch, failed testing.

The last submitted patch, video-TranscodersAbstractionFactoryFfmpeg.patch, failed testing.

The last submitted patch, video-TranscodersAbstractionFactoryFfmpeg.patch, failed testing.

The last submitted patch, video-TranscodersAbstractionFactoryFfmpeg.patch, failed testing.

bhawanac’s picture

Assigned: Unassigned » bhawanac

I will starting working on this issue.

bhawanac’s picture

I am working on it.

chaitanya17’s picture

Hi bhawanac,

Can you please add use case for testing after implementing patch.
Also make sure your patch is tested by latest version.

Regards

bhawanac’s picture

@chaitanya:
I am done with the implementation.

I have tried with video of Resolution as 360*240
Target dimension is 1280x720
Aspect mode is 'preserve'

Result through:
Earlier code: 107 * 720
patch applied: 960 * 720

bhawanac’s picture

This is the working patch for above issue.

bhawanac’s picture

Status: Needs work » Needs review
chaitanya17’s picture

Status: Needs review » Needs work

Hi bhawanac,

Thanks for patch, I will verify and roll it, if it works properly.

Regards,

chaitanya17’s picture

Status: Needs work » Needs review
chaitanya17’s picture

Status: Needs review » Closed (fixed)

@bhawana, thanks for patch.

chaitanya17’s picture

Status: Closed (fixed) » Fixed

Changing status to fixed.

bhawanac’s picture

@chaitanya:
Thanks for applying the patch.
But I am not able to see this commit under my profile.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.