Skip to content

Commit

Permalink
update faq
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Dec 18, 2024
1 parent ac7af48 commit b8fa50d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 23 deletions.
47 changes: 47 additions & 0 deletions batch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Batch processing ⏩

I get a lot of questions about whether LosslessCut can help automate the same operation on X number of files. For example given a folder of 100 files, cut off 10 seconds from the beginning of every file. LosslessCut can generally not do this, however the good news is that often it's not very hard to automate with a simple script.

See also [#868](https://github.com/mifi/lossless-cut/issues/868).

## Setup FFmpeg 📀

First you need to [download and install FFmpeg](https://ffmpeg.org/) on your computer. Make sure you install it properly so that you can open a Bash terminal (Linux/macOS) or Console (Windows) and type the command `ffmpeg` (or `ffmpeg.exe` on Windows) and press <kbd>Enter</kbd>. It should then print out something like this:

```bash
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
```

If you cannot get it working, there here are lots of resources online on how to do this. Or you can ask an AI (for example ChatGPT) to assist you.

## Create your script 📜

Make a file `myscript.sh` (macOS/Linux) or `myscript.bat` (Windows) and edit it with a plain text editor like `nano` or Notepad.

If there's a particular operation from LosslessCut you want to automate across multiple files, you can find the command from the "Last FFmpeg commands" page. Then copy paste this command into your script. Note: if you're on Windows, the command might have to be altered slightly to be compatible (you can use an AI for this).

## Using AI 🤖

I wish more people were aware of this: large language models like ChatGPT can be incredibly useful for helping non-programmers with simple scripting tasks as well as helping you learn things, and it's free! Basically you just ask the AI to write a script for you to do whatever you need. If it doesn't work, you can continue the conversation with the AI and give it the error messages you received and it will try to help your get it working.

Start your sentence with your operating system, e.g. "I am using Windows 10", then try to be so exact and concise as possible to describe what kind of files you have and what you want to do with them to the AI using FFmpeg. Example prompt:

> I am on macOS. Please help me write a script that for each *.mp4 file in a specified folder, losslessly removes the first 10 seconds from each file? Also how do I run the script? The files are inside the folder `/Users/user/my-files`. I have FFmpeg installed and running as `ffmpeg`.
### Action from LosslessCut

If there's a particular operation from LosslessCut you want to automate, you can find the command from the "Last FFmpeg commands" page. Then copy it and paste it into your AI prompt. For example:

> I am on Windows 11. I have this (UNIX bash) command: `ffmpeg -hide_banner -i 'C:\path\to\input.mp4' -map '0:1' -c copy -f adts -y 'c:\path\to\lofoten-stream-1-audio-aac.aac'`, that I want to run automatically on every *.mp4 file in a specified folder. Please help me write a script that achieves this. The files are inside the folder `C:\path\to\folder`. I have FFmpeg installed and running as `ffmpeg.exe`.
If you are on Windows and what you want to do is more complex, it might be a good idea to instruct the AI to use PowerShell instead of Batch.

### More examples

Split files into equal length segments:

> Write a script that takes a folder of *.mp4 files, then for each file, split it into an (unknown) number of files, each file of an equal length of approximately 299 seconds.
Batch rotate all files to 90 degrees:

> Write a script that takes a folder of *.mp4 files, then for each file, losslessly change the rotation to 90 degrees and output to the same folder.
44 changes: 21 additions & 23 deletions issues.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# FAQ

- **Can LosslessCut crop, resize, stretch, mirror/flip, overlay text/images, watermark, blur, redact, reduce quality/re-encode, create GIF, slideshow, burn subtitles, color grading, fade/transition between video clips, fade/combine/mix/merge audio tracks or change audio volume?**
- No, these are all lossy operations (meaning you *have* to re-encode the file), but in the future I may start to implement such features. [See this issue for more information](https://github.com/mifi/lossless-cut/issues/372). See also [#643](https://github.com/mifi/lossless-cut/issues/643).
- Can LosslessCut be batched/automated using a CLI or API or do external post-processing?
- While it was never designed for advanced batching/automation, it does have a [basic CLI and a HTTP API](./cli.md). More info: [#980](https://github.com/mifi/lossless-cut/issues/980) [#868](https://github.com/mifi/lossless-cut/issues/868).
- Is there a keyboard shortcut to do X?
- First check the Keyboard shortcuts dialog. If you cannot find your shortcut there, [see this issue.](https://github.com/mifi/lossless-cut/issues/254)
- When will you implement feature X?
- I have limited time and I have a lot of projects to work on, so I cannot promise any timeline. I will usually prioritize the issues with the most likes, [see here for a list of the most popular issues](https://github.com/mifi/lossless-cut/issues/691).
- How to *cut away* a middle part of a video?
- Enable "advanced view" and then click the Yin Yang symbol. It will invert the segments.
- Is LosslessCut a portable app? Where is application data, settings and temp files stored?
- See LosslessCut is *not* a [portable app](https://github.com/mifi/lossless-cut/issues/645). See [Installation and files](./installation.md).
- Can I export and replace the input file in-place?
- No, but you can export and automatically delete the input file.
- Can you publish through [winget](https://github.com/mifi/lossless-cut/issues/1279), [Flatpak](https://github.com/mifi/lossless-cut/pull/1813), [Docker](https://github.com/mifi/lossless-cut/issues/1086) or other software mangers?
- In general I don't want to maintain more build systems, but I could be open to linking to externally maintained build systems.
- Can LosslessCut do a batch conversion of multiple files?
- Most likely not, but if you download [FFmpeg](https://ffmpeg.org/) on your computer and then ask an AI exactly what you want, it might be able to create a bash script for you. Example ChatGPT prompt: `Can you help me write a bash script that for each .mp4 file in a specified folder, losslessly cuts off the first 10 seconds from each file?` - You can also feed the AI commands from "Last FFmpeg commands" page in LosslessCut as an example.
Please read this first:

- **Q:** Can LosslessCut **crop, resize, stretch, mirror/flip, overlay text/images, watermark, blur, redact, reduce quality/re-encode, create GIF, slideshow, burn subtitles, color grading, fade/transition between video clips, fade/combine/mix/merge audio tracks or change audio volume**?
- **A:** No, these are all lossy operations (meaning you *have* to re-encode the file), but in the future I may start to implement such features. [See this issue for more information](https://github.com/mifi/lossless-cut/issues/372). See also [#643](https://github.com/mifi/lossless-cut/issues/643).
- **Q:** Can LosslessCut be batched/automated using a CLI or API or do external post-processing?
- **A:** While it was never designed for advanced batching/automation, it does have a [basic CLI and a HTTP API](./cli.md). More info: [#980](https://github.com/mifi/lossless-cut/issues/980) [#868](https://github.com/mifi/lossless-cut/issues/868).
- **Q:** Is there a keyboard shortcut to do X?
- **A:** First check the Keyboard shortcuts dialog. If you cannot find your shortcut there, [see this issue.](https://github.com/mifi/lossless-cut/issues/254)
- **Q:** Can LosslessCut do the same batch conversion operation on multiple files?
- [**A:** Probably not, but you can probably do it! See here.](./batch.md)
- **Q:** How to *cut away* a middle part of a video?
- **A:** Enable "advanced view" and then click the Yin Yang symbol. It will invert the segments.
- **Q:** When will you implement feature X?
- **A:** I have limited time and I have a lot of projects to work on, so I cannot promise any timeline. I will usually prioritize the issues with the most likes, [see here for a list of the most popular issues](https://github.com/mifi/lossless-cut/issues/691).
- **Q:** Is LosslessCut a portable app? Where is application data, settings and temp files stored?
- **A:** See LosslessCut is *not* a [portable app](https://github.com/mifi/lossless-cut/issues/645). See [Installation and files](./installation.md).
- **Q:** Can I export and replace the input file in-place?
- **A:** No, but you can export and automatically delete the input file.
- **Q:** Can you publish through [winget](https://github.com/mifi/lossless-cut/issues/1279), [Flatpak](https://github.com/mifi/lossless-cut/pull/1813), [Docker](https://github.com/mifi/lossless-cut/issues/1086) or other software mangers?
- **A:** In general I don't want to maintain more build systems, but I could be open to linking to externally maintained build systems.

## App Stores and GitHub difference

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.

### Feature differences

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

# Primer: Video & audio formats vs. codecs

Expand Down

0 comments on commit b8fa50d

Please sign in to comment.