video_format and mute_audio config options

This commit is contained in:
Ren Tatsumoto 2020-10-23 16:17:08 +03:00
parent e33b310682
commit 3088d4b061

View file

@ -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