Skip to content

Commit

Permalink
Enable x-msvideo conversion (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob93c authored Nov 30, 2024
1 parent a6217cf commit 5f5a90f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class MediaHelper {
static final ProcessLocator FFMPEG_LOCATOR = new PathLocator();
private static final int PRESERVE_ASPECT_RATIO = -2;
private static final List<String> SUPPORTED_VIDEOS = List.of("image/gif", "video/quicktime", "video/webm",
"video/mp4", "video/x-m4v", "application/x-matroska");
"video/mp4", "video/x-m4v", "application/x-matroska", "video/x-msvideo");

/**
* Based on the type of passed-in file, it converts it into the proper media.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ void convertGifVideo() throws Exception {
assertVideoConsistency(result, 512, 274, 10F, 1_000L);
}

@Test
void convertAviVideo() throws Exception {
var aviVideo = loadResource("valid.avi");
var result = MediaHelper.convert(aviVideo);

assertVideoConsistency(result, 512, 512, 30F, 3_000L);
}

@Test
void noVideoConversionNeeded() throws Exception {
var webmVideo = loadResource("no_conversion_needed.webm");
Expand Down Expand Up @@ -319,6 +327,14 @@ void concurrentWebmVideoConversions() {
executeConcurrentConversionsOf(webmVideo);
}

@Test
@DisplayName("avi videos")
void concurrentAviVideoConversions() {
var aviVideo = loadResource("valid.avi");

executeConcurrentConversionsOf(aviVideo);
}

@Test
@DisplayName("gif videos")
void concurrentGifVideoConversions() {
Expand Down
Binary file added src/test/resources/valid.avi
Binary file not shown.

0 comments on commit 5f5a90f

Please sign in to comment.