Skip to content

Ability to skip defining inputs and do it manually via extra args #65

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
YuriMalinov opened this issue Sep 27, 2016 · 4 comments
Closed

Comments

@YuriMalinov
Copy link

Right now it's required to provide at least one input. I've got situation when:

  1. input definition is complex: -f lavfi -i aevalsrc=0
  2. it has to be before extra_args because they refer to it (-map, -shortest)

There was no way to do it besides extending FFmpegBuilder and just copying this method commenting out inputs check - and this way it worked well just with all args defined through addExtraArgs.

Maybe I'm missing something in ffmpeg usage - I've tried several args order in command line and it complained about -i going after other args.

@bramp
Copy link
Owner

bramp commented Oct 1, 2016

Thanks for the report. Would you provide me an example of a full command line, so I can fully understand the issue.

@YuriMalinov
Copy link
Author

Thanks for reply.. I should have posted command before.

I'm solving following problem: there are several videos, some with audio, some without and I need to concat them into one larger video.

To do so first I copy videos without sound stream adding to them null audio stream, command looks like this:
ffmpeg.exe -y -v error -f lavfi -i aevalsrc=0 -i 1.mp4 -vcodec copy -acodec aac -map 0:0 -map 1:0 -shortest 1-no-audio.mp4

Some parts are kind of magic for me now, so maybe there are better ways. At least -f lavfi -i aevalsrc=0 is kind of single thing which shouldn't be split into parts. And also -map requires input to be defined before.

Changing order to something like
ffmpeg.exe -y -v error -vcodec copy -acodec aac -map 0:0 -map 1:0 -shortest -f lavfi -i aevalsrc=0 -i 1.mp4 1-no-audio.mp4
or ffmpeg.exe -y -v error -f lavfi -i aevalsrc=0 -vcodec copy -acodec aac -map 0:0 -map 1:0 -shortest -i 1.mp4 1-no-audio.mp4
breaks things with error like "Option map (set input stream mapping) cannot be applied to input file 1.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to".

@igracia
Copy link
Contributor

igracia commented Nov 27, 2016

Perhaps #75 would solve this?

@Euklios
Copy link
Collaborator

Euklios commented Aug 22, 2024

Closed thanks to #339.
I also just added a test for the command mentioned above

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

4 participants