eniovasconcellos
Posts: 4
Joined: Tue Oct 01, 2019 2:36 pm

Picamera too fast in playback

Tue Oct 01, 2019 2:54 pm

Hi everybody! I am trying to record a video in python with the code below. I am having an ultra fast playback in the output.file. seems that the framerate setup is ignored by the player (any). I tryed to convert to various formats but nothing solves the problem. the video stills goes fast as the player can run. in the raspivid command line everything goes well. (correct framerate) but in python sucks :roll: . can somebody helpe me?

Code: Select all

from picamera import PiCamera
from time import sleep
import datetime as dt

camera=PiCamera()
time = dt.datetime.now()
camera.resolution = (720, 480)
camera.start_preview()
camera.annotate_text = dt.datetime.now().strftime("CTA %d-%m-%Y %H:%M:%S")
camera.start_recording("/home/pi/Desktop/video.h264")
start = dt.datetime.now()
while (dt.datetime.now() - start).seconds <60:
    camera.annotate_text = dt.datetime.now().strftime("CTA %d-%m-%Y %H:%M:%S")
    camera.wait_recording(0.2)

#camera.annotate_text = dt.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
#camera.wait_recording(5)
camera.stop_recording()
camera.stop_preview()
print (time)

# dt.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

eniovasconcellos
Posts: 4
Joined: Tue Oct 01, 2019 2:36 pm

Re: Picamera too fast in playback

Thu Oct 03, 2019 11:35 am

I tryed to convert h264 to mp4 using MP4Box. I found that conversion only works when mp4 is generated from the raspivid command. When the file comes from "camera.start_recording" (Python) the framerate does not change, continues too fast. Problem with picamera?

eniovasconcellos
Posts: 4
Joined: Tue Oct 01, 2019 2:36 pm

Re: Picamera too fast in playback

Fri Oct 04, 2019 11:25 am

I am considering that the problem is the loss of frames while writing to sdcard...

Return to “Camera board”