ca.carleton.gcrc.olkit.multimedia.converter.threshold.DefaultThresholdVideo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nunaliit2-multimedia Show documentation
Show all versions of nunaliit2-multimedia Show documentation
Library that converts multimedia files using command
line tools such as avconv and ImageMagick
package ca.carleton.gcrc.olkit.multimedia.converter.threshold;
import ca.carleton.gcrc.olkit.multimedia.converter.MultimediaConversionThreshold;
public class DefaultThresholdVideo implements MultimediaConversionThreshold {
@Override
public boolean isConversionRequired(
String videoFormat
,Long videoRate
,String audioFormat
,Long audioRate
,Long imageWidth
,Long imageHeight
) {
if( null == videoRate ) {
return true;
} else if( videoRate.longValue() > 250000 ) {
return true;
}
if( false == "h264".equals( videoFormat ) ) {
return true;
}
if( false == "mpeg4aac".equals( audioFormat ) ) {
return true;
}
return false;
}
@Override
public boolean isResizeRequired(Long imageWidth, Long imageHeight) {
return false;
}
public String toString() {
return this.getClass().getSimpleName();
}
}