title: Camera2 app based on mediarecorder records videos of low quality. Does anybody know why?
body: <p>I have been developing a camera app using camera 2 and taking codes from these video series: <a href="https://www.youtube.com/watch?v=69J2ycNCtpE&amp;lc=z23lu3jo4xuwzjataacdp43bf4ywaag5x2tpbiljkf1w03c010c" rel="nofollow noreferrer">https://www.youtube.com/watch?v=69J2ycNCtpE&amp;lc=z23lu3jo4xuwzjataacdp43bf4ywaag5x2tpbiljkf1w03c010c</a>
  I had to update the codes with the run time permissions.</p>
  
  <p>The video quality I obtain is terrible and I do not know why. I tried playing with the output format, the video encoder, the bitrate (according to what I found on other answers) but the quality does not change and it is much worse when compared to the original camera application. When comparing two similar videos with the same length, the resolutions are the same (1080x1920) but the video size resulting from this app is 0.95 MB while the one of the video taken with the original camera app is 12 MB. Clearly, there is something not working, but I do not know what. PS: this phenomenon does not seem to happen to the tutorial guy when he tries the app on his phone. Any help will be much appreciated!</p>