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

Multiple Audio Tracks #36

Open
Protoc0l opened this issue Jul 6, 2024 · 5 comments
Open

Multiple Audio Tracks #36

Protoc0l opened this issue Jul 6, 2024 · 5 comments

Comments

@Protoc0l
Copy link

Protoc0l commented Jul 6, 2024

Thank you in advance for the help. If the mkv container has mutliple audio tracks (7.1, 5.1 and stereo), is there a way to edit/cleanvid each audio track keeping the format of each track including multitracks? Currently it seems to be keeping only one if multiple tracks are present and converting then to audio (aac). Even if i split the audio tracks to different mkv containers and process them individually with cleanvid, they seem to all be audio (aac) after processing each split audio track. (PS thank you for making this script, it has revolutionized my video processing for our familiy!)

@mmguero
Copy link
Owner

mmguero commented Jul 15, 2024

Thanks for the suggestion! I'm not getting much time to update this project these days but I agree with the usefulness of this, and will take it under advisement.

@Protoc0l
Copy link
Author

Splendid thank you, i look forwards to this if it becomes a thing! After a lot of testing I had decided to just clean up the 5.1 surround and then convert it afterwards to stereo so i have both 5.1 and stereo edited which should work pretty well. Thanks for getting back to me!

@davidpeele
Copy link

davidpeele commented Sep 16, 2024

After doing testing on this, it seems an amazing option for 5.1 audio would be to mute only the center, and front channels leaving the rear channels complete as most if not all dialogue comes from the front and especially the center channel. This option is well beyond my ability and understanding of python programming, but maybe somebody else could help out in disregard.
Otherwise, this is a great tool. That does pretty much what I was hoping for.
Thank you for your work on this!

mmguero added a commit that referenced this issue Sep 16, 2024
…d list audio tracks with --audio-stream-list
mmguero added a commit that referenced this issue Sep 16, 2024
…d list audio tracks with --audio-stream-list
@mmguero
Copy link
Owner

mmguero commented Sep 16, 2024

I'm releasing a v1.7.0 that should handle this by adding options for --audio-stream-list and --audio-stream-index index. For example:

  • list the audio streams
$ cleanvid -i Princess.Mononoke.mkv --audio-stream-list
1: aac, 48000 Hz, stereo, jpn
2: aac, 48000 Hz, stereo, eng
  • clean the selected audio stream
$ cleanvid -i Princess.Mononoke.mkv --audio-stream-index 2
  • attempting to clean a multi-audio-stream file without selecting which one you want raises an exception:
$cleanvid -i Princess.Mononoke.mkv
Traceback (most recent call last):
  File "cleanvid", line 8, in <module>
    sys.exit(RunCleanvid())
             ^^^^^^^^^^^^^
  File "cleanvid.py", line 834, in RunCleanvid
    cleaner.MultiplexCleanVideo()
  File "cleanvid.py", line 565, in MultiplexCleanVideo
    raise ValueError(
ValueError: Multiple audio streams, specify audio stream index with --audio-stream-index

The other, non-selected audio streams should go straight into the output video file as-is, completely untouched. The selected audio stream should be the only audio stream that's affected by the filter.

I'm interested to hear everybody's experience with this.

@mmguero
Copy link
Owner

mmguero commented Sep 16, 2024

Note that my use case is more for multi-language files rather than different stereo encodings, but I think it should work the same way. If not let me know.

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