From 3088d4b06167c0716add6f5064dd4662b41f21a6 Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Fri, 23 Oct 2020 16:17:08 +0300 Subject: [PATCH] video_format and mute_audio config options --- videoclip.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/videoclip.lua b/videoclip.lua index 9e3d510..baf1ad8 100644 --- a/videoclip.lua +++ b/videoclip.lua @@ -24,6 +24,8 @@ local config = { video_width = -2, video_height = 480, + video_format = 'mp4', -- webm or mp4 + mute_audio = false, } mpopt.read_options(config, 'videoclip') @@ -111,6 +113,16 @@ local function subprocess(args) } end +local function set_video_settings() + if config.video_format == 'mp4' then + config.video_codec = 'libx264' + config.video_extension = '.mp4' + else + config.video_codec = 'libvpx-vp9' + config.video_extension = '.webm' + end +end + ------------------------------------------------------------ -- provides interface for creating audio/video clips @@ -407,6 +419,8 @@ if not allowed_presets[config.preset] then config.preset = 'faster' end +set_video_settings() + ------------------------------------------------------------ -- Finally, set an 'entry point' in mpv