pi_streaming icon indicating copy to clipboard operation
pi_streaming copied to clipboard

Use with Picamera2?

Open rsrawley opened this issue 1 year ago • 4 comments

Any chance you could adapt this to work with the new Picamera2 library? I've tried, but the docs are full of examples and don't show much of the syntax. This is needed to use the new module 3 camera. Great job on this as it stands!

rsrawley avatar Apr 30 '23 13:04 rsrawley

Chiming in here. This would be awesome. My python skills are below zero, but I think it needs something like this:

import picamera2
from picamera2.encoders import H264Encoder

in def stream

    with picamera2.Picamera2() as camera:
        camera.configure(camera.create_video_configuration(main={"size": (640, 480)}))

also this (but I think this is wrong somehow:

        frame_buffer = FrameBuffer()
        encoder = H264Encoder(qp=30)
        camera.capture_file(frame_buffer, format='jpeg')
        camera.start_recording(encoder, frame_buffer)

woutersf avatar Jul 07 '23 11:07 woutersf

https://github.com/vuquangtrong/pi_streaming/compare/main...woutersf:pi_streaming:main

woutersf avatar Jul 07 '23 12:07 woutersf

the above changes give me a working page but the stream seems not to work. image

woutersf avatar Jul 07 '23 12:07 woutersf

Hey, how is going? Did you make it work? Cheers.

Cylon-interrogator avatar Aug 10 '23 21:08 Cylon-interrogator