Skip to content
New issue

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

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

Already on GitHub? # to your account

order of ExtraArgs #91

Closed
thaeger71 opened this issue Jan 24, 2017 · 8 comments
Closed

order of ExtraArgs #91

thaeger71 opened this issue Jan 24, 2017 · 8 comments

Comments

@thaeger71
Copy link

Hi there,
I'am working on a project where I have to decode, encode and join several raw audio files.

For example:

file1.pcma
file2.pcma

with a command like this:

ffmpeg.exe  -filter_complex "[1:a]adelay=4000[a1];[0:a][a1]amix=inputs=2:duration=longest" -f alaw -ar 8000 -ac 1 -i file1.pcma -f alaw -ar 8000 -ac 1 -i file2.pcma -ar 8000 -ac 1 out.wav

For this it's important to have args in the right order.

I tried to get something like this with ffmpeg-cli-wrapper, because it's a nice peace of software and covers all the event and threading stuff. I tried it with the following command:

FFmpeg ffmpeg = new FFmpeg("./src/main/resources/ffmpeg/ffmpeg.exe");
FFmpegBuilder builder = new FFmpegBuilder()
	.addExtraArgs("-filter_complex \"[1:a]adelay=4000[a1];[0:a][a1]amix=inputs=2:duration=longest\"")
	.setInput("./file1.pcma").setFormat("alaw").addExtraArgs("-ar 8000 -ac 1")
	.addInput("./file2.pcma").setFormat("alaw").addExtraArgs("-ar 8000 -ac 1")
	.addOutput("./output.wav").addExtraArgs("-ar 8000 -ac 1").done();

what it has produced was:

./src/main/resources/ffmpeg/ffmpeg.exe -y -v error -f alaw -filter_complex "[1:a]adelay=4000[a1];[0:a][a1]amix=inputs=2:duration=longest" -ar 8000 -ac 1 -ar 8000 -ac 1 -i ./file1.pcma -i ./file2.pcma -ar 8000 -ac 1 ./output.wav

As you can see the order is not right. The format argument has only appliend once and the other two extraargs doesn't belong to the right input because of the order.

@bramp
Copy link
Owner

bramp commented May 13, 2017

For this, I need to refactor the project to support a FFmpegInputBuilder, so we can attach arguments to particular input streams. Right now, arguments are only attached to output streams.

@bramp bramp added this to the InputBuilder milestone May 13, 2017
@igracia
Copy link
Contributor

igracia commented May 19, 2017

@bramp are you working on this? I see that it's affecting more people, so I could resume working on that builder.

@bramp
Copy link
Owner

bramp commented May 20, 2017

@igracia I am not working on this, I was hoping you would wrap it up :)

@igracia
Copy link
Contributor

igracia commented May 21, 2017 via email

@kokorin
Copy link

kokorin commented Jun 17, 2017

If this issue is still relevant, you can use my command line ffmpeg wrapper - Jaffree

@Omar-Riaz
Copy link

@igracia Hello. I was planing to work on this for issue #156 to get support for input devices. Are you currently working on it?

@igracia
Copy link
Contributor

igracia commented Dec 27, 2018

@Omar-Riaz sorry, never got back to this. I don't think I will resume my work anytime soon, so please do proceed with that.

@Euklios
Copy link
Collaborator

Euklios commented Aug 21, 2024

Closed thanks to #339

@Euklios Euklios closed this as completed Aug 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants