~heckyel/librevideoconverter

92152b9ee059d322629ccbba269bc6af998eabfd — Jesús 3 years ago 809cab4
Add WebM VP8
2 files changed, 37 insertions(+), 1 deletions(-)

M lvc/basicconverters.py
M test/test_converter.py
M lvc/basicconverters.py => lvc/basicconverters.py +19 -1
@@ 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')

M test/test_converter.py => test/test_converter.py +18 -0
@@ 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',