title: mp4 in VideoView
body: <p>The original format I had for my video file made it not work for any device, so I ran it through ffmpeg to convert it to a type which would be more compatible. Now, it runs on most devices, but there are still a few that give the error "Cannot play this file" </p>
  
  <p>The command i used to convert it was:</p>
  
  <pre><code>ffmpeg -i &lt;INPUT_VIDEO&gt; -c:v libx264 -profile:v baseline -c:a aac -ar 44100 -ac 2 -b:a 128k -movflags faststart output.mp4
  </code></pre>
  
  <p>Are there better conversion parameters I could use to make it universally work with all devices? ( I know that 480x360 h264 works for all devices, but I do not want to give up video quality)</p>
  
  <p>Code that works on certain devices:</p>
  
  <pre><code>public class SplashActivity extends AppCompatActivity {
  
      VideoView videoView;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.splash_screen);
          videoView = (VideoView) findViewById(R.id.video_view);
  
          Uri video = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.splashv4);
          videoView.setVideoURI(video);
  
          videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
              public void onCompletion(MediaPlayer mp) {
                  startNextActivity();
              }
          });
  
          videoView.start();
      }
  
      private void startNextActivity() {
          if (isFinishing())
              return;
          startActivity(new Intent(this, LoginActivity.class));
          finish();
      }
  }
  </code></pre>