Skip to content

Commit 5f5a90f

Browse files
authored
Enable x-msvideo conversion (#304)
1 parent a6217cf commit 5f5a90f

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/main/java/com/github/stickerifier/stickerify/media/MediaHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public final class MediaHelper {
5353
static final ProcessLocator FFMPEG_LOCATOR = new PathLocator();
5454
private static final int PRESERVE_ASPECT_RATIO = -2;
5555
private static final List<String> SUPPORTED_VIDEOS = List.of("image/gif", "video/quicktime", "video/webm",
56-
"video/mp4", "video/x-m4v", "application/x-matroska");
56+
"video/mp4", "video/x-m4v", "application/x-matroska", "video/x-msvideo");
5757

5858
/**
5959
* Based on the type of passed-in file, it converts it into the proper media.

src/test/java/com/github/stickerifier/stickerify/media/MediaHelperTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ void convertGifVideo() throws Exception {
215215
assertVideoConsistency(result, 512, 274, 10F, 1_000L);
216216
}
217217

218+
@Test
219+
void convertAviVideo() throws Exception {
220+
var aviVideo = loadResource("valid.avi");
221+
var result = MediaHelper.convert(aviVideo);
222+
223+
assertVideoConsistency(result, 512, 512, 30F, 3_000L);
224+
}
225+
218226
@Test
219227
void noVideoConversionNeeded() throws Exception {
220228
var webmVideo = loadResource("no_conversion_needed.webm");
@@ -319,6 +327,14 @@ void concurrentWebmVideoConversions() {
319327
executeConcurrentConversionsOf(webmVideo);
320328
}
321329

330+
@Test
331+
@DisplayName("avi videos")
332+
void concurrentAviVideoConversions() {
333+
var aviVideo = loadResource("valid.avi");
334+
335+
executeConcurrentConversionsOf(aviVideo);
336+
}
337+
322338
@Test
323339
@DisplayName("gif videos")
324340
void concurrentGifVideoConversions() {

src/test/resources/valid.avi

14.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)