unista
Posts: 12
Joined: Thu Aug 01, 2019 9:49 am

Variation of framerate

Thu Dec 26, 2019 1:55 pm

Hello everyone,

I am trying to make a program that can allow me to stream the picamera and record video in the same time.
When I only record the video for 10 seconds (resolution : 1280 x 720 / framerate : 60fps) I get 599 frames in total, so it is ok! But, when I stream in the same time, I get 396 frames (more or less).
Is someone know why the framerate change when I record and stream in the same time ?

To be able to record and stream, I use use 2 times the start_recording method with 2 differents splitter_port.

My code is this one https://picamera.readthedocs.io/en/rele ... -streaming with an other start_recording.



Thanks in advance for you help

unista
Posts: 12
Joined: Thu Aug 01, 2019 9:49 am

Re: Variation of framerate

Fri Dec 27, 2019 1:50 pm

Something else : I tried to record a video during 15 seconds at 30fps and the size of the .h264 file is about 30Mb. When I do the same at 60fps, the size is about 20Mb.
Has someone an explanation about how it is possible ?

unista
Posts: 12
Joined: Thu Aug 01, 2019 9:49 am

Re: Variation of framerate

Tue Dec 31, 2019 7:59 am

No one has any idea ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24924
Joined: Sat Jul 30, 2011 7:41 pm

Re: Variation of framerate

Tue Dec 31, 2019 9:20 am

unista wrote:
Fri Dec 27, 2019 1:50 pm
Something else : I tried to record a video during 15 seconds at 30fps and the size of the .h264 file is about 30Mb. When I do the same at 60fps, the size is about 20Mb.
Has someone an explanation about how it is possible ?
Depends on the scene. Higher frame rates mean fewer differences between frames, which means less data required to represent those differences. But does depend on what is happening in the scene.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

MacAttack
Posts: 8
Joined: Wed Dec 25, 2019 4:57 am

Re: Variation of framerate

Tue Dec 31, 2019 10:30 pm

H264 also has a variable compression factor. I would not be surprised if a higher frame rate also results in more compression, at least with a Picamera, to keep the data rate to a reasonable level.

unista
Posts: 12
Joined: Thu Aug 01, 2019 9:49 am

Re: Variation of framerate

Fri Jan 03, 2020 8:17 am

Thank you Jamesh and MacAttack for your answers.

To be more precise in my description, I am using also a web server write with python (SimpleHTTPServer). If the server is running, I can record at 60fps during 15 seconds and get at the end only 10 seconds for example. If the server is not running, there is no problem.

Jamesh, I am thinking that I lost data because as I write above the final time is not the correct one..

Best regards

Return to “Camera board”