server
server copied to clipboard
Multiple stream handling
Continuing of #812.
The current behavior is:
- If filter audio input == 1
- merge all audio streams into a single multi channel stream
- If filter video input == 1
- sort video streams by resolution
- if video streams count >= 2 and top 2 streams have same resolution
- alphamerge
This will NOT work 100% of the case, e.g. what if we have multiple quality audio streams etc...
Please help me figure out the edge cases and possible solutions.
Checked and working:
- sort by resolution
- video stream count == 2 && same resolution alphamerge
- merge audio streams
What might be an issue is an audiostream with multiple streams of the same type, but in different bitrates. Obviously, the audio streams will be merged, but this could be unwanted behaviour in this case. Do we need a way to disable this functionality?
Merging of all audiotracks in track order regardless of their codec, bitrate etc is exactly the wanted behaviour. Think of main stereo track plus 5.1 surround track. Or stereo main track plus other language mixes etc. Unwanted tracks in output can be simply ignored or dropped.
This is correct in regular use cases. But when playing a HLS or DASH stream which possibly contains the exact same audiostream, but in different qualities this is unwanted behaviour, and thus it would be good to make it at least possible to turn the automerge off.
Unwanted tracks in output can be simply ignored or dropped.
Can they at this moment?
In broadcast it is fairly common to have separate monotracks, one mono for each stream. And that differs between broadcasters in how to map that. FL C FR or FL FR C That is also the default for Avid DNxHD vc-3 MXF op-1a. So we have to take hight for that.
Its the same for HLS and DASH as they also support multi languages etc. You can not simply pass only the track with the highest something and drop the others.
Just decode all and let the user decide what he wants to deembed/hear.
Which is exactly my point. We need a way to disable the automerge. Currently, to my best of knowing, it is always enabled. Which is good, because most of the files we're playing contain multiple different audio streams like @5opr4ni said. But sometimes, and I've said this in my previous post too, we have a regular stream, which contains the exact same audio, but in different bitrates. In this case it would make sense to disable the automerge by hand.
Again, I don't ask for the automerge to be disabled at all but a way to disable functionality for edge cases.
You can use ffmpeg audio filters in 2.2
af pan=stereo|c0=c6|c1=c7
Perfect. "Issue" solved then. This also helps with remapping the streams when the order is incorrect.
Jepp!
@ronag I assume this can be closed?