title: Camera2 API switching camera during recording
body: <p>I'm working with Camera2 API and in my app it's important to switch the camera during recording. After each camera switch I save video fragment to disk, and after stopping the recording I merge videos into one using <code>-f concat -safe 0 -i listPath -c copy finalPath</code> command of <a href="http://writingminds.github.io/ffmpeg-android-java/" rel="nofollow noreferrer">FFmpeg for Android</a>. When I open a separate video fragment, it looks correct, but when I open the merged video, videos recorded on the back camera are rotated 180 degrees. The problem is only in the merged video.</p>
  
  <p>In meta-tag of videos if video recorded on back camera, then "rotate" tag has 90 degrees, otherwise 270 degrees.</p>
  
  <p>As I understood when ffmpeg merges a videos it automatically rotates the video if it has different "rotate" tag in he's metatags.</p>
  
  <p>How I can solve this problem?</p>
  
  <p>P.S Also I tried to use <a href="https://github.com/sannies/mp4parser" rel="nofollow noreferrer">MP4Parser Library</a> for merging, but it has the same problems.<br>
  P.P.S. <code>-noautorotate</code> param for ffmpeg does not help me.</p>