<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Metail</title>
    <description>The latest articles on DEV Community by Metail (@metail).</description>
    <link>https://dev.to/metail</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1812%2Fc9f13e6f-3da1-4359-98d3-ab236620f5aa.png</url>
      <title>DEV Community: Metail</title>
      <link>https://dev.to/metail</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/metail"/>
    <language>en</language>
    <item>
      <title>Scaling videos with ffmpeg for App Previews</title>
      <dc:creator>David Gavilan</dc:creator>
      <pubDate>Tue, 25 Feb 2020 14:54:59 +0000</pubDate>
      <link>https://dev.to/metail/scaling-videos-with-ffmpeg-for-app-previews-4c6b</link>
      <guid>https://dev.to/metail/scaling-videos-with-ffmpeg-for-app-previews-4c6b</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;When you upload video previews for your iOS app, they have to be in a specific resolution, usually matching the native resolution of the device. Check: &lt;a href="https://help.apple.com/app-store-connect/?lang=en/#/dev4e413fcb8"&gt;App Preview Resolutions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, your video editor may not support those resolutions natively. When the iPhoneX was released, iMovie didn't support it and iPhoneX captures were exported as &lt;code&gt;750x1334&lt;/code&gt; videos, instead of the native &lt;code&gt;886:1920&lt;/code&gt; of the capture. Supposedly, iMovie has support for App Previews, but the support for latest devices sometimes lag behind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workaround with ffmpeg
&lt;/h2&gt;

&lt;p&gt;You can use ffmpeg to crop and resize videos. I usually do it in 2 steps, because these command line tools can get really convoluted if you try to do it all in one go. Here's what you have to do for the iPhoneX example above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ffmpeg -i iPhoneX-iMovie.mp4 -filter:v "crop=616:1334:68:0" -c:a copy cropped.mp4
ffmpeg -i cropped.mp4 -vf scale=886:1920 -c:a copy iPhoneX-final.mp4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Done. Now your iPhoneX video is ready for the App Store.&lt;/p&gt;

</description>
      <category>ios</category>
    </item>
  </channel>
</rss>
