title: Raspberry Pi camera writing permissions
body: <p>When writing a python script to take a picture every minute on the Pi, it spits out this error :</p>
  
  <p>"mmal: main: Error opening output file:"</p>
  
  <p>Python code:</p>
  
  <pre><code>jpeg_list = open('jpeg_still_list.txt','w')
  count = 0
  tlcount = 0
  while True:
      os.system("raspistill -w 1920 -h 1080 -q 80 -o frames/%s.jpg" % count)
      jpeg_list.write("frames%s.jpg" % count)
      time.sleep(60)
      count = count+1
  
      if count == 180:
          count = 0
  
          os.system("mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o %s -mf type=jpeg:fps=24 mf://@jpeg_still_list.txt" %"lol")
  </code></pre>
  
  <p>I have googled the problem extensively, I came across this other stack overflow answer, which may be what i need to do.</p>
  
  <p><a href="https://raspberrypi.stackexchange.com/questions/24460/how-to-write-raspistill-image-to-usb-drive">https://raspberrypi.stackexchange.com/questions/24460/how-to-write-raspistill-image-to-usb-drive</a></p>
  
  <p>But I think the file they are changing has changed format, because its not quite clear how to do that.</p>
  
  <p>I have tried runnign it using sudo and superuser.</p>
  
  <p>Thanks for your help!</p>