Skip to content

The swiss army knife of lossless video/audio editing

Docs: answer frequently asked support questions

Claude1b8e418671a2
diff --git a/docs/cli.md b/docs/cli.md
index 43bcf7fb..5e87ba67 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -84,6 +84,25 @@ Seek to specific time in the media:
LosslessCut --keyboard-action goToTimecodeDirect '{"time": "12.23"}'
```
+### Actions that open a dialog cannot be scripted
+
+Some actions, for example `createNumSegments`, `createFixedDurationSegments` or `selectSegmentsByExpr`, open a dialog where you have to enter something. These cannot be fully automated, because there's no way to pass the dialog's values from the command line: the action will just open the dialog in the app.
+
+Instead, to create segments from a script, write a [project file](index.md#importexport-projects) next to the media file. If the media file is `/path/to/video.mp4`, name the project file `/path/to/video-proj.llc`, and LosslessCut will load it automatically when you open the media file. Times are in seconds, `name` is the segment label:
+
+```json5
+{
+ version: 2,
+ mediaFileName: 'video.mp4',
+ cutSegments: [
+ { start: 0, end: 10, name: 'First' },
+ { start: 20, end: 30, name: 'Second' },
+ ],
+}
+```
+
+Then open the file and export using `--keyboard-action export`, or better the [HTTP API](api.md), which waits for most actions to finish before responding. You can also open an `.llc` file directly: `LosslessCut /path/to/video-proj.llc`.
+
### HTTP API
You can also control a running instance with the [HTTP API](api.md).
diff --git a/docs/index.md b/docs/index.md
index 59aa7679..bf7c2c06 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -20,6 +20,20 @@ Please read the documentation before creating an issue. Thank you πŸ™
- **A** LosslessCut version in the App Stores is often a few versions behind the latest GitHub version, because I want to be sure that the new versions work perfectly before releasing in the App Stores. The GitHub version will contain new, untested features and may contain some bugs (even in existing functionality). I consider the newest GitHub versions to be a public "beta" test. Then, once I'm sure that the new version works well, I will release it in the App Stores as well to give a frictionless as possible experience for customers. They have exactly the same in-app features, except for a few platform limitations: Apple doesn't allow opening VOB files with App Store apps. Apple App Store apps run in a sandbox, and therefore need to prompt for output directory before allowing writing files.
- **Q**: What are all these `.llc` files that get created?
- **A***: Their purpose is to save your segments so that when you exit/re-open LosslessCut you can continue where you left off. You can turn them off in app settings. See also [#2115](https://github.com/mifi/lossless-cut/issues/2115).
+- **Q:** Why does my export (or *Merge cuts*) start a few seconds before my cut point?
+ - **A:** Because lossless cuts start from the keyframe before the cut point. See [Export starts a few seconds before my cut point](troubleshooting.md#export-starts-a-few-seconds-before-my-cut-point).
+- **Q:** File not supported, black preview or playback stutters?
+ - **A:** See [Preview / playback problems](troubleshooting.md#preview--playback-problems). The preview does not affect the exported file.
+- **Q:** My merged file only plays the first part, or later parts have only audio or are corrupt.
+ - **A:** The files must have identical codec parameters. See [Merge / concat results in corrupt or broken parts](troubleshooting.md#merge--concat-results-in-corrupt-or-broken-parts).
+- **Q:** How can I export all segments with the same label into their own file, or quickly select many segments?
+ - **A:** See [Export segments with the same label into their own file](recipes.md#export-segments-with-the-same-label-into-their-own-file).
+- **Q:** How do I change the default 10 second length of new segments?
+ - **A:** The 10 second default end is only used in simple mode and cannot be changed. Instead, click "advanced view" (baby icon, bottom left). New segments are then created as [markers](#markers) (without an end). Or move the playhead and press <kbd>I</kbd> / <kbd>O</kbd> to set the current segment's start / end there.
+- **Q:** Why doesn't `--keyboard-action createNumSegments` (or another action that opens a dialog) work from a script?
+ - **A:** Actions that open a dialog cannot be scripted. See [Actions that open a dialog cannot be scripted](cli.md#actions-that-open-a-dialog-cannot-be-scripted).
+- **Q:** Where are settings and keyboard shortcuts stored, and how do I copy them to another computer?
+ - **A:** See [Copy settings and keyboard shortcuts to another computer](installation.md#copy-settings-and-keyboard-shortcuts-to-another-computer).
- **Q**: Can I download LosslessCut from other websites or package managers?
- **A**: Only the [official sources specified here](../README.md#download) are maintained by me. Downloading LosslessCut from other sources such as other websites or package managers like WinGet or Homebrew entirely at your own risk, because those are not being maintained or vetted by me.
@@ -44,7 +58,7 @@ Please read the documentation before creating an issue. Thank you πŸ™
- **Q:** Can LosslessCut remember more choices, selections, settings?
- **A:** Maybe, see [#371](https://github.com/mifi/lossless-cut/issues/371).
- **Q:** Does LosslessCut allow me to cut/merge multiple files in the same timeline?
- - **A:** No, and I'm not sure if this will ever be implemented. Editing multiple files will have to be done in multiple steps. See [#976](https://github.com/mifi/lossless-cut/issues/976).
+ - **A:** No, and I'm not sure if this will ever be implemented. Editing multiple files will have to be done in multiple steps, see the recipe [Cut multiple files and merge them all](recipes.md#cut-multiple-files-and-merge-them-all). See also [#976](https://github.com/mifi/lossless-cut/issues/976).
See also [πŸ“ Recipe cookbook](recipes.md).
@@ -62,7 +76,7 @@ If you have a problem with the app or with a file, please see the [πŸ€” Troubles
- <kbd>BACKSPACE</kbd> to remove cutpoint/segment.
- If you create segments without an end time, it is a [marker](#markers) instead of a segment.
- Note that when exporting, all segments you create will be **preserved** and exported as new files. You can change this behavior with the **Yin Yang** symbol ☯️, in which case the behaviour is inverted and LosslessCut will instead **skip** all selected segments and export the parts **between** segments as files.
- - Also note that start times will not be accurate, see [Known issues](troubleshooting.md).
+ - Also note that start times will not be accurate, see [Known issues](troubleshooting.md#export-starts-a-few-seconds-before-my-cut-point).
- *(optional)* <kbd>+</kbd> to add another segment at the current cursor time. Then select the segment end time with <kbd>O</kbd>.
- *(optional)* If you want to merge all the selected segments into one file after cutting, change the `Export mode` from `Separate files` to `Merge cuts`.
- *(optional)* If you want to export to a certain output folder, press the `Working dir unset` button (defaults to same folder as source file).
diff --git a/docs/installation.md b/docs/installation.md
index 28f67cfe..ccc38ef6 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -25,6 +25,10 @@ Settings, keyboard shortcuts, logs and temporary cache files are stored in your
App settings and keyboard shortcuts are stored inside the `config.json` file inside your `appData` folder.
+### Copy settings and keyboard shortcuts to another computer
+
+Quit LosslessCut on both computers, then copy `config.json` from the `appData` folder (see table above) on the old computer to the same folder on the new computer. Note that settings containing paths (e.g. a custom working directory or FFmpeg path) may need to be changed afterwards if the folders are different on the new computer.
+
### Custom `config.json` path
On Windows, if you create a `config.json` file with the contents `{}` next to the `LosslessCut.exe` file, LosslessCut will read/store settings from this file instead of the one inside `appData`. Note that other temporary files will still be stored in `appData`. Alternatively you can specify a custom path to a folder containing `config.json` by using the [CLI option](cli.md) `--config-dir`. See also [#645](https://github.com/mifi/lossless-cut/issues/645).
diff --git a/docs/recipes.md b/docs/recipes.md
index a6993438..7105582d 100644
--- a/docs/recipes.md
+++ b/docs/recipes.md
@@ -67,3 +67,14 @@ If you need to e.g. always select certain tracks, then always select certain seg
8. ⌨️`export`
Now for every file you want to do this, you repeat the steps. See also [#2699](https://github.com/mifi/lossless-cut/discussions/2699).
+
+## Export segments with the same label into their own file
+
+For example you have labelled segments `Sound Bite`, `Interview` etc. and you want one merged file per label.
+
+1. Right click a segment in the segment list -> *Deselect all segments*.
+2. Right click a segment -> *Select segments by label* and enter the label, e.g. `Sound Bite`. Or use *Select segments by expression* with e.g. `segment.label === 'Sound Bite'` (see [expressions](expressions.md#select-segments-by-expression)).
+3. Set export mode to *Merge cuts* (or *Separate files* if you want one file per segment) and export. Only the selected segments are exported.
+4. Repeat from step 1 for each label. Include the label in the [output file name template](file-name-template.md) so that each run gets a different file name, e.g. `${SEG_LABEL[0]}` when merging (it's an array of the merged segments' labels).
+
+Note that the selection is *added* to the existing selection, which is why you deselect all first. To do this faster, bind `deselectAllSegments`, `selectSegmentsByLabel` and `selectSegmentsByExpr` to keys in the Keyboard shortcuts dialog. See also [Efficient workflow for repeated single file operation](#efficient-workflow-for-repeated-single-file-operation).
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index 7287b909..1a35a80e 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -24,6 +24,17 @@ Each segment's *start cut time* will normally (but not always) be "rounded" to t
- You may try to enable the experimental "Smart cut" mode to allow cutting between keyframes. However it will not work for many files.
- Currently, the only way to review the exported file (to check the actual cutpoints) is to run the export (possibly with only one segment enabled to speed up) and then manually check the output file. See also [#1887](https://github.com/mifi/lossless-cut/issues/1887)
+### Export starts a few seconds before my cut point
+
+This is expected with lossless cutting, and it applies to both *Separate files* and *Merge cuts*. Video is stored as *keyframes* (complete pictures) followed by frames that only store the changes since the previous frame. A lossless cut cannot start on a non-keyframe, so with *Keyframe cut mode* enabled (the default), LosslessCut starts the cut from the nearest keyframe **before** your start cutpoint. If the file has few keyframes (e.g. one every 5-10 seconds), the export may start several seconds early.
+
+What you can do:
+- **Place your start cutpoints on keyframes.** Keyframes are shown as vertical lines on the timeline (zoom in to see them). Use the *Seek previous keyframe* / *Seek next keyframe* buttons in the bottom bar, the keyboard shortcuts <kbd>ALT</kbd>+<kbd>←</kbd> / <kbd>ALT</kbd>+<kbd>β†’</kbd>, or hold <kbd>SHIFT</kbd> while scrolling the mouse wheel to jump between keyframes, then press <kbd>I</kbd>. To move existing segments, use *Segments* -> *Align segment times to keyframes*.
+- **Try Smart cut** (*Smart cut (experimental)* in the *Export options* dialog). It re-encodes only the part from the cutpoint to the next keyframe. It does not work for all files, see [Smart cut not working](#smart-cut-not-working).
+- **Re-encode** the file (or just that part) with a different tool. Frame accurate cuts at any position are not possible without re-encoding.
+
+**Why not cut from the nearest keyframe *after* my cutpoint?** Because then the export would be missing the part between your cutpoint and that keyframe, which is content you wanted to keep. Starting a little early is the safer choice. If you prefer that, you can place the start cutpoint on (or just after) the next keyframe yourself.
+
### Cut starts from wrong keyframe
For some files, when you place segment start cutpoints at keyframes, and you export, it will instead cut from the keyframe **before** the keyframe that you wanted. This is because with some videos, FFmpeg struggles to find the nearest previous keyframe, see [#1216](https://github.com/mifi/lossless-cut/issues/1216). To workaround this, you can try to shift your segments' **start**-cutpoints forward by a few frames, so that ffmpeg correctly cuts from the *previous* keyframe.
@@ -47,7 +58,7 @@ If you are trying to cut a FLAC file but your output has the same duration as in
## Merge / concat results in corrupt or broken parts
-This can happen when trying to merge files that are not compatible. Make sure they have the exact same codec parameters before merging. If you are sure they are the same, you can try to first running each of the files separately through LosslessCut before merging the outputs:
+Typical symptoms: the merged file plays only the first part, later parts have only audio (no video), or are corrupt/glitchy. This can happen when trying to merge files that are not compatible. Make sure they have the exact same codec parameters (codec, resolution, frame rate, audio sample rate, channels etc.) before merging. Enable *Check compatibility* in the *Merge/concatenate files* dialog, and LosslessCut will warn you if it detects a mismatch between the files. Files from the same camera/app with the same settings usually work. If you are sure they are the same, you can try to first running each of the files separately through LosslessCut before merging the outputs:
1. First open each file separately and just export without cutting anything, but before exporting
- change the format to `mp4` is [known to fix certain issues like `Non-monotonous DTS in output stream`](https://github.com/mifi/lossless-cut/issues/1713#issuecomment-1726325218)
- change the format to TS (`mpegts`) is [known to give the files a common timebase](https://github.com/mifi/lossless-cut/issues/455), which sometimes makes it possible to merge them, or fixes incorrect output duration, sped up or slowed down segments.
@@ -77,7 +88,9 @@ If you have a problem playing back a particular file inside LosslessCut (**befor
### File not supported
-If you're getting a message saying that the file must be converted to a supported format, this means that LosslessCut's built-in player isn't able to play back that particular file. As a work-around LosslessCut has an FFmpeg-assisted software decoding playback which can be activated from the menu: *File* -> *Convert to supported format*.
+If you're getting a message saying that the file must be converted to a supported format, this means that LosslessCut's built-in player isn't able to play back that particular file. As a work-around LosslessCut has an FFmpeg-assisted software decoding playback which can be activated from the menu: *File* -> *Convert to supported format*. This is only used for the preview, **your export is still made losslessly from the original file.**
+
+By default LosslessCut will do this automatically when you open an unsupported file. You can turn this off in Settings (*Show advanced settings*): *Try to automatically convert to supported format when opening unsupported file*.
### Preview is completely black/blank, corrupted or just won't play back
@@ -92,6 +105,10 @@ LosslessCut uses the same video player that is used by Chrome. You can try to op
Some formats or codecs are not natively supported by LosslessCut's built in player, and LosslessCut will automatically use FFmpeg-assisted software decoding to playback in a lower quality. For better playback you may convert these files to a different format from the menu: *File -> Convert to supported format*. Note that this will not affect the output from LosslessCut, it is only used for playback, see [#88](https://github.com/mifi/lossless-cut/issues/88).
+### Playback stutters or is slow
+
+LosslessCut's player is the same as Chrome's (Chromium), so files that Chrome cannot play smoothly will have the same problem. If the *FFmpeg-assisted playback* label is shown on top of the video, the preview is being decoded by FFmpeg in software, which can be slow for large or high resolution files. Click the quality label next to it to switch between `HD`, `SD` (lower resolution and frame rate, smoother) and `OG` (original). For a smoother preview, use *File* -> *Convert to supported format* and choose one of the slower (encode) options. None of this affects the export. For H265/HEVC files, also try toggling *Enable HEVC / H265 hardware decoding* in Settings, and see [Windows specific issues](#windows-specific-issues) if you have an NVIDIA GPU.
+
### Auto convert to supported format on certain timestamp
If LosslessCut automatically tries to convert your file into a supported format when you start playing/seeking and reach a certain timestamp, see issue [#2893](https://github.com/mifi/lossless-cut/issues/2893).