From 92152b9ee059d322629ccbba269bc6af998eabfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 2 Jun 2020 19:42:57 -0500 Subject: [PATCH] Add WebM VP8 --- lvc/basicconverters.py | 20 +++++++++++++++++++- test/test_converter.py | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/lvc/basicconverters.py b/lvc/basicconverters.py index 2390282..807021f 100644 --- a/lvc/basicconverters.py +++ b/lvc/basicconverters.py @@ -41,6 +41,14 @@ class WebM_VP9(converter.FFmpegConverterInfo): '-b:v 0 -acodec libopus -map_metadata -1') +class WebM_VP8(converter.FFmpegConverterInfo): + media_type = 'format' + extension = 'webm' + parameters = ('-f webm -vcodec libvpx -g 240 -threads 8 ' + '-quality good -crf 32 ' + '-b:v 0 -acodec libvorbis -map_metadata -1') + + class MP4(converter.FFmpegConverterInfo): media_type = 'format' extension = 'mp4' @@ -150,10 +158,20 @@ webm_uhd = WebM_UHD('WebM UHD') webm_hd = WebM_HD('WebM HD') webm_sd = WebM_SD('WebM SD') webm_vp9 = WebM_VP9('WebM VP9') +webm_vp8 = WebM_VP8('WebM VP8') mp4 = MP4('MP4') theora = OggTheora('Ogg Theora') -video_formats = ('Video', [webm_uhd, webm_hd, webm_sd, webm_vp9, mp4, theora]) +video_formats = ('Video', + [ + webm_uhd, + webm_hd, + webm_sd, + webm_vp9, + webm_vp8, + mp4, + theora + ]) dnxhd_1080 = DNxHD_1080('DNxHD 1080p') dnxhd_720 = DNxHD_720('DNxHD 720p') diff --git a/test/test_converter.py b/test/test_converter.py index 1ecf786..6033d32 100644 --- a/test/test_converter.py +++ b/test/test_converter.py @@ -1068,6 +1068,24 @@ class TestConverterDefinitions(base.Test): }) self.check_uses_input_size('webmvp9') + def test_webmvp8(self): + self.check_ffmpeg_arguments('webmvp8', { + 'acodec': 'libvorbis', + 'vcodec': 'libvpx', + 'b:v': '0', + 'g': '240', + 'crf': '32', + 'f': 'webm', + 'i': self.input_path, + 'output_file': self.output_path, + 'quality': 'good', + 's': '542x320', + 'strict': 'experimental', + 'threads': '8', + 'map_metadata': '-1', + }) + self.check_uses_input_size('webmvp8') + def test_webmuhd(self): self.check_ffmpeg_arguments('webmuhd', { 'ab': '128k', -- 2.38.5