Changeset 94
- Timestamp:
- 04/14/06 17:59:25 (3 years ago)
- Files:
-
- trunk/src/Makefile.am (modified) (2 diffs)
- trunk/src/gnu (copied) (copied from trunk/src/gnu)
- trunk/src/gnu/regexp/MessagesBundle_fr.properties (deleted)
- trunk/src/org/thestaticvoid/iriverter/Converter.java (modified) (4 diffs)
- trunk/src/org/thestaticvoid/iriverter/Profile.java (modified) (1 diff)
- trunk/src/profiles/ipod.profile (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/Makefile.am
r89 r94 73 73 org/thestaticvoid/iriverter/icons/singlevideo-16.png 74 74 75 iriverter_resources = \ 76 gnu/regexp/MessagesBundle.properties 77 75 78 if !BUILD_GCJ 76 79 iriverter_jardir = $(pkgdatadir)/lib … … 91 94 92 95 iriverter.jar: $(iriverter_jar_class_files) 93 $(JAR) cf $@ $(all_iriverter_jar_class_files) $(iriverter_icons) 96 $(JAR) cf $@ $(all_iriverter_jar_class_files) $(iriverter_icons) $(iriverter_resources) 94 97 95 98 swt.jar: $(SWT_JAR) trunk/src/org/thestaticvoid/iriverter/Converter.java
r87 r94 175 175 176 176 private List prepareBaseCommandList(String inputVideo, String outputVideo, MPlayerInfo info) { 177 int scaledWidth = converterOptions.getDimensions().getWidth();178 int scaledHeight = (info.getDimensions().getHeight() * converterOptions.getDimensions().getWidth()) / info.getDimensions().getWidth();179 180 if (scaledHeight > converterOptions.getDimensions().getHeight()) {181 scaledWidth = (scaledWidth * converterOptions.getDimensions().getHeight()) / scaledHeight;182 scaledHeight = converterOptions.getDimensions().getHeight();183 }184 185 double ofps = (info.getFrameRate() > converterOptions.getCurrentProfile().getMaxFrameRate() ? converterOptions.getCurrentProfile().getMaxFrameRate() : info.getFrameRate());186 187 String vf = "filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(ofps * 1000));188 if (converterOptions.getPanAndScan())189 vf += ",scale=" + ((int) ((info.getDimensions().getWidth()) * (((double) converterOptions.getDimensions().getHeight()) / (double) info.getDimensions().getHeight()))) + ":" + converterOptions.getDimensions().getHeight() + ",crop=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight();190 else191 vf += ",scale=" + scaledWidth + ":" + scaledHeight + ",expand=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight();192 vf += ",harddup";193 194 String af = "";195 if (converterOptions.getVolumeFilter() == VolumeFilter.VOLNORM)196 af = "volnorm," + af;197 if (converterOptions.getVolumeFilter() == VolumeFilter.VOLUME)198 af = "volume=" + converterOptions.getGain() + "," + af;199 200 177 List commandList = new ArrayList(); 201 178 202 179 commandList.add(MPlayerInfo.getMPlayerPath() + "mencoder"); 180 203 181 commandList.add(inputVideo); 182 commandList.add("-o"); 183 commandList.add(outputVideo); 204 184 205 185 if (converterOptions.getCurrentProfile().getWrapperFormat().equals("mp4")) { … … 208 188 commandList.add("-lavfopts"); 209 189 commandList.add("format=mp4:i_certify_that_my_video_stream_does_not_use_b_frames"); 190 } 191 192 commandList.add("-ovc"); 193 if (converterOptions.getCurrentProfile().getVideoFormat().equals("h264")) { 194 commandList.add("x264"); 195 commandList.add("-x264encopts"); 196 commandList.add("bitrate=" + converterOptions.getVideoBitrate() + ":bframes=0:level_idc=13:nocabac"); 210 197 } else { 198 commandList.add("xvid"); 199 commandList.add("-xvidencopts"); 200 commandList.add("bitrate=" + converterOptions.getVideoBitrate() + ":max_bframes=0:profile=sp0"); 211 201 commandList.add("-ffourcc"); 212 commandList.add("XVID"); 213 } 214 215 commandList.add("-o"); 216 commandList.add(outputVideo); 217 commandList.add("-ovc"); 218 commandList.add("xvid"); 219 commandList.add("-xvidencopts"); 220 commandList.add("bitrate=" + converterOptions.getVideoBitrate() + ":max_bframes=0"); 202 commandList.add("DX50"); 203 } 204 221 205 commandList.add("-oac"); 222 206 if (converterOptions.getCurrentProfile().getAudioFormat().equals("aac")) { 223 207 commandList.add("faac"); 224 208 commandList.add("-faacopts"); 225 commandList.add("br=" + converterOptions.getAudioBitrate() );209 commandList.add("br=" + converterOptions.getAudioBitrate() + ":object=1"); 226 210 } else { 227 211 commandList.add("mp3lame"); … … 229 213 commandList.add("mode=2:cbr:br=" + converterOptions.getAudioBitrate()); 230 214 } 215 216 double ofps = (info.getFrameRate() > converterOptions.getCurrentProfile().getMaxFrameRate() ? converterOptions.getCurrentProfile().getMaxFrameRate() : info.getFrameRate()); 231 217 commandList.add("-vf"); 232 commandList.add(vf); 233 234 if (!af.equals("")) { 218 commandList.add("filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(ofps * 1000))); 219 220 int scaledWidth = converterOptions.getDimensions().getWidth(); 221 int scaledHeight = (info.getDimensions().getHeight() * converterOptions.getDimensions().getWidth()) / info.getDimensions().getWidth(); 222 223 if (scaledHeight > converterOptions.getDimensions().getHeight()) { 224 scaledWidth = (scaledWidth * converterOptions.getDimensions().getHeight()) / scaledHeight; 225 scaledHeight = converterOptions.getDimensions().getHeight(); 226 } 227 228 commandList.add("-vf-add"); 229 if (converterOptions.getPanAndScan()) 230 commandList.add("scale=" + ((int) ((info.getDimensions().getWidth()) * (((double) converterOptions.getDimensions().getHeight()) / (double) info.getDimensions().getHeight()))) + ":" + converterOptions.getDimensions().getHeight() + ",crop=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight()); 231 else 232 commandList.add("scale=" + scaledWidth + ":" + scaledHeight + ",expand=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight()); 233 234 commandList.add("-vf-add"); 235 commandList.add("harddup"); 236 237 if (converterOptions.getVolumeFilter() == VolumeFilter.VOLNORM) { 235 238 commandList.add("-af"); 236 commandList.add(af); 239 commandList.add("volnorm"); 240 } else if (converterOptions.getVolumeFilter() == VolumeFilter.VOLUME) { 241 commandList.add("-af"); 242 commandList.add("volume=" + converterOptions.getGain()); 237 243 } 238 244 … … 243 249 244 250 if (!converterOptions.getAutoSync()) { 245 commandList.add("-mc");246 commandList.add("0");247 248 int offset = converterOptions.getAudioDelay();249 251 commandList.add("-delay"); 250 commandList.add("" + ( offset/ 1000.0));252 commandList.add("" + (converterOptions.getAudioDelay() / 1000.0)); 251 253 } 252 254 trunk/src/org/thestaticvoid/iriverter/Profile.java
r90 r94 95 95 } 96 96 97 public String getVideoFormat() { 98 String videoFormat = readOption("videoFormat"); 99 if (videoFormat.equals("")) 100 return "mpeg4"; 101 102 return videoFormat; 103 } 104 97 105 public String getAudioFormat() { 98 106 String audioFormat = readOption("audioFormat"); trunk/src/profiles/ipod.profile
r90 r94 1 1 brand=Apple 2 2 device=iPod 5G 3 maxVideoBitrate= 25003 maxVideoBitrate=768 4 4 maxAudioBitrate=160 5 5 dimensions=320x240 6 6 maxFrameRate=30 7 7 wrapperFormat=mp4 8 videoFormat=h264 8 9 audioFormat=aac
