svt / encore

Transcode media files in an epic manner
European Union Public License 1.2
270 stars 25 forks source link

Question: How to deal with different track allocation in input with 8 audio streams? #29

Open grusell opened 2 months ago

grusell commented 2 months ago

I want to transcode stereo audio from existing stereo mix in inputs. I have two different types of inputs:

a) Audio is in 8 mono streams, with StereoLeft allocated to stream 0 and StereoRight allocated to stream 1 b) Audio is in 8 mono streams, with StereoLeft allocated to stream 6 and StereoRight allocated to stream 7

I cannot seem to find a non-hacky way to handle this. The best way I found is to define a pan-mapping from 7.1(wide) to stereo that selects stream 6 and 7 for stereo. Then if I set channelLayout on the job input to 7.1(wide) I get what I want in case b. For case a, I set a default-pan for stereo that just uses stream 0 and 1. This solution feels a bit hacky though since the channel layout in case b is not really 7.1(wide). Is there currently a better way to handle this?

fhermansson commented 1 month ago

No, currently there is no better way to handle this. But we plan to do improvements on handling audio layouts. Maybe adding the possibility to define custom channel layouts would help? Like DL+DR|7.1(wide), and perhaps combined with labels to separate audio, so that the downmix can be handled by one audio encode, and the 7.1 by another?

grusell commented 1 month ago

Yes, I think a possibility to define custom channel layouts would be a good solution in this case.