Exemplo n.º 1
0
 public string GenerateRotationDescriptionMessageArgArgument(string messageArg)
 {
     return((FfmpegRotationArgumentDeterminer.GetRotationArgFromMessageArg(messageArg)) switch
     {
         "90" => "90° counter-clockwise",
         "270" => "90° clockwise",
         "180" => "180°",
         _ => throw new ArgumentException("Invalid or empty rotation message."),
     });
Exemplo n.º 2
0
        public void Rotate(string messageArg)
        {
            if (File.Exists("video.mp4"))
            {
                var rotationArg = FfmpegRotationArgumentDeterminer.GetRotationArgFromMessageArg(messageArg);
                _ffmpegExecutor.ExecuteFfmpegCommandWithArgString($"-i video.mp4 -c copy -metadata:s:v:0 rotate={rotationArg} video_rotated.mp4");
            }

            if (File.Exists("video_rotated.mp4"))
            {
                Console.WriteLine("video rotated successfully!");
            }
            else
            {
                throw new VideoRotateException("Video rotation failed.");
            }
        }