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

Fix converter custom parameter builder (AudioSegment.from_file) #750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pedrohml
Copy link

Shifts the standard output (-) parameter to be the last one in the converter parameters so custom input parameters can take effect for conversion using ffmpeg.

I have faced issues when using the parameter -map to select audio streams for conversion as it only take effect if before stdout parameter.

Wrong:

ffmpeg -y -i input -f wav - -map 0:1 > test-wrong.wav

Right:

ffmpeg -y -i input -f wav -map 0:1 - > test-right.wav

In the examples above, only test-right.wav is successfully converted given the selected stream index (i.e. 1).

This follows the established usage instructions where the output destination should be the last parameter to specify (i.e. output_url):

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ...

@pedrohml pedrohml force-pushed the pedrohml/fix-converter-custom-parameters-builder branch from 5bf831b to 46d6e40 Compare August 14, 2023 20:55
@jochie
Copy link

jochie commented Oct 7, 2024

Ran into the same problem (and was putting together an identical PR) when doing exactly what API.markdown suggests we should be able to do, parameters=["-ac", "2"].

Would be lovely to get this merged. :)

Copy link

@sarangkkl sarangkkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants