-
Notifications
You must be signed in to change notification settings - Fork 282
Open
Labels
Description
here it checks against sources
with the indexes into av_streams
(filtered and maybe sorted, so not the same as ffmpeg's stream indexes):
server/src/modules/ffmpeg/producer/av_producer.cpp
Lines 485 to 497 in 37b781a
while (true) { | |
if (index == av_streams.size()) { | |
graph = nullptr; | |
return; | |
} | |
if (av_streams.at(index)->codecpar->codec_type == type && | |
sources.find(static_cast<int>(index)) == sources.end()) { | |
break; | |
} | |
index++; | |
} | |
index = av_streams.at(index)->index; |
later it inserts into sources
with the actual ffmpeg stream indexes:
sources.emplace(index, source); |
sources.emplace(index, source); |
also, sorting streams by height and then alphamerge
-ing them if there's more than 1 seems incredibly sketchy:
server/src/modules/ffmpeg/producer/av_producer.cpp
Lines 446 to 462 in 37b781a
if (video_input_count == 1) { | |
std::stable_sort(av_streams.begin(), av_streams.end(), [](auto lhs, auto rhs) { | |
return lhs->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && lhs->codecpar->height > rhs->codecpar->height; | |
}); | |
std::vector<AVStream*> video_av_streams; | |
std::copy_if(av_streams.begin(), av_streams.end(), std::back_inserter(video_av_streams), [](auto s) { | |
return s->codecpar->codec_type == AVMEDIA_TYPE_VIDEO; | |
}); | |
// TODO (fix) Use some form of stream meta data to do this. | |
// https://github.com/CasparCG/server/issues/832 | |
if (video_av_streams.size() >= 2 && | |
video_av_streams[0]->codecpar->height == video_av_streams[1]->codecpar->height) { | |
filter_spec = "alphamerge," + filter_spec; | |
} | |
} |
- Commit: 37b781a