use of oap.media.postprocessing.VastMediaProcessing in project oap by oaplatform.
the class WsFileUploaderTest method beforeMethod.
@BeforeMethod
@Override
public void beforeMethod() throws Exception {
Env.resetPorts();
super.beforeMethod();
kernel = new Kernel(Lists.empty());
kernel.start();
path = Env.tmpPath("/tmp");
Files.ensureDirectory(path);
medias.clear();
server = new Server(100);
ws = new WebServices(server, new SessionManager(10, null, "/"), GenericCorsPolicy.DEFAULT, WsConfig.CONFIGURATION.fromResource(getClass(), "ws-multipart.conf"));
WsFileUploader service = new WsFileUploader(path, 1024 * 1024, -1, singletonList(new VastMediaProcessing(shell("ffprobe -v quiet -print_format xml -show_format -sexagesimal -show_streams {FILE}"), 10000L)));
service.addListener((media, mediaInfo, mediaContext) -> WsFileUploaderTest.this.medias.add(__(media, mediaInfo)));
kernel.register("upload", service);
ws.start();
listener = new SynchronizedThread(new PlainHttpListener(server, Env.port()));
listener.start();
Cuid.reset("p", 1);
}
Aggregations