update readme

This commit is contained in:
Ren Tatsumoto 2021-04-14 23:23:27 +03:00
parent cc191c6d91
commit 3ad98dab5f

View file

@ -2,19 +2,24 @@
# videoclip
[![Chat](https://img.shields.io/badge/chat-join-green)](https://tatsumoto-ren.github.io/blog/join-our-community.html)
![GitHub](https://img.shields.io/github/license/Ajatt-Tools/videoclip)
![GitHub top language](https://img.shields.io/github/languages/top/Ajatt-Tools/videoclip)
![Lines of code](https://img.shields.io/tokei/lines/github/Ajatt-Tools/videoclip)
[![Matrix](https://img.shields.io/badge/Japanese_study_room-join-green.svg)](https://app.element.io/#/room/#djt:g33k.se)
Easily create video and audio clips with mpv in a few keypresses.
Videoclips are saved as `.mp4` or `.webm`.
Subtitles can be embedded into the clips.
## Installation
### Manually
Save [videoclip.lua](https://raw.githubusercontent.com/Ajatt-Tools/videoclip/master/videoclip.lua)
in the [mpv scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts) folder:
Download
[the repository](https://github.com/Ajatt-Tools/videoclip/archive/refs/heads/master.zip)
and extract the folder containing
`videoclip.lua`
to your [mpv scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts) directory:
| OS | Location |
| --- | --- |
@ -25,27 +30,28 @@ Note: in [Celluloid](https://www.archlinux.org/packages/community/x86_64/cellulo
user scripts are installed by switching to the "Plugins" tab
in the preferences dialog and dropping the files there.
### Using curl
```
$ curl -o ~/.config/mpv/scripts/videoclip.lua 'https://raw.githubusercontent.com/Ajatt-Tools/videoclip/master/videoclip.lua'
```
### Using git
If you already have your dotfiles set up according to
[Arch Wiki recommendations](https://wiki.archlinux.org/index.php/Dotfiles#Tracking_dotfiles_directly_with_Git), execute:
```
$ config submodule add 'https://github.com/Ajatt-Tools/videoclip.git' ~/.config/mpv/scripts/videoclip
```
If not, either proceed to Arch Wiki and come back when you're done, or simply clone the repo:
```
$ git clone 'https://github.com/Ajatt-Tools/videoclip.git' ~/.config/mpv/scripts/videoclip
```
### Updating with git
| Install method | Command |
| --- | --- |
| Submodules | `$ config submodule update --remote --merge` |
| Plain git | `$ cd ~/.config/mpv/scripts/videoclip && git pull` |
## Configuration
The config file should be created by the user, if needed.
| OS | Config location |
@ -57,6 +63,7 @@ If a parameter is not specified in the config file, the default value will be us
mpv doesn't tolerate spaces before and after `=`.
Example configuration file:
```
# Absolute paths to the folders where generated clips will be placed.
# `~` or `$HOME` are not supported due to mpv limitations.
@ -85,7 +92,11 @@ preset=faster
audio_bitrate=32k
# Create silent videoclips by default. Possble values: `yes` or `no`.
mute_audio=yes
# Burn subtitles into the video, if present. `yes` or `no`.
embed_subs=yes
```
### Key bindings
| OS | Config location |
@ -94,10 +105,13 @@ mute_audio=yes
| Windows | `C:/Users/Username/AppData/Roaming/mpv/input.conf` |
Add this line if you want to change the key that opens the script's menu.
```
c script-binding videoclip-menu-open
```
## Usage
- Open a file in mpv and press `c` to open the script menu.
- Follow the onscreen instructions. You need to set the `start point`,
`end point`, and then press `c` to create the clip.