diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/converter/VideoRotator.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/converter/VideoRotator.java index 1a7c767e10..4c56d23774 100644 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/converter/VideoRotator.java +++ b/bbb-video/src/main/java/org/bigbluebutton/app/video/converter/VideoRotator.java @@ -19,6 +19,7 @@ public class VideoRotator { public static final String ROTATE_LEFT = "rotate_left"; public static final String ROTATE_RIGHT = "rotate_right"; + public static final String ROTATE_UPSIDE_DOWN = "rotate_left/rotate_left"; private String streamName; private FFmpegCommand.ROTATE direction; @@ -76,13 +77,19 @@ public class VideoRotator { * @return FFmpegCommand.ROTATE for the given direction if present, null otherwise */ public static FFmpegCommand.ROTATE getDirection(String streamName) { - String parts[] = streamName.split("/"); - + int index = streamName.lastIndexOf("/"); + String parts[] = { + streamName.substring(0, index), + streamName.substring(index + 1) + }; + switch(parts[0]) { case ROTATE_LEFT: return FFmpegCommand.ROTATE.LEFT; case ROTATE_RIGHT: return FFmpegCommand.ROTATE.RIGHT; + case ROTATE_UPSIDE_DOWN: + return FFmpegCommand.ROTATE.UPSIDE_DOWN; default: return null; } diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/ffmpeg/FFmpegCommand.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/ffmpeg/FFmpegCommand.java index 103851c582..9d8395862a 100644 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/ffmpeg/FFmpegCommand.java +++ b/bbb-video/src/main/java/org/bigbluebutton/app/video/ffmpeg/FFmpegCommand.java @@ -12,7 +12,7 @@ public class FFmpegCommand { /** * Indicate the direction to rotate the video */ - public enum ROTATE { LEFT, RIGHT }; + public enum ROTATE { LEFT, RIGHT, UPSIDE_DOWN }; private HashMap args; private HashMap x264Params; @@ -164,6 +164,9 @@ public class FFmpegCommand { case RIGHT: this.args.put("-vf", "transpose=1"); break; + case UPSIDE_DOWN: + this.args.put("-vf", "transpose=2,transpose=2"); + break; } }