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

ffmpegCommandRorderStreams and Ensure Audio Stream - incorrect audio order #720

Open
plasticrake opened this issue Nov 26, 2024 · 2 comments

Comments

@plasticrake
Copy link

I'm using "ffmpegCommandRorderStreams" / FFmpeg Command: Reorder Streams but I noticed some of my files are not correctly ordered.

I have a flow that adds 2.0 AAC audio to files that do not have stereo audio. I'm calling:

  • FFmpeg, Begin Command
  • FFmpeg, Ensure Audio Stream
    • Using default values which are:
    • Process Order: codecs,channels,languages,streamTypes
    • Channels: 7.1,5.1,2,1
    • Stream Types: video,audio,subtitle
  • FFmpeg, Order Streams
  • FFmpeg, Execute

Here's an example of a file before/after processing:

Before:
av1 | video
flac | audio | eng | 8
eac | audio | eng | 6

After:
av1 | video
flac | audio | eng | 8
aac | audio | eng | 2
eac | audio | eng | 6

Why wasn't the stereo track at the end? Is my flow incorrect?

I've attached the log for the transcode.
lqHqrVCQD-log (1).txt

Thank you!

@Marnalas
Copy link
Contributor

Hello, I kind of do something similar in my flow.

My guess here is this is the expected behavior. Both of the "Ensure Audio Stream" and "Reorder Stream" plugins only build the FFmpeg command, they don't execute it. That's the job of the Execute plugin. That means that when the "Reorder stream" plugin is run, the 2.0 AAC audio stream doesn't exist yet.

As a rule of thumb, you can avoid problems by isolating commands that add/delete/reorder streams in their own FFmpeg command block. I understand that you want to minimize the number of passes but I don't think it will work in your situation.

@dennix85
Copy link

I think you have to execute the first subset of commands, so that the 2.0 AAC gets added to the file.
Then afterwards you should run the reorder stream plugin with its own start and execute blocks so that it can actually detect the actual 2.0 aac stream inside the container that is created in the first step.

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

3 participants