title: How to merge two video parts and get a playable video file using Python?
body: <p>Here, I actually wants to merge two strings out1 &amp; out2 (which contains the first and second 30sec long video data) and write that to a file. So that I will get a 1min long playable video file. But what I am getting is the first 30sec video only. How should I edit this code to achieve that ? Please help me. Thanks a lot in advance.</p>
  
  <pre><code>import subprocess,os
  
  ffmpeg_command1 = ["ffmpeg", "-i", "PATH/connect.webm", "-vcodec", "copy", "-ss", "00:00:00", "-t", "00:00:30","-f", "webm", "pipe:1"]
  
  p1 = subprocess.Popen(ffmpeg_command1,stdout=subprocess.PIPE)
  
  out1, err = p1.communicate()
  
  ffmpeg_command2 = ["ffmpeg", "-i", "PATH/connect.webm","-vcodec", "copy", "-ss", "00:00:31", "-t", "00:00:30","-f", "webm", "pipe:1"]
  
  p2 = subprocess.Popen(ffmpeg_command2,stdout=subprocess.PIPE)
  
  out2, err1 = p2.communicate()
  
  string = out1 + out2
  
  fname = "PATH/final.webm"
  
  fp = open(fname,'wb')
  
  fp.write(string)
  
  fp.close()
  </code></pre>
  
  <p>Please help me. I struck.</p>