It turned out that the problem was solved if I disabled hardware encoder.
However, I have no clue why it worked.