It works fine when encoding one stream separately, but there is a problem when encoding video and audio at the same time