-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enhance CLI with custom FFmpeg I/O options and improved logging #30
Merged
mitsuki31
merged 7 commits into
master
from
feature/introduce-new-audio-converter-options
Aug 20, 2024
Merged
Enhance CLI with custom FFmpeg I/O options and improved logging #30
mitsuki31
merged 7 commits into
master
from
feature/introduce-new-audio-converter-options
Aug 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Added a new helper function to create log file with optional parameter for prefix name * Switched the log file creation in `ytmp3` module to `utils.createLogFile` * Removed the old `createLogFile` function in `ytmp3` module
* Added a function called `writeErrorLog` to log errors to a specific log file * Integrated the `writeErrorLog` function with 'error' event during audio conversion * Synchronized the callback function in 'end' event
* Added a function that split and resolve the `inputOptions` and `outputOptions` options called `splitOptions` * Added `inputOptions` and `outputOptions` options to the default options object with value of an empty array * Added resolver for `inputOptions` and `outputOptions` options in the `audioconv.resolveOptions` function * Added new parser arguments for `inputOptions` and `outputOptions` options in main module * Added new command-line options: - `--input-options` (aliases, `--inputOptions`, `--addInputOptions`, `--add-input-options`) - `--output-options` (aliases, `--outputOptions`, `--addOptions`, `--add-options`, `--addOutputOptions`, `--add-output-options`) - `--inOpt` (a simple alias for `--input-options`) - `--outOpt` (a simple alias for `--output-options`) * Added a logic to prevent FFmpeg crash due to write to the same file in the same time, the output file will be suffixed with '(copy)'
...and if the FFMPEG_PATH env variable is not an empty string.
This prevent confusion when an error occurs in the program and want to trace the error, especially while processing audio files.
* Improved the custom FFmpeg checker in `before` hook * Re-enabled the verbose parameter in `checkFfmpeg` call
mitsuki31
added
refactor
Refactor and enhancement changes
feature
Bring new features
minor
Minor changes
labels
Aug 20, 2024
mitsuki31
changed the title
Enhance CLI with custom FFmpeg I/O options and improved logging and error handling
Enhance CLI with custom FFmpeg I/O options and improved logging
Aug 20, 2024
mitsuki31
added a commit
that referenced
this pull request
Aug 20, 2024
* Added the description for new command-line options (see #30) * Changed all options' description to use third perspective description
mitsuki31
added a commit
that referenced
this pull request
Aug 20, 2024
* Added the description for new command-line options (see #30) * Changed all options' description to use third perspective description
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces new command-line options for audio conversion, enhances error logging capabilities, and refactors several utility functions within the project. The improvements aim to provide users with greater flexibility when using FFmpeg options, while also ensuring better error handling and logging mechanisms.
Notable Changes
New Features
Audio Conversion Options:
Logging Enhancements:
Refactoring
createLogFile
function to theutils
module, centralizing the log file creation process and removing redundant code from theytmp3
module.FFMPEG_PATH
environment variable is set and not empty.Testing
Summary
This update brings more flexibility to the command-line interface by introducing new options that allow users to specify custom FFmpeg input and output parameters. Enhanced logging and error handling functionalities improve the overall user experience by making the software more reliable and easier to debug. Key changes include the addition of
inputOptions
andoutputOptions
, along with the refactoring of logging mechanisms to theutils
module.New Command-Line Options
--input-options
--inputOptions
,--addInputOptions
,--add-input-options
,--inOpt
--output-options
--outputOptions
,--addOptions
,--add-options
,--addOutputOptions
,--add-output-options
,--outOpt
These options allow users to customize how input files are processed and how output files are generated, offering more granular control over the audio conversion process.
Warning
Using any of these I/O options will take precedence over the other audio conversion options (e.g.,
--bitrate
,--frequency
, etc).But you can still specify the output format or file extension using
--format
flag by combining them, like this:Example Usage
Syntaces