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

Template string, or a list of arguments (rather than an associative object) for "duplicate" parameters #38

Closed
peter-lyons-kehl opened this issue Nov 3, 2022 · 3 comments

Comments

@peter-lyons-kehl
Copy link

Hi Timothy,

This is on top of #37.

My specific need is small: (On my, admittedly messed up, Manjaro Linux + Pulse + Pipewire), I need

  • not to use -f pulse -i default (which, for whatever reason, doesn't pick up my microphone), but
  • to use -f pulse -i "alsa_input.usb-Logitech_USB_Headset_Logitech_USB_Headset-00.mono-fallback".
  • as an extra, it would be nice to pass in -channels 1 in it, so together as -f pulse -channels 1 -i "alsa_input.usb-Logitech_USB_Headset_Logitech_USB_Headset-00.mono-fallback".

(The above microphone ID comes from pactl list sources. I have the above microphone selected as my GNOME default sound input, but -f pulse -i default didn't pick this mic up. ``pactl list sources | grep -i default doesn't list anything. `pactl list | grep -i default` lists many default settings, but not a (choice of a) microphone. Life is too short...)

Handling the above could be easy: Just two new setting fields (like pulse_source and pulse_num_channels). However, a user may want to mix-in other sources that have their own -i (or other parameters) - like mixing in their microphone and the computer's audio output (for background music/existing instructions/...).

Please consider either supporting

  • a template string that would somehow mix user-provided config substrings (verbatim) with configuration generated by Chronicler, or
  • a prefix and postfix strings that could be added in front of and at the end of the parameters list generated by Chronicler, or
  • an array of entries (each being either an array or an object), rather than an object (so that some keys, like -i, could be duplicated), and/or
  • a "dry_run" setting, which would show the generated command in a popup/terminal/somewhere where it can be copied to clipboard, or that would copy it to the clipboard.

Of course, you and the users most likely value backwards compatibility & simplicity, so I trust your in your judgment.

Currently I have Chronicler invoke a little shell script that saves all its arguments to a temp file. Even providing this in Chronicler's GitHub repo could help people.

#!/usr/bin/env bash
echo $@ >/tmp/all_args.txt
@arciisine
Copy link
Owner

Hey, @peter-kehl , let me look at this and get back to you. Given the positional nature of some of the ffmpeg args, this seems like it would be the right thing to do.

@arciisine
Copy link
Owner

My apologies for the delay.

So the nature of this problem comes down to how all the specific flags are managed on a per-platform basis, and this ends up with an "override" pattern that relies on the arguments being in a hashmap versus a list.

So, what sounds like it would be best here, is to provide a way for complete control over the command line invocation. An intermediate shell script that receives the arguments, and then replaces/injects as needed would solve this problem (and is pretty close to the bash snippet you provided).

I've also considered letting people choose their audio source depending on what ffmpeg shows as available, but I'm not sure how popular the audio feature actually is. That being said, the audio source is something that should be easily overridable, but the channels flag you mentioned would require a different solution.

@peter-lyons-kehl
Copy link
Author

Thank you for considering.
Agree.

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

No branches or pull requests

2 participants