rotationCmd property

String get rotationCmd

Convert the controller's rotation value into a String used to provide crop values to FFmpeg (see more)

The result is in the format transpose=2 (repeated for every 90 degrees rotations)

Implementation

String get rotationCmd {
  final count = controller.rotation / 90;
  if (count <= 0 || count >= 4) return "";

  final List<String> transpose = [];
  for (int i = 0; i < controller.rotation / 90; i++) {
    transpose.add("transpose=2");
  }
  return transpose.isNotEmpty ? transpose.join(',') : "";
}