title: How to execute multiple shell commands in android (non rooted device)?
body: <p>I am trying to execute two commands in my android app as given below : </p>
  
  <pre><code>Process process1 = Runtime.getRuntime().exec("ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts");
  process1.waitFor();
  
  Process process2 = r.exec("ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts");
  process2.waitFor();
  </code></pre>
  
  <p>But only the first command gets executed. The device is <strong>not rooted</strong>. How can i execute multiple commands?</p>
  
  <p><em>PS</em> : Went through various questions related to this but they are mostly for rooted devices and work using <code>su</code></p>