diff --git a/libraries/phpvideotoolkit/phpvideotoolkit.php5.php b/libraries/phpvideotoolkit/phpvideotoolkit.php5.php
index 6463e50..92dd187 100644
--- a/libraries/phpvideotoolkit/phpvideotoolkit.php5.php
+++ b/libraries/phpvideotoolkit/phpvideotoolkit.php5.php
@@ -1017,6 +1017,12 @@ class PHPVideoToolkit {
       }
       $data['video']['pixel_format'] = $formats[1];
       $data['video']['codec'] = $formats[0];
+
+      // is rotation set?
+      preg_match('/rotate\s*:\s*(\d+)/', $raw, $rotate_matches);
+      if (count($rotate_matches) > 0) {
+        $data['video']['rotate'] = intval($rotate_matches[1]);
+      }
     }
 
     // match the audio stream info
diff --git a/transcoders/TranscoderAbstractionFactoryFfmpeg.inc b/transcoders/TranscoderAbstractionFactoryFfmpeg.inc
index 9ea2ad6..7c459d7 100644
--- a/transcoders/TranscoderAbstractionFactoryFfmpeg.inc
+++ b/transcoders/TranscoderAbstractionFactoryFfmpeg.inc
@@ -221,6 +221,19 @@ class TranscoderAbstractionFactoryFfmpeg extends TranscoderAbstractionFactory im
           $this->transcoder->extractFrame($seek, FALSE, '%st');
           $result = $this->transcoder->setOutput(dirname($dstpath) . '/', basename($dstpath), PHPVideoToolkit::OVERWRITE_EXISTING);
           if ($result === PHPVideoToolkit::RESULT_OK) {
+            if (isset($file_info['video']['rotate'])) {
+              switch ($file_info['video']['rotate']) {
+                case 90 :
+                  $this->transcoder->addCommand('-vf', 'transpose=1');
+                  break;
+                case 180 :
+                  $this->transcoder->addCommand('-vf', 'vflip');
+                  break;
+                case 270 :
+                  $this->transcoder->addCommand('-vf', 'transpose=2');
+                  break;
+              }
+            }
             $result = $this->transcoder->execute() === PHPVideoToolkit::RESULT_OK;
           }
 
