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

[Enhancement] Merging audio tracks together? #607

Closed
MArfanM opened this issue Jan 22, 2021 · 1 comment
Closed

[Enhancement] Merging audio tracks together? #607

MArfanM opened this issue Jan 22, 2021 · 1 comment

Comments

@MArfanM
Copy link

MArfanM commented Jan 22, 2021

I record my games via Shadowplay, and that app separates my voice and game audio into two different audio tracks.
Sometimes, I'd like to use just one audio track, and in other times, use both.

If I do decide to use both, I need to merge the tracks together, as Youtube nor Windows Movie Player cannot output both tracks at the same time.
With some help via Reddit, I was able to use ffmpeg to merge/"delete" one of the audio tracks by using the "amix-filter in a complex filtergraph":

ffmpeg -i shadowplay_file.mkv -filter_complex "[0:a:0][0:a:1]amix=2:longest:weights=X Y[aout]" -map 0:V:0 -map "[aout]" -c:v copy -c:a aac -b:a 320k output.mkv

Where X and Y are the volumes of each of the audio tracks (1 is the default; >1 increases the volume; 0 mutes the track).
(this code also allows the adjustment of either audio tracks, too, which is a bonus)

It is only after this that I trim the video, as most (light) video trimmers aren't able to detect/process both tracks... until I found this application!

This application is able to recognize the audio tracks, and even leave them untouched after processing the videos which is pretty rad! But, knowing that this application's internal workings is based on ffmpeg as well, I was wondering if this merging/deleting audio track feature could be implemented too!

I'm no programming expert, but I'd think this would be a relatively simple to implement. I'll be very grateful if it can be implemented!

@mifi
Copy link
Owner

mifi commented Jan 22, 2021

This is not a lossless operation so it's out of the scope of losslesscut, but I will add it to the lossy features issue #372

PS my other tool [editly](https://github.com/mifi/editly#arbitrary-audio-tracks can do this)

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

2 participants