Ticket #194 (closed defect: fixed)

Opened 2 years ago

Last modified 20 months ago

Transcode without padding

Reported by: Michiel.Schok Owned by: arjen
Priority: major Milestone: MediaMosa 2.1
Component: Transcoding Version: 2.1.4
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours:

Description

In the past the option 'keep aspect ratio' was introduced in the transcoding parameters which can be filled in from the management portal.
When set to yes, in combination with a fixed size, at that moment it generated a video which size was within the bounding box of {size}, and maintained the aspect ratio.

This behaviour has changed recently (I missed the trac issue in which is was changed), and now black padding is added so that the size of the video is exactly {size}. While I can see the need for this behaviour, I also want the opportunity to have the previous situation, so that no padding is added.

I suggest the 'Maintain aspect ratio' drop down get 3 possible states:
* no: the video is rescaled to fit {size}, possibly deforming
* yes, add padding: the video is rescaled, aspect ratio maintained. Padding is added to create a video exactly of {size}
* yes, no padding: the video is rescaled, aspect ratio maintained. No padding is added. Resulting size of the video fits in the bounding box {size}, but it's absolutely not necessary that we get an exact fit.

Example.
Original material is 1024 x 600 pixels
Target size is 320 x 240

No: resulting video is 320 x 240 and 'highly deformed'
yes, padding: the video is scaled to 320 x 188, and 26pixels black padding is added on top and below to create a 320 x 240 video.
Yes, no padding: the video is scaled to 320 x 188.

Change History

Changed 2 years ago by Frans

  • milestone changed from MediaMosa X.X to MediaMosa 2.1

Changed 2 years ago by Frans

  • moscow set to Must Have

Changed 2 years ago by forgacs

  • owner set to forgacs
  • status changed from new to assigned

Changed 2 years ago by forgacs

  • owner changed from forgacs to robert

Changed 2 years ago by forgacs

  • status changed from assigned to closed
  • resolution set to ready_for_review

Changed 2 years ago by Michiel.Schok

Where's the setting, how can we access this feature?

Changed 22 months ago by robert

  • status changed from closed to reopened
  • resolution ready_for_review deleted

Copying your examples;

No: resulting video is 320 x 240 and 'highly deformed'

Provide maintain_aspect_ratio:no and size:320x240 as parameters in transcode profile.

yes, padding: the video is scaled to 320 x 188, and 26pixels black padding is added on top and below to create a 320 x 240 video.

Provide maintain_aspect_ratio:yes and size:320x240 as parameters in transcode profile.

Yes, no padding: the video is scaled to 320 x 188.

Provide maintain_aspect_ratio:no and size:320x188 as parameters in transcode profile.

Changed 22 months ago by robert

  • status changed from reopened to closed
  • resolution set to fixed

Changed 22 months ago by Michiel.Schok

  • status changed from closed to reopened
  • tested set to yes
  • resolution fixed deleted

Hi robert,

this was not the resolution I was looking for.
It should be separate from 'maintain_aspect_ratio' and resolution.

Transcode profiles are seldom updated, and I don't know in advance *what* resolution original file will be in the system. I only know that it should be transcoded to a different resolution (the maximum bounding box given in the profile), and that the aspect_ratio should be maintained. And I don't want black padding.

the requirement in the opening ticket:

* yes, no padding: the video is rescaled, aspect ratio maintained. No padding is added. Resulting size of the video fits in the bounding box {size}, but it's absolutely not necessary that we get an exact fit.

is not implemented. Now I need to do the calculation myself and adjust the transcode profile on a 'per transcoding base'.

Changed 21 months ago by robert

  • owner changed from robert to forgacs
  • status changed from reopened to assigned

Changed 21 months ago by forgacs

The maintain_aspect_ratio parameter has two values now: "no" and "yes". I suggest a third parameter: "yes_resize".

Example.
Original material is 1024 x 600 pixels
Target size is 320 x 240

* no (current behavior): resulting video is 320 x 240 and 'highly deformed'
* yes (current behavior): the video is scaled to 320 x 188, and 26pixels black padding is added on top and below to create a 320 x 240 video.
* yes_resize (no padding): the video is scaled to 320 x 188

Would this solution be ok?

Changed 21 months ago by Michiel.Schok

I would suggest to call them

'no'
'yes_padding'
'yes_no_padding'

and accept 'yes' as a 'yes_padding'

yes_resize would be a strange one.

Still better, imho, is two parameters: the current 'maintain_aspect_ratio' and a new one 'padding' (default: yes).

Changed 21 months ago by forgacs

  • owner changed from forgacs to arjen

Changed 21 months ago by MC-arjen

  • status changed from assigned to closed
  • resolution set to fixed
  • version set to 2.1.2
  • component changed from Core to Transcoding
  • tested changed from yes to no

commited to 2.1.2 (documentation on mm.org/api needs an update)

Changed 21 months ago by MC-arjen

  • status changed from closed to reopened
  • resolution fixed deleted

a original file with 320x176 with parameters: size=640x480, aspect=yes, padding=no gives a video with size: 640x480. (not good)

a original file with 320x176 with parameters: size=320x240, aspect=yes, padding=no gives a video with size: 320x176. (good)

Changed 21 months ago by MC-arjen

  • owner changed from arjen to pforgacs
  • status changed from reopened to assigned

Changed 21 months ago by forgacs

  • owner changed from pforgacs to arjen

I have tried to reproduce this issue, but I couldn't.
What was your REST call and your transcode profile settings?

Changed 21 months ago by Michiel.Schok

I tested 1280x720 material, downsized to size 352x288, aspect=yes, padding=no. That gave 352x200 (good).
also, I tested upscaling, a video of 720x480, upsized to 1280x720, aspect=yes, padding=no. That gave 1080x720 as a result (good).

Not tried (as Arjan): upscaling with a contraint in the x-axis...
Still looking for a good video.

Changed 20 months ago by forgacs

The tests around the mediamosa_job_scheduler::calc_aspect_ratio() function is in my local repository.

Changed 20 months ago by Frans

and scheduled for the 2.1.4 version or is it in 2.1.3?

Changed 20 months ago by MC-arjen

  • status changed from assigned to closed
  • version changed from 2.1.2 to 2.1.4
  • resolution set to fixed

The unittests are in the 2.1.4 version, i will close the issue here.

Changed 20 months ago by Michiel.Schok

  • tested changed from no to yes
  • accepted changed from no to yes

Getest met een flash-profiel (id 13): werkt.

Note: See TracTickets for help on using tickets.