videoclip/README.md

71 lines
2.2 KiB
Markdown
Raw Normal View History

2020-08-21 04:16:38 +00:00
# videoclip
2020-08-21 04:26:24 +00:00
Easily create videoclips with mpv in a few keypresses.
2020-08-21 05:04:26 +00:00
## Requirements
* A [distribution](https://www.gnu.org/distros/free-distros.html) of
[GNU/Linux](https://www.gnu.org/gnu/about-gnu.html)
* [FFmpeg](https://wiki.archlinux.org/index.php/FFmpeg)
2020-08-21 04:26:24 +00:00
## Installation
### Install as a part of your [dotfiles](https://wiki.archlinux.org/index.php/Dotfiles#Tracking_dotfiles_directly_with_Git)
```
$ config submodule add 'https://github.com/Ajatt-Tools/videoclip.git' ~/.config/mpv/scripts/videoclip
```
### Install by cloning the repo
```
$ git clone 'https://github.com/Ajatt-Tools/videoclip.git' ~/.config/mpv/scripts/videoclip
```
2020-08-21 07:17:40 +00:00
### Enable the addon
After you've downloaded the addon, open or create ```~/.config/mpv/scripts/modules.lua``` and add these lines:
2020-08-21 04:26:24 +00:00
```
local mpv_scripts_dir_path = os.getenv("HOME") .. "/.config/mpv/scripts/"
function load(relative_path) dofile(mpv_scripts_dir_path .. relative_path) end
load("videoclip/videoclip.lua")
```
2020-08-21 04:28:58 +00:00
## Updating
Submodules are updated using standard git commands:
```
$ config submodule update --remote --merge
```
or
```
$ cd ~/.config/mpv/scripts/videoclip && git pull
```
2020-08-21 04:41:10 +00:00
## Configuration
Configuration file is located at ```~/.config/mpv/script-opts/videoclip.conf```
and should be created by the user. If a parameter is not specified
in the config file, the default value will be used.
Example configuration file:
```
# Absolute path to the folder where generated clips will be placed.
# `~` or `$HOME` are not supported due to mpv limitations.
media_path=/home/user/Videos
# Menu size
font_size=20
# Sane values are from 16k to 32k.
audio_bitrate=32k
# The range of the scale is 051, where 0 is lossless,
# 23 is the default, and 51 is worst quality possible.
2020-08-21 04:44:43 +00:00
video_quality=23
2020-08-21 04:41:10 +00:00
# Use the slowest preset that you have patience for.
# https://trac.ffmpeg.org/wiki/Encode/H.264
2020-08-21 04:44:43 +00:00
preset=faster
2020-08-21 04:41:10 +00:00
# Video dimensions
2020-08-21 04:44:43 +00:00
video_width=-2
video_height=480
2020-08-21 04:41:10 +00:00
```
Key bindings are configured in ```~/.config/mpv/input.conf```.
This step is not necessary.
```
c script-binding menu-open
```
2020-08-21 04:59:41 +00:00
## Usage
- Open a file in mpv and press `c` to open the script menu.
2020-08-21 05:01:25 +00:00
- Follow the onscreen instructions. You need to set the `start point`, `end point`, and then press `c` to create the clip.