<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi, in Media (Intel® Video Processing Library, Intel Media SDK)</title>
    <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999480#M4857</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please provide us the snapshots of the video when joined by using/not using RotateEffect. Let me check with our team and update you in regard to performance on a Samsung S4 device.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2015 00:19:37 GMT</pubDate>
    <dc:creator>Harshdeep_B_Intel</dc:creator>
    <dc:date>2015-05-13T00:19:37Z</dc:date>
    <item>
      <title>Joining videos together with rotation</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999477#M4854</link>
      <description>&lt;P&gt;I have an app which records video from both the front and back camera, and I want to be able to stitch the videos together into one long video.&lt;/P&gt;

&lt;P&gt;When I try this, (with the following code), any videos from the rear camera are flipped upside down.&lt;/P&gt;

&lt;P&gt;Basically, what I think I need is a way to join the videos with setting a different rotation effect on the different video segments.&lt;/P&gt;

&lt;P&gt;Additionally, the performance is pretty slow - is there a way to speed this up?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Liron&lt;/P&gt;

&lt;P&gt;Code:&lt;/P&gt;

&lt;PRE class="brush: java" style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 12pt;"&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public &lt;/SPAN&gt;Task&amp;lt;Void&amp;gt; mergeVideos(List&amp;lt;RecordedFileInfo&amp;gt; files, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;final &lt;/SPAN&gt;File outputFile, Context c)
{
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;final &lt;/SPAN&gt;Task&amp;lt;Void&amp;gt;.TaskCompletionSource task = Task.&lt;SPAN style="font-style:italic;"&gt;create&lt;/SPAN&gt;();
  IProgressListener progressListener = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;IProgressListener()
  {
    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onMediaStart()
    {
      Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaStart"&lt;/SPAN&gt;, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;);
    }

    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onMediaProgress(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;float &lt;/SPAN&gt;progress)
    {
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;final float &lt;/SPAN&gt;mediaProgress = progress;&lt;SPAN style="color:#808080;font-style:italic;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;    &lt;/SPAN&gt;}

    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onMediaDone()
    {
      Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaDone"&lt;/SPAN&gt;, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;);
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;"&gt;outputFile&lt;/SPAN&gt;.exists())
      {
        Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaDone"&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"Success"&lt;/SPAN&gt;);
        &lt;SPAN style="color:#660e7a;"&gt;task&lt;/SPAN&gt;.setResult(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;);
      }
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;      &lt;/SPAN&gt;{
        Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaDone"&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"Failed"&lt;/SPAN&gt;);
        &lt;SPAN style="color:#660e7a;"&gt;task&lt;/SPAN&gt;.setError(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;Exception(&lt;SPAN style="color:#008000;font-weight:bold;"&gt;"Something went wrong during video merge"&lt;/SPAN&gt;));
      }
    }

    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onMediaPause()
    {
      Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaPause"&lt;/SPAN&gt;, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;);
    }

    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onMediaStop()
    {
      Logger.&lt;SPAN style="font-style:italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onMediaStop"&lt;/SPAN&gt;, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;);
    }

    &lt;SPAN style="color:#808000;"&gt;@Override
&lt;/SPAN&gt;&lt;SPAN style="color:#808000;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public void &lt;/SPAN&gt;onError(Exception exception)
    {
      Logger.&lt;SPAN style="font-style:italic;"&gt;LogException&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"onError"&lt;/SPAN&gt;, exception);
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;final &lt;/SPAN&gt;Exception e = exception;
      &lt;SPAN style="color:#660e7a;"&gt;task&lt;/SPAN&gt;.setError(e);
    }
  };

  AndroidMediaObjectFactory factory = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;AndroidMediaObjectFactory(c);
  MediaComposer composer = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;MediaComposer(factory, progressListener);

  MediaFileInfo mediaFileInfo = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;;
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;long &lt;/SPAN&gt;i = &lt;SPAN style="color:#0000ff;"&gt;0&lt;/SPAN&gt;;
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    &lt;SPAN style="color:#000080;font-weight:bold;"&gt;for&lt;/SPAN&gt;(RecordedFileInfo f : files)
    {
      &lt;SPAN style="color:#808080;font-style:italic;"&gt;//Get rotation
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;      &lt;/SPAN&gt;File file = f.getFile();
      MediaMetadataRetriever retriever = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;MediaMetadataRetriever();
      retriever.setDataSource(file.getAbsolutePath());
      String extractMetadata = retriever.extractMetadata(MediaMetadataRetriever.&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;METADATA_KEY_VIDEO_ROTATION&lt;/SPAN&gt;);
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;int &lt;/SPAN&gt;angle = Integer.&lt;SPAN style="font-style:italic;"&gt;parseInt&lt;/SPAN&gt;(extractMetadata);

      android.net.Uri uri = android.net.Uri.&lt;SPAN style="font-style:italic;"&gt;fromFile&lt;/SPAN&gt;(file);
      com.intel.inde.mp.Uri fileUri = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;com.intel.inde.mp.Uri(uri.toString());
      composer.addSourceFile(fileUri);
      &lt;SPAN style="color:#000080;font-weight:bold;"&gt;if&lt;/SPAN&gt;(mediaFileInfo == &lt;SPAN style="color:#000080;font-weight:bold;"&gt;null&lt;/SPAN&gt;)
      {
        composer.setTargetFile(outputFile.getAbsolutePath());
        mediaFileInfo = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;MediaFileInfo(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;AndroidMediaObjectFactory(c));
        mediaFileInfo.setUri(fileUri);
        AudioFormat af = (AudioFormat)mediaFileInfo.getAudioFormat();
        VideoFormat vf = (VideoFormat)mediaFileInfo.getVideoFormat();

        configureVideoEncoder(composer, vf, angle);
        configureAudioEncoder(composer, af);
      }

      &lt;SPAN style="color:#808080;font-style:italic;"&gt;//Fix rotation;
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;      &lt;/SPAN&gt;RotateEffect effect = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;RotateEffect(angle, EglUtil.&lt;SPAN style="font-style:italic;"&gt;getInstance&lt;/SPAN&gt;());
      effect.setSegment(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;Pair&amp;lt;Long, Long&amp;gt;(&lt;SPAN style="color:#0000ff;"&gt;0L&lt;/SPAN&gt;, &lt;SPAN style="color:#0000ff;"&gt;0L&lt;/SPAN&gt;));  &lt;SPAN style="color:#808080;font-style:italic;"&gt;// Apply to all stream
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;      &lt;/SPAN&gt;composer.addVideoEffect(effect);

      i++;
    }
    composer.start();
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(Exception ex)
  {
    Logger.&lt;SPAN style="font-style:italic;"&gt;LogException&lt;/SPAN&gt;(&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;TAG&lt;/SPAN&gt;, &lt;SPAN style="color:#008000;font-weight:bold;"&gt;"Failed to setup video merger"&lt;/SPAN&gt;, ex);
    &lt;SPAN style="color:#000080;font-weight:bold;"&gt;return &lt;/SPAN&gt;Task.&lt;SPAN style="font-style:italic;"&gt;forError&lt;/SPAN&gt;(ex);
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;return &lt;/SPAN&gt;task.getTask();
}&lt;/PRE&gt;

&lt;PRE style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 12pt;"&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;protected void &lt;/SPAN&gt;configureVideoEncoder(MediaComposer mediaComposer, VideoFormat formatToCopy, &lt;SPAN style="color:#000080;font-weight:bold;"&gt;int &lt;/SPAN&gt;angle)
{
  VideoFormatAndroid targetFormat;
  Resolution frameSize = formatToCopy.getVideoFrameSize();
  String videoMimeType = formatToCopy.getMimeType();
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;if&lt;/SPAN&gt;(angle == &lt;SPAN style="color:#0000ff;"&gt;90 &lt;/SPAN&gt;|| angle == &lt;SPAN style="color:#0000ff;"&gt;270 &lt;/SPAN&gt;|| angle == -&lt;SPAN style="color:#0000ff;"&gt;90&lt;/SPAN&gt;)
  {
    frameSize = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;Resolution(frameSize.height(), frameSize.width());
  }
  targetFormat = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;VideoFormatAndroid(videoMimeType, frameSize.width(), frameSize.height());

  &lt;SPAN style="color:#808080;font-style:italic;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color:#0073bf;font-weight:bold;font-style:italic;"&gt;TODO: Get this value from somewhere
&lt;/SPAN&gt;&lt;SPAN style="color:#0073bf;font-weight:bold;font-style:italic;"&gt;  &lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    targetFormat.setVideoBitRateInKBytes(formatToCopy.getVideoBitRateInKBytes());
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    targetFormat.setVideoBitRateInKBytes(&lt;SPAN style="color:#0000ff;"&gt;5000&lt;/SPAN&gt;);&lt;SPAN style="color:#808080;font-style:italic;"&gt;//formatToCopy.getVideoBitRateInKBytes());
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;  &lt;/SPAN&gt;}
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    targetFormat.setVideoFrameRate(formatToCopy.getVideoFrameRate());
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    targetFormat.setVideoFrameRate(&lt;SPAN style="color:#0000ff;"&gt;30&lt;/SPAN&gt;);
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    targetFormat.setVideoIFrameInterval(formatToCopy.getVideoIFrameInterval());
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    targetFormat.setVideoIFrameInterval(&lt;SPAN style="color:#0000ff;"&gt;1&lt;/SPAN&gt;);
  }
  targetFormat.setInteger(MediaFormat.&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;KEY_MAX_INPUT_SIZE&lt;/SPAN&gt;, &lt;SPAN style="color:#0000ff;"&gt;0&lt;/SPAN&gt;);
  mediaComposer.setTargetVideoFormat(targetFormat);
}

&lt;SPAN style="color:#000080;font-weight:bold;"&gt;protected void &lt;/SPAN&gt;configureAudioEncoder(MediaComposer mediaComposer, AudioFormat formatToCopy)
{

  AudioFormatAndroid targetFormat;
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;int &lt;/SPAN&gt;sampleRate, channelCount;
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    sampleRate = formatToCopy.getAudioSampleRateInHz();
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    sampleRate = &lt;SPAN style="color:#0000ff;"&gt;48000&lt;/SPAN&gt;;
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    channelCount = formatToCopy.getAudioChannelCount();
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    channelCount = &lt;SPAN style="color:#0000ff;"&gt;2&lt;/SPAN&gt;;
  }
  targetFormat = &lt;SPAN style="color:#000080;font-weight:bold;"&gt;new &lt;/SPAN&gt;AudioFormatAndroid(formatToCopy.getMimeType(), sampleRate, channelCount);

  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    targetFormat.setAudioBitrateInBytes(formatToCopy.getAudioBitrateInBytes());
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    targetFormat.setAudioBitrateInBytes(&lt;SPAN style="color:#0000ff;"&gt;96 &lt;/SPAN&gt;* &lt;SPAN style="color:#0000ff;"&gt;1024&lt;/SPAN&gt;);
  }

  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;try
&lt;/SPAN&gt;&lt;SPAN style="color:#000080;font-weight:bold;"&gt;  &lt;/SPAN&gt;{
    targetFormat.setAudioProfile(formatToCopy.getAudioProfile());
  }
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;catch&lt;/SPAN&gt;(RuntimeException ex)
  {
    targetFormat.setAudioProfile(MediaCodecInfo.CodecProfileLevel.&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;AACObjectLC&lt;/SPAN&gt;);&lt;SPAN style="color:#808080;font-style:italic;"&gt;//formatToCopy.getAudioProfile());
&lt;/SPAN&gt;&lt;SPAN style="color:#808080;font-style:italic;"&gt;  &lt;/SPAN&gt;}
  targetFormat.setInteger(MediaFormat.&lt;SPAN style="color:#660e7a;font-weight:bold;font-style:italic;"&gt;KEY_MAX_INPUT_SIZE&lt;/SPAN&gt;, &lt;SPAN style="color:#0000ff;"&gt;0&lt;/SPAN&gt;);
  mediaComposer.setTargetAudioFormat(targetFormat);
}

&lt;SPAN style="color:#000080;font-weight:bold;"&gt;public class &lt;/SPAN&gt;RotateEffect &lt;SPAN style="color:#000080;font-weight:bold;"&gt;extends &lt;/SPAN&gt;VideoEffect
{
  &lt;SPAN style="color:#000080;font-weight:bold;"&gt;public &lt;/SPAN&gt;RotateEffect(&lt;SPAN style="color:#000080;font-weight:bold;"&gt;int &lt;/SPAN&gt;angle, IEglUtil eglUtil)
  {
    &lt;SPAN style="color:#000080;font-weight:bold;"&gt;super&lt;/SPAN&gt;(angle, eglUtil);
  }
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 16:41:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999477#M4854</guid>
      <dc:creator>Liron_K_</dc:creator>
      <dc:date>2015-05-12T16:41:17Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999478#M4855</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We have Media for Mobile which includes feature support for joining two videos captured. You can download Media for Mobile from INDE here:&amp;nbsp;https://software.intel.com/en-us/intel-inde and samples from&amp;nbsp;https://software.intel.com/en-us/media-for-mobile-support/code-samples&lt;/P&gt;

&lt;P&gt;You can align videos before using the joining feature from Media for mobile. Currently we do not support rotate feature effect. In regard to performance&lt;SPAN lang="EN" style="font-size: 9.5pt; font-family: Arial, sans-serif;"&gt;\fps differ from device to device in capturing scenario.&amp;nbsp;&lt;/SPAN&gt;Most of devices give normal performance, but there are several exceptions depending on the device.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 20:16:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999478#M4855</guid>
      <dc:creator>Harshdeep_B_Intel</dc:creator>
      <dc:date>2015-05-12T20:16:49Z</dc:date>
    </item>
    <item>
      <title>Please see the code in my</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999479#M4856</link>
      <description>&lt;P&gt;Please see the code in my original post. I am using Media for Mobile, but not getting the effect that I need.&lt;/P&gt;

&lt;P&gt;Since the videos that I have as inputs have different rotations (the front camera is rotated 90 and the back camera is rotated 270) when I join them together without using the RotateEffect, the are both rotated sideways (in opposite directions). Once I add the Rotate effect, then the front camera is rotated correctly and the back camera is upside down.&lt;/P&gt;

&lt;P&gt;Also, the code that I have above on a Samsung S4 takes about 10 seconds to run to join 2 10 second videos, which doesn't seem very good to me.&lt;/P&gt;

&lt;P&gt;Sincerely,&lt;BR /&gt;
	Liron&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 00:05:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999479#M4856</guid>
      <dc:creator>Liron_K_</dc:creator>
      <dc:date>2015-05-13T00:05:23Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999480#M4857</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please provide us the snapshots of the video when joined by using/not using RotateEffect. Let me check with our team and update you in regard to performance on a Samsung S4 device.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 00:19:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999480#M4857</guid>
      <dc:creator>Harshdeep_B_Intel</dc:creator>
      <dc:date>2015-05-13T00:19:37Z</dc:date>
    </item>
    <item>
      <title>Videos attached.</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999481#M4858</link>
      <description>&lt;P&gt;Videos attached.&lt;/P&gt;

&lt;P&gt;You can see that in either case, the output is wrong, unfortunately. The one input video has a rotation of 90 and the other one has a rotation of 270, which is what the android Camera is generating when doing the record.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 05:53:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999481#M4858</guid>
      <dc:creator>Liron_K_</dc:creator>
      <dc:date>2015-05-13T05:53:57Z</dc:date>
    </item>
    <item>
      <title>Hi Liron,</title>
      <link>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999482#M4859</link>
      <description>&lt;P&gt;Hi Liron,&lt;/P&gt;

&lt;P&gt;In order to correct rotation you have to change&lt;/P&gt;

&lt;PRE class="brush:java;"&gt;//Fix rotation;
RotateEffect effect = new RotateEffect(angle, EglUtil.getInstance());
effect.setSegment(new Pair&amp;lt;Long, Long&amp;gt;(0L, 0L));&amp;nbsp; // Apply to all stream
composer.addVideoEffect(effect);
&lt;/PRE&gt;

&lt;P&gt;to something like this:&lt;/P&gt;

&lt;PRE class="brush:java;" style="color: rgb(0, 0, 0); font-family: &amp;quot;Courier New&amp;quot;; background-color: rgb(255, 255, 255);"&gt;//Fix rotation;
RotateEffect effect1 = new RotateEffect(&amp;lt;angle1&amp;gt;, EglUtil.getInstance());
effect1.setSegment(new FileSegment(0L, &amp;lt;duration1&amp;gt;));&amp;nbsp; // Apply to 1st stream
composer.addVideoEffect(effect1);

RotateEffect effect2 = new RotateEffect((&amp;lt;angle2&amp;gt;, EglUtil.getInstance());
effect2.setSegment(new FileSegment(&amp;lt;duration1&amp;gt;, &amp;lt;duration2&amp;gt;));&amp;nbsp; // Apply to 2nd stream
composer.addVideoEffect(effect2);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;What performance do you really expect? 2x real-time seems quite good for me&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 07:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Media-Intel-Video-Processing/Joining-videos-together-with-rotation/m-p/999482#M4859</guid>
      <dc:creator>Nikolay_A_Intel</dc:creator>
      <dc:date>2015-05-14T07:29:00Z</dc:date>
    </item>
  </channel>
</rss>

