Keep aspect ratio for portrait videos

So my use case is that I have some videos that I need to convert to mp4/webm but I want to keep the aspect ratio of the original video. This could be a portrait video taken on a mobile (cell) phone for example. Currently all videos get a 4:3 (I think?) aspect ratio, which makes the portrait videos look pretty weird.

I’m using right now this in my assembly template:

"video_thumbed": {
  "use": ":original",
  "robot": "/video/thumbs",
  "result": true,
  "count": 1,
  "ffmpeg_stack": "v3.3.3"
},
"video_webm": {
  "use": ":original",
  "robot": "/video/encode",
  "ffmpeg_stack": "v3.3.3",
  "preset": "webm"
},
"browser720_h264_encoded": {
  "use": ":original",
  "robot": "/video/encode",
  "result": true,
  "ffmpeg_stack": "v3.3.3",
  "preset": "ipad-high"
},
1 Like

Sorry for the long delay here.

This is because of the default resize_strategy being “pad”, which forces the provided width and height (from the preset) and adds black borders.

If you add “resize_strategy”: “fit” to all /video/encode Steps, aspect ratio will be preserved correctly.