001package net.bramp.ffmpeg.options; 002 003import java.beans.ConstructorProperties; 004import org.apache.commons.lang3.math.Fraction; 005 006/** 007 * Encoding options for video. 008 * 009 * @author bramp 010 */ 011public class VideoEncodingOptions { 012 /** 013 * Whether encoding is enabled. 014 * 015 * @deprecated Use {@link #isEnabled()} instead. 016 */ 017 @Deprecated public final boolean enabled; 018 019 /** 020 * The codec name. 021 * 022 * @deprecated Use {@link #getCodec()} instead. 023 */ 024 @Deprecated public final String codec; 025 026 /** 027 * The video frame rate. 028 * 029 * @deprecated Use {@link #getFrameRate()} instead. 030 */ 031 @Deprecated public final Fraction frame_rate; 032 033 /** 034 * The video width in pixels. 035 * 036 * @deprecated Use {@link #getWidth()} instead. 037 */ 038 @Deprecated public final int width; 039 040 /** 041 * The video height in pixels. 042 * 043 * @deprecated Use {@link #getHeight()} instead. 044 */ 045 @Deprecated public final int height; 046 047 /** 048 * The bit rate. 049 * 050 * @deprecated Use {@link #getBitRate()} instead. 051 */ 052 @Deprecated public final long bit_rate; 053 054 /** 055 * The number of video frames to encode. 056 * 057 * @deprecated Use {@link #getFrames()} instead. 058 */ 059 @Deprecated public final Integer frames; 060 061 /** 062 * The video filter string. 063 * 064 * @deprecated Use {@link #getFilter()} instead. 065 */ 066 @Deprecated public final String filter; 067 068 /** 069 * The encoding preset. 070 * 071 * @deprecated Use {@link #getPreset()} instead. 072 */ 073 @Deprecated public final String preset; 074 075 /** Constructs video encoding options with the specified parameters. */ 076 @ConstructorProperties({ 077 "enabled", 078 "codec", 079 "frame_rate", 080 "width", 081 "height", 082 "bit_rate", 083 "frames", 084 "video_filter", 085 "preset" 086 }) 087 public VideoEncodingOptions( 088 boolean enabled, 089 String codec, 090 Fraction frame_rate, 091 int width, 092 int height, 093 long bit_rate, 094 Integer frames, 095 String filter, 096 String preset) { 097 this.enabled = enabled; 098 this.codec = codec; 099 this.frame_rate = frame_rate; 100 this.width = width; 101 this.height = height; 102 this.bit_rate = bit_rate; 103 this.frames = frames; 104 this.filter = filter; 105 this.preset = preset; 106 } 107 108 public boolean isEnabled() { 109 return enabled; 110 } 111 112 public String getCodec() { 113 return codec; 114 } 115 116 public Fraction getFrameRate() { 117 return frame_rate; 118 } 119 120 public int getWidth() { 121 return width; 122 } 123 124 public int getHeight() { 125 return height; 126 } 127 128 public long getBitRate() { 129 return bit_rate; 130 } 131 132 public Integer getFrames() { 133 return frames; 134 } 135 136 public String getFilter() { 137 return filter; 138 } 139 140 public String getPreset() { 141 return preset; 142 } 143}