title: FFMPEG convert .avi into playable iOS movie mp4
body: <p>I'm trying to convert an avi file which is h264 encoded baseline4.0 to a new h264 mpeg file that is encoded with baseline3.</p>
  <p>The file original file is not playable on any iOS device, due to baseline4.0 (I think?)</p>
  <p>I'm using this wrapper class here <a href="https://github.com/OpenWatch/FFmpegWrapper" rel="nofollow noreferrer">https://github.com/OpenWatch/FFmpegWrapper</a></p>
  <p>but actually I have no clue how to set baseline. I can convert to mpeg4, but it seems that defaults everytime to baseline4.0.</p>
  <p>I tried to set it on the AVCodecContext</p>
  <pre><code>AVCodecContext *outputCodecContext = outputStream-&gt;codec;
  outputCodecContext-&gt;level = 31;
  outputCodecContext-&gt;profile = FF_PROFILE_H264_BASELINE;
  </code></pre>
  <p>but this has no effect.</p>
  <p>Perhaps anybody has a clue, or has a better FFMPEGWrapper.</p>
  <p><strong>Specs from original video:</strong>
  <a href="https://i.stack.imgur.com/4RwMJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4RwMJ.png" alt="original video" /></a></p>