~heckyel/librevideoconverter

809cab455c2d2c19dd78df87f023419674a23cd4 — Jesús 1 year, 4 months ago 0e4495f
Improve test
2 files changed, 55 insertions(+), 4 deletions(-)

M lvc/basicconverters.py
M test/test_converter.py
M lvc/basicconverters.py => lvc/basicconverters.py +2 -2
@@ 66,8 66,8 @@ class OggVorbis(converter.FFmpegConverterInfo):
class OggTheora(converter.FFmpegConverterInfo):
    media_type = 'format'
    extension = 'ogv'
    parameters = ('-f ogg -codec:v libtheora -qscale:v 7 -codec:a libvorbis '
                  '-qscale:a 5 -map_metadata -1')
    parameters = ('-f ogg -vcodec libtheora -acodec libvorbis '
                  '-qscale:v 7 -qscale:a 5 -map_metadata -1')


class DNxHD_1080(converter.FFmpegConverterInfo1080p):

M test/test_converter.py => test/test_converter.py +53 -2
@@ 31,9 31,13 @@ def make_ffmpeg_arg_parser():
        "-i",
        "-lag-in-frames",
        "-level",
        "-map_metadata",
        "-maxrate",
        "-preset",
        "-profile:v",
        "-qscale:a",
        "-qscale:v",
        "-quality",
        "-r",
        "-s",
        "-slices",


@@ 388,7 392,7 @@ class TestConverterDefinitions(base.Test):

    def test_mp4(self):
        self.check_ffmpeg_arguments('mp4', {
            'ab': '96k',
            'ab': '128k',
            'acodec': 'aac',
            'crf': '22',
            'f': 'mp4',


@@ 398,6 402,7 @@ class TestConverterDefinitions(base.Test):
            's': '542x320',
            'strict': 'experimental',
            'vcodec': 'libx264',
            'map_metadata': '-1',
        })
        self.check_uses_input_size('mp4')



@@ 788,6 793,7 @@ class TestConverterDefinitions(base.Test):
            'strict': 'experimental',
            'vcodec': 'libvpx',
            'vprofile': '0',
            'map_metadata': '-1',
        })
        self.check_size('webmhd', 1080, 720)



@@ 1040,9 1046,52 @@ class TestConverterDefinitions(base.Test):
            'strict': 'experimental',
            'vcodec': 'libvpx',
            'vprofile': '0',
            'map_metadata': '-1',
        })
        self.check_size('webmsd', 720, 480)

    def test_webmvp9(self):
        self.check_ffmpeg_arguments('webmvp9', {
            'acodec': 'libopus',
            'vcodec': 'libvpx-vp9',
            '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('webmvp9')

    def test_webmuhd(self):
        self.check_ffmpeg_arguments('webmuhd', {
            'ab': '128k',
            'acodec': 'libvorbis',
            'ar': '44100',
            'b:v': '4M',
            'cpu_used': '0',
            'deadline': 'good',
            'f': 'webm',
            'g': '120',
            'i': self.input_path,
            'lag_in_frames': '23',
            'map_metadata': '-1',
            'output_file': self.output_path,
            'qmax': '51',
            'qmin': '11',
            's': '542x320',
            'slices': '4',
            'strict': 'experimental',
            'vcodec': 'libvpx',
            'vprofile': '0'
        })
        self.check_size('webmuhd', 1920, 1080)

    def test_galaxymini(self):
        self.check_ffmpeg_arguments('galaxymini', {
            'ab': '160k',


@@ 1086,13 1135,15 @@ class TestConverterDefinitions(base.Test):
    def test_oggtheora(self):
        self.check_ffmpeg_arguments('oggtheora', {
            'acodec': 'libvorbis',
            'aq': '60',
            'f': 'ogg',
            'i': self.input_path,
            'output_file': self.output_path,
            's': '542x320',
            'strict': 'experimental',
            'vcodec': 'libtheora',
            'qscale:v': '7',
            'qscale:a': '5',
            'map_metadata': '-1',
        })
        self.check_uses_input_size('oggtheora')