Raspberry Pi camera writing permissions

Jonathan Abrahams

When writing a python script to take a picture every minute on the Pi, it spits out this error :

"mmal: main: Error opening output file:"

Python 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")

I have googled the problem extensively, I came across this other stack overflow answer, which may be what i need to do.

https://raspberrypi.stackexchange.com/questions/24460/how-to-write-raspistill-image-to-usb-drive

But I think the file they are changing has changed format, because its not quite clear how to do that.

I have tried runnign it using sudo and superuser.

Thanks for your help!

Padraic Cunningham

Use the subprocess module, in particular check_call:

with open('jpeg_still_list.txt', 'w') as jpeg_list:
    from subprocess import check_call  
    count = 0
    tlcount = 0
    while True:
        check_call(["raspistill", "-w", "1920", "-h",
                    "1080", "-q", "80", "-o", "frames{}.jpg".format(count)])
        jpeg_list.write("frames{}.jpg".format(count))
        time.sleep(60)
        count += 1
        if count == 180:
            count = 0
        check_call(["mencoder", "-nosound", "-ovc", "lavc", "-lavcopts",
                    "vcodec=mpeg4:aspect=16/9:vbitrate=8000000", "-vf",
                    "scale=1920:1080", "-o", "lol", "-mf",
                    "type=jpeg:fps=24", "mf://@jpeg_still_list.txt"])

frames/ means you want to open the .jpg file in the frames directory which does not exist so you get the error, remove the /.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Pi camera preview with GUI - Raspberry Pi

From Dev

OpenCV multiple USB camera on Raspberry Pi 3

From Dev

Integrating Raspberry Pi Camera with Qt application

From Dev

Handle Raspberry Pi camera via Apache

From Dev

Raspberry Pi Camera auto capture python script

From Dev

Ubuntu Server with Raspberry Pi Motion Camera

From Dev

Integrating Raspberry Pi Camera with Qt application

From Dev

Ubuntu Server with Raspberry Pi Motion Camera

From Dev

Which camera to connect with Raspberry pi2

From Dev

Get Raspberry Pi Camera Feed into Darknet and Yolo

From Dev

raspberry pi : writing Linux device driver

From Dev

Writing assembly code for raspberry Pi, MinGW error

From Dev

Display to Raspberry Pi HDMI From Raspberry Pi Camera using C++

From Dev

Raspberry Pi GPIO /value file appears with wrong permissions momentarily

From Dev

Default file permissions for FAT32 USB stick on Raspberry Pi

From Dev

Raspberry Pi GPIO /value file appears with wrong permissions momentarily

From Dev

how to set the camera in raspberry pi to take black and white image?

From Dev

Capture video from camera on Raspberry Pi and filter in OpenGL before encoding

From Dev

Controlling USB web camera photo capture time on Raspberry Pi and Python

From Dev

Raspberry Pi camera GPIO...close statement causing error

From Dev

Possible approaches to stream video from an IP camera to chromecast or raspberry pi

From Dev

Controlling USB web camera photo capture time on Raspberry Pi and Python

From Dev

Using camera shutter to trigger MPU6050 on raspberry pi

From Dev

Access Live Stream with Raspberry Pi Camera Module on Web Browser using NodeJS?

From Dev

Raspberry Pi 1B, mjpg-streamer and USB web camera

From Dev

Raspberry Pi 1B, mjpg-streamer and USB web camera

From Dev

Ball tracker using OpenCV, Python and Raspberry Pi 3 w/ camera module

From Dev

Experience writing C-code for PCF8575 I/O-Expander on Raspberry Pi

From Dev

Raspberry Pi provider for Vagrant?

Related Related

  1. 1

    Pi camera preview with GUI - Raspberry Pi

  2. 2

    OpenCV multiple USB camera on Raspberry Pi 3

  3. 3

    Integrating Raspberry Pi Camera with Qt application

  4. 4

    Handle Raspberry Pi camera via Apache

  5. 5

    Raspberry Pi Camera auto capture python script

  6. 6

    Ubuntu Server with Raspberry Pi Motion Camera

  7. 7

    Integrating Raspberry Pi Camera with Qt application

  8. 8

    Ubuntu Server with Raspberry Pi Motion Camera

  9. 9

    Which camera to connect with Raspberry pi2

  10. 10

    Get Raspberry Pi Camera Feed into Darknet and Yolo

  11. 11

    raspberry pi : writing Linux device driver

  12. 12

    Writing assembly code for raspberry Pi, MinGW error

  13. 13

    Display to Raspberry Pi HDMI From Raspberry Pi Camera using C++

  14. 14

    Raspberry Pi GPIO /value file appears with wrong permissions momentarily

  15. 15

    Default file permissions for FAT32 USB stick on Raspberry Pi

  16. 16

    Raspberry Pi GPIO /value file appears with wrong permissions momentarily

  17. 17

    how to set the camera in raspberry pi to take black and white image?

  18. 18

    Capture video from camera on Raspberry Pi and filter in OpenGL before encoding

  19. 19

    Controlling USB web camera photo capture time on Raspberry Pi and Python

  20. 20

    Raspberry Pi camera GPIO...close statement causing error

  21. 21

    Possible approaches to stream video from an IP camera to chromecast or raspberry pi

  22. 22

    Controlling USB web camera photo capture time on Raspberry Pi and Python

  23. 23

    Using camera shutter to trigger MPU6050 on raspberry pi

  24. 24

    Access Live Stream with Raspberry Pi Camera Module on Web Browser using NodeJS?

  25. 25

    Raspberry Pi 1B, mjpg-streamer and USB web camera

  26. 26

    Raspberry Pi 1B, mjpg-streamer and USB web camera

  27. 27

    Ball tracker using OpenCV, Python and Raspberry Pi 3 w/ camera module

  28. 28

    Experience writing C-code for PCF8575 I/O-Expander on Raspberry Pi

  29. 29

    Raspberry Pi provider for Vagrant?

HotTag

Archive