Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically controlling LosslessCut / API / CLI #980

Open
4 of 6 tasks
mifi opened this issue Jan 14, 2022 · 3 comments
Open
4 of 6 tasks

Programmatically controlling LosslessCut / API / CLI #980

mifi opened this issue Jan 14, 2022 · 3 comments

Comments

@mifi
Copy link
Owner

mifi commented Jan 14, 2022

Suggested ways to programmatically control LosslessCut. Feel free to add suggestions in comments below.

command line arguments

API / actions / macros

I could imagine some API that allows automating actions in LosslessCut, internally and externally. This could be tied to custom keyboard mappings #254

Run a custom command from segments

See also afterExport event #974 #1347

Ability to press a button in losslesscut and have it run a custom command line (or more commands, e.g. one cmd per segment) and with ability to inject information about the current segments into this command. I think this requires some coding in one way or another by the user.

I think such a «hack» can currently be achieved by creating a custom bash script. Losslesscut will auto save a project .llc file with json5 containing information about each segment. You could create a bash script that you trigger by a keyboard shortcut (outside losslesscut). Then this script will then read the .llc file and run the desired commands. The workflow would be:

  1. Edit segments in losslesscut
  2. once you’re done, trigger your bash script

Scripting / automation of actions

from #2135 (reply in thread):

Maybe add scripting feature for existing commands, so we can make our own automation scripts in javascript.
Then we could assign them to keys or add them to menus, right click commands, icons.
This could massively expand capabilities and add a ton of flexibility to UI.

This it could also ease your development of hard coding everything.

For example, this is the best feature of BLENDER with its console and scripting feature or REAPER DAW, they are basically a giant command library with a UI where everything can be scripted and automated. The users then created an entire ecosystem with thousands of scripts and add-ons.

@mifi
Copy link
Owner Author

mifi commented Oct 15, 2023

this was closed by accident

@mifi mifi reopened this Oct 15, 2023
@mifi
Copy link
Owner Author

mifi commented Oct 15, 2023

there's now a new http api

mifi added a commit that referenced this issue Oct 15, 2023
- add closeCurrentFile action
- allow export confirm also via action
- upgrade electron
@mifi mifi mentioned this issue Jan 26, 2024
22 tasks
@7f5d3nbctkx8gcxwek9e7z3him6f44a7

Feature request: Immediate execution of detectSilentScenes with parameters via API

Similar to the recently implemented goToTimecodeDirect action (ref: #2087), I'd like to propose adding the ability to execute detectSilentScenes with specified parameters via the HTTP API.

Current implementation:
curl -X POST http://localhost:8080/api/action/detectSilentScenes
This opens the silent detection dialog in the GUI, requiring manual input.

Proposed implementation:
curl -X POST http://localhost:8080/api/action/detectSilentScenes --json "{\"noise\": \"-50\", \"duration\": \"1.0\"}"

This would allow:

  1. Specifying parameters (noise threshold and duration) directly in the API call.
  2. Immediate execution of the silent detection without manual intervention.

Benefits:

  • Enables full automation of silent detection via CLI or scripts.
  • Consistent with other API actions like goToTimecodeDirect.
  • Improves workflow efficiency for users who frequently use silent detection with specific parameters.

I believe this enhancement would significantly improve the programmatic control of LosslessCut, especially for automated workflows and batch processing scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants