mirror of https://github.com/mifi/lossless-cut
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
3.2 KiB
Markdown
71 lines
3.2 KiB
Markdown
|
4 years ago
|
# Command line interface (CLI)
|
||
|
|
|
||
|
6 months ago
|
LosslessCut has basic support for automation through the CLI. See also [HTTP API](api.md).
|
||
|
3 years ago
|
|
||
|
|
```bash
|
||
|
|
LosslessCut [options] [files]
|
||
|
|
```
|
||
|
|
|
||
|
|
Note that these examples assume that you have set up the LosslessCut executable to be available in your `PATH` (command line environment). Alternatively you can run it like this:
|
||
|
|
|
||
|
4 years ago
|
```bash
|
||
|
|
# First navigate to the folder containing the LosslessCut app
|
||
|
|
cd /path/to/directory/containing/app
|
||
|
3 years ago
|
# Then run it
|
||
|
4 years ago
|
# On Linux:
|
||
|
|
./LosslessCut arguments
|
||
|
|
# On Windows:
|
||
|
|
./LosslessCut.exe arguments
|
||
|
|
# On MacOS:
|
||
|
|
./LosslessCut.app/Contents/MacOS/LosslessCut arguments
|
||
|
|
```
|
||
|
|
|
||
|
1 year ago
|
Note that some users have reported that the Windows Store version of LosslessCut needs an [app execution alias](https://github.com/mifi/lossless-cut/issues/1136).
|
||
|
|
|
||
|
4 years ago
|
## Open one or more files:
|
||
|
|
```bash
|
||
|
|
LosslessCut file1.mp4 file2.mkv
|
||
|
|
```
|
||
|
|
|
||
|
6 months ago
|
## Override settings (experimental) 🧪
|
||
|
2 years ago
|
See [available settings](https://github.com/mifi/lossless-cut/blob/master/src/main/configStore.ts). Note that this is subject to change in newer versions. ⚠️ If you specify incorrect values it could corrupt your configuration file. You may use JSON or JSON5. Example:
|
||
|
4 years ago
|
```bash
|
||
|
|
LosslessCut --settings-json '{captureFormat:"jpeg", "keyframeCut":true}'
|
||
|
|
```
|
||
|
3 years ago
|
|
||
|
3 years ago
|
## Other options
|
||
|
|
|
||
|
6 months ago
|
- `--locales-path` Customise path to locales (useful for [translators](translation.md)).
|
||
|
11 months ago
|
- `--disable-networking` Turn off all network requests (see [#1418](https://github.com/mifi/lossless-cut/issues/1418)).
|
||
|
6 months ago
|
- `--http-api` Start the [HTTP server with an API](api.md) to control LosslessCut, optionally specifying a port (default `8080`).
|
||
|
3 years ago
|
- `--keyboard-action` Run a keyboard action (see below.)
|
||
|
2 years ago
|
- `--config-dir` Path to a directory where the `config.json` file will be stored and loaded from. Note: don't include `config.json` in the path (only the directory containing it).
|
||
|
3 years ago
|
|
||
|
6 months ago
|
## Controlling a running instance (experimental) 🧪
|
||
|
3 years ago
|
|
||
|
3 years ago
|
If you have the "Allow multiple instances" setting enabled, you can control a running instance of LosslessCut from the outside, using for example a command line. You do this by issuing messages to it through the `LosslessCut` command. Currently only keyboard actions are supported, and you can open files. *Note that this is considered experimental and the API may change at any time.*
|
||
|
3 years ago
|
|
||
|
|
### Keyboard actions, `--keyboard-action`
|
||
|
|
|
||
|
6 months ago
|
Simulate a keyboard press action in an already running instance of LosslessCut. Note that the command will return immediately, so if you want to run multiple actions in a sequence, you have to `sleep` for a few seconds between the commands. Alternatively if you want to wait until an action has finished processing, you can use the [HTTP API](api.md) instead. Note that the HTTP API does not support opening files, and it is currently not possible to wait for a file to have finished opening.
|
||
|
3 years ago
|
|
||
|
|
### Available keyboard actions
|
||
|
|
|
||
|
|
A list of the available action names can be found in the "Keyboard shortcuts" dialog in the app. Note that you don't have to bind them to any key before using them.
|
||
|
3 years ago
|
|
||
|
|
Example:
|
||
|
|
|
||
|
|
```bash
|
||
|
3 years ago
|
# Open a file in an already running instance
|
||
|
|
LosslessCut file.mp4
|
||
|
|
sleep 3 # hopefully the file has loaded by now
|
||
|
3 years ago
|
# Export the currently opened file
|
||
|
|
LosslessCut --keyboard-action export
|
||
|
|
```
|
||
|
|
|
||
|
3 years ago
|
### Open files in running instance
|
||
|
3 years ago
|
|
||
|
|
```bash
|
||
|
3 years ago
|
LosslessCut file1.mp4 file2.mkv
|
||
|
|
```
|