Skip to content

Commit 5a10406

Browse files
authored
Merge pull request #140 from brarcher/vp9
VP9 video codec support support for MKV and WebM
2 parents b089864 + 55f9d7a commit 5a10406

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

app/src/main/java/protect/videotranscoder/media/MediaContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public enum MediaContainer
1515
// Video and audio:
1616
AVI("avi", "avi", "video/avi", Arrays.asList(VideoCodec.AVI), Arrays.asList(AudioCodec.MP3)),
1717
FLV("flv", "flv", "video/x-flv", Collections.singletonList(VideoCodec.H264), Arrays.asList(AudioCodec.AAC, AudioCodec.MP3, AudioCodec.NONE)),
18-
MKV("matroska", "mkv", "video/x-matroska", Arrays.asList(VideoCodec.H264, VideoCodec.MPEG4, VideoCodec.MPEG2, VideoCodec.MPEG1), Arrays.asList(AudioCodec.AAC, AudioCodec.MP3, AudioCodec.OPUS, AudioCodec.NONE)),
18+
MKV("matroska", "mkv", "video/x-matroska", Arrays.asList(VideoCodec.H264, VideoCodec.MPEG4, VideoCodec.MPEG2, VideoCodec.MPEG1, VideoCodec.VP8, VideoCodec.VP9), Arrays.asList(AudioCodec.AAC, AudioCodec.MP3, AudioCodec.OPUS, AudioCodec.NONE)),
1919
MP4("mp4", "mp4", "video/mp4", Arrays.asList(VideoCodec.H264, VideoCodec.MPEG4, VideoCodec.MPEG2, VideoCodec.MPEG1), Arrays.asList(AudioCodec.AAC, AudioCodec.MP3, AudioCodec.NONE)),
20-
WEBM("webm", "webm", "video/webm", Arrays.asList(VideoCodec.VP8), Arrays.asList(AudioCodec.OPUS, AudioCodec.VORBIS, AudioCodec.NONE)),
20+
WEBM("webm", "webm", "video/webm", Arrays.asList(VideoCodec.VP8, VideoCodec.VP9), Arrays.asList(AudioCodec.OPUS, AudioCodec.VORBIS, AudioCodec.NONE)),
2121
GIF("gif", "gif", "image/gif", Arrays.asList(VideoCodec.GIF), Collections.EMPTY_LIST),
2222

2323
// Audio only

app/src/main/java/protect/videotranscoder/media/VideoCodec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public enum VideoCodec
2424
MPEG2("mpeg2video", "MPEG-2", Collections.EMPTY_LIST, R.string.codecFastOk),
2525
MPEG1("mpeg1video", "MPEG-1", Collections.EMPTY_LIST, R.string.codecFastLow),
2626
VP8("libvpx", "VP8", Collections.EMPTY_LIST, null),
27+
VP9("libvpx-vp9", "VP9", Collections.EMPTY_LIST, null),
2728
GIF("gif", "GIF", Collections.EMPTY_LIST, null),
2829
;
2930

app/src/test/shell/test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,11 @@ def verifyAudioStream(test, stream):
284284
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "avi", "avi", "avi", "mpeg4", "mpeg4", "2000", "360x240", "19", "mp3", "mp3", "22050", "100", "2"))
285285
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "mp4", "mp4", "mp4", "h264", "h264", "2000", "360x240", "19", "aac", "aac", "22050", "100", "2"))
286286
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "matroska", "matroska", "mkv", "h264", "h264", "2000", "180x120", "24", "aac", "aac", "22050", "50", "1"))
287+
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "matroska", "matroska", "mkv", "libvpx", "vp8", "2000", "180x120", "24", "aac", "aac", "22050", "50", "1"))
288+
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "matroska", "matroska", "mkv", "libvpx-vp9", "vp9", "2000", "180x120", "24", "aac", "aac", "22050", "50", "1"))
287289
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "flv", "flv", "flv", "h264", "h264", "2000", "180x120", "24", "aac", "aac", "22050", "50", "1"))
288290
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "webm", "webm", "webm", "libvpx", "vp8", "2000", "180x120", "24", "vorbis", "vorbis", "22050", "50", "2"))
291+
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "webm", "webm", "webm", "libvpx-vp9", "vp9", "2000", "180x120", "24", "vorbis", "vorbis", "22050", "50", "2"))
289292
videoTests.append(VideoTest("SampleVideo_360x240_1mb.mp4", "gif", "gif", "gif", "gif", "gif", "2000", "360x240", "10", None, None, None, None, None))
290293

291294
# AudioTest = collections.namedtuple("AudioTest", ["filename", "mediaContainer", "formatName", "extension", "audioCodec", "audioCodecName", "audioSampleRate", "audioBitrateK", "audioChannel"])

0 commit comments

Comments
 (0)