for (unsigned stream_idx = 0; stream_idx <= last_stream_idx; ++stream_idx) {
AVStream *avstream_video = avformat_new_stream(avctx, nullptr);
if (avstream_video == nullptr) {
fprintf(stderr, "avformat_new_stream() failed\n");
exit(1);
}
for (unsigned stream_idx = 0; stream_idx <= last_stream_idx; ++stream_idx) {
AVStream *avstream_video = avformat_new_stream(avctx, nullptr);
if (avstream_video == nullptr) {
fprintf(stderr, "avformat_new_stream() failed\n");
exit(1);
}