/// <summary> /// Gets the rotation filter corresponding to the requested rotation amount. Returns an empty string when /// no rotation is requested. /// </summary> /// <param name="rotation">The amount of rotation being requested.</param> /// <param name="encoderArguments"></param> /// <returns>System.String.</returns> /// <remarks>Documentation: http://ffmpeg.org/ffmpeg-filters.html#transpose, http://ffmpeg.org/ffmpeg-filters.html#hflip, /// http://ffmpeg.org/ffmpeg-filters.html#vflip</remarks> private static string GetAutoRotationFilter(MediaObjectRotation rotation, string encoderArguments) { var filter = String.Empty; if (!encoderArguments.Contains(AutoRotateFilterName)) { return(filter); } switch (rotation) { case MediaObjectRotation.Rotate90: filter = "transpose=clock"; break; case MediaObjectRotation.Rotate180: filter = "hflip,vflip"; break; case MediaObjectRotation.Rotate270: filter = "transpose=cclock"; break; } return(ApplyCommaToRotationFilter(filter, encoderArguments)); }
private static double GetRotationInDegrees(MediaObjectRotation rotation) { switch (rotation) { case MediaObjectRotation.Rotate0: return(0); case MediaObjectRotation.Rotate90: return(90); case MediaObjectRotation.Rotate180: return(180); case MediaObjectRotation.Rotate270: return(270); default: return(0); } }
private static double GetRotationInDegrees(MediaObjectRotation rotation) { switch (rotation) { case MediaObjectRotation.Rotate0: return 0; case MediaObjectRotation.Rotate90: return 90; case MediaObjectRotation.Rotate180: return 180; case MediaObjectRotation.Rotate270: return 270; default: return 0; } }
/// <summary> /// Gets the rotation filter corresponding to the requested rotation amount. Returns an empty string when /// no rotation is requested. /// </summary> /// <param name="rotation">The amount of rotation being requested.</param> /// <param name="encoderArguments"></param> /// <returns>System.String.</returns> /// <remarks>Documentation: http://ffmpeg.org/ffmpeg-filters.html#transpose, http://ffmpeg.org/ffmpeg-filters.html#hflip, /// http://ffmpeg.org/ffmpeg-filters.html#vflip</remarks> private static string GetAutoRotationFilter(MediaObjectRotation rotation, string encoderArguments) { var filter = String.Empty; if (!encoderArguments.Contains(AutoRotateFilterName)) return filter; switch (rotation) { case MediaObjectRotation.Rotate90: filter = "transpose=clock"; break; case MediaObjectRotation.Rotate180: filter = "hflip,vflip"; break; case MediaObjectRotation.Rotate270: filter = "transpose=cclock"; break; } return ApplyCommaToRotationFilter(filter, encoderArguments); }