Skip to content

Support setting input arguments (such as format and bitrate) #17

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

Closed
weolopez opened this issue Apr 25, 2016 · 7 comments
Closed

Support setting input arguments (such as format and bitrate) #17

weolopez opened this issue Apr 25, 2016 · 7 comments

Comments

@weolopez
Copy link

Format and AudioSampleRate needed in FFmpegBuilder.

ffmpeg -f s16le -ar 16000 -i input.pcm output.wav

It wont work with
ffmpeg -i input.pcm -f s16le -ar 16000 output.wav

I added format and AudioSampleRate to get it to work but I don't think this is exactly how you have envisioned FFmpegBuilder and FFmpegOutputBuilder working. I don't mind fixing it and providing a pull request but just wanted to get an understanding of your vision.

@davinkevin
Copy link
Contributor

I think #22 cover the -f part

@bramp
Copy link
Owner

bramp commented Jun 5, 2016

Ah for my future reference. The issue here is wanting to force the input format and audio rate. Right now, we only allow the output formats to be set.

We can either add multiple methods on the FFmpegBuilder, or correct a new FFmpegInputBuilder.

@bramp
Copy link
Owner

bramp commented Jun 5, 2016

In the mean time I've committed c72b279 that allows you to specify extra input and output args, for when it's not directly supported.

For example:

List<String> args = new FFmpegBuilder()
    .addExtraArgs("-f", "s16le", "-ar", "16000")
    .setInput("input.pcm")
    .addOutput("output.wav")
      .done()
    .build();

@bramp bramp changed the title enable format and Support setting input arguments (such as format and bitrate) Jun 6, 2016
@igracia
Copy link
Contributor

igracia commented Nov 16, 2016

@bramp I've been trying to use this feature to add a different -itsoffset for each track, but so far haven't managed to get that working to provide different values for each track. The command is
ffmpeg -y -v error -itsoffset 10.157 -itsoffset 1.1 -i audio.trk -i video.trk out.webm
while the desired output is
ffmpeg -y -v error -itsoffset 10.157 -i audio.trk -itsoffset 1.1 -i video.trk out.webm
is there any other way to obtain the second command?

@davinkevin
Copy link
Contributor

I think the Itoffset should be an attribute of the input... which would be an object instead of a simple string.

@igracia
Copy link
Contributor

igracia commented Nov 16, 2016

@davinkevin Yes, it should be an attribute for the input. Let me rephrase the question better, then. Is it possible to set arguments for each input separately? I guess the answer is no.

I've submitted PR #75, which should allow us to do precisely this. Please let me know if you find this approach feasible.

@Euklios
Copy link
Collaborator

Euklios commented Aug 21, 2024

Closed thanks to #339

@Euklios Euklios closed this as completed Aug 21, 2024
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

5 participants