title: rotate Frame in JavaCV
body: <p>I write simple app for android whick use FFmpeg + JavaCV. I can capture image from camera and can recorde video. But want to rotate frame when record video, don't can :-( </p>
  
  <p><a href="http://i.stack.imgur.com/h42rY.png" rel="nofollow">Please see image</a></p>
  
  <p>Stop and save code:</p>
  
  <pre><code>public void stopRecording() {
  
          runAudioThread = false;
          try {
              audioThread.join();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          audioRecordRunnable = null;
          audioThread = null;
  
  
          if (recorder != null &amp;&amp; recording) {
              if (RECORD_LENGTH &gt; 0) {
                  Log.v(LOG_TAG,"Writing frames");
                  try {
                      int firstIndex = imagesIndex % samples.length;
                      int lastIndex = (imagesIndex - 1) % images.length;
                      if (imagesIndex &lt;= images.length) {
                          firstIndex = 0;
                          lastIndex = imagesIndex - 1;
                      }
                      if ((startTime = timestamps[lastIndex] - RECORD_LENGTH * 1000000L) &lt; 0) {
                          startTime = 0;
                      }
                      if (lastIndex &lt; firstIndex) {
                          lastIndex += images.length;
                      }
                      for (int i = firstIndex; i &lt;= lastIndex; i++) {
                          long t = timestamps[i % timestamps.length] - startTime;
                          if (t &gt;= 0) {
                              if (t &gt; recorder.getTimestamp()) {
                                  recorder.setTimestamp(t);
                              }
                              recorder.record(images[i % images.length]);
                          }
                      }
  
                      firstIndex = samplesIndex % samples.length;
                      lastIndex = (samplesIndex - 1) % samples.length;
                      if (samplesIndex &lt;= samples.length) {
                          firstIndex = 0;
                          lastIndex = samplesIndex - 1;
                      }
                      if (lastIndex &lt; firstIndex) {
                          lastIndex += samples.length;
                      }
                      for (int i = firstIndex; i &lt;= lastIndex; i++) {
                          recorder.recordSamples(samples[i % samples.length]);
                      }
                  } catch (FFmpegFrameRecorder.Exception e) {
                      Log.v(LOG_TAG,e.getMessage());
                      e.printStackTrace();
                  }
              }
  
              recording = false;
              Log.v(LOG_TAG,"Finishing recording, calling stop and release on recorder");
              try {
                  recorder.stop();
                  recorder.release();
              } catch (FFmpegFrameRecorder.Exception e) {
                  e.printStackTrace();
              }
              recorder = null;
  
          }
      }
  </code></pre>
  
  <p>in step <code>recorder.record(images[i % images.length]);</code> 
  need rotate frame (images parameter)</p>
  
  <p>How can help me ? Thank you. </p>