update faq

pull/2298/head
Mikael Finstad 10 months ago
parent ac7af4894f
commit b8fa50de6d
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

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

@ -1,31 +1,29 @@
# FAQ # 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?** Please read this first:
- 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? - **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**?
- 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). - **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).
- Is there a keyboard shortcut to do X? - **Q:** Can LosslessCut be batched/automated using a CLI or API or do external post-processing?
- First check the Keyboard shortcuts dialog. If you cannot find your shortcut there, [see this issue.](https://github.com/mifi/lossless-cut/issues/254) - **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).
- When will you implement feature X? - **Q:** Is there a keyboard shortcut to do 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). - **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)
- How to *cut away* a middle part of a video? - **Q:** Can LosslessCut do the same batch conversion operation on multiple files?
- Enable "advanced view" and then click the Yin Yang symbol. It will invert the segments. - [**A:** Probably not, but you can probably do it! See here.](./batch.md)
- Is LosslessCut a portable app? Where is application data, settings and temp files stored? - **Q:** How to *cut away* a middle part of a video?
- See LosslessCut is *not* a [portable app](https://github.com/mifi/lossless-cut/issues/645). See [Installation and files](./installation.md). - **A:** Enable "advanced view" and then click the Yin Yang symbol. It will invert the segments.
- Can I export and replace the input file in-place? - **Q:** When will you implement feature X?
- No, but you can export and automatically delete the input file. - **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).
- 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? - **Q:** Is LosslessCut a portable app? Where is application data, settings and temp files stored?
- In general I don't want to maintain more build systems, but I could be open to linking to externally maintained build systems. - **A:** See LosslessCut is *not* a [portable app](https://github.com/mifi/lossless-cut/issues/645). See [Installation and files](./installation.md).
- Can LosslessCut do a batch conversion of multiple files? - **Q:** Can I export and replace the input file in-place?
- 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. - **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 ## 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. 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.
### 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.
# Primer: Video & audio formats vs. codecs # Primer: Video & audio formats vs. codecs

Loading…
Cancel
Save