Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME #4647

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

soyersoyer
Copy link
Contributor

No description provided.

@6by9
Copy link
Contributor

6by9 commented Oct 23, 2021

Thanks for the PR.

A max of 40? I thought QP went up to 51.
I'd want to check whether the min was 0 or 1 as well.

@soyersoyer
Copy link
Contributor Author

I didn't find good documentation for MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT. The value 40 comes from the picamera docs.
Setting MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT to 0 doesn't work. What is the MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT's default value?

@6by9
Copy link
Contributor

6by9 commented Oct 23, 2021

https://vcodex.blogspot.com/2009/04/h264-quantization-parameter.html

Quantization in an H.264 encoder is controlled by a quantization parameter, QP, that ranges from 0 to 51. QP is an index used to derive a scaling matrix. It is possible to calculate the equivalent quantizer step size (Qstep) for each value of QP (see my tutorial on H.264 4x4 transform). As QP increases, Qstep increases; in fact, Qstep doubles for every increase of 6 in QP. The logarithmic relationship can be seen in this graph of QP (x-axis, linear) vs. Qstep (y-axis, logarithmic).

So I would expect it to support the full range. The smaller the QP the larger the output frame.
I'll check the firmware source when I get a chance.

@soyersoyer
Copy link
Contributor Author

soyersoyer commented Oct 23, 2021

It works within the full range. I can't set them to 0, while the camera is streaming, but otherwise it works.

@6by9
Copy link
Contributor

6by9 commented Oct 23, 2021

Great. That looks fine to me.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
@soyersoyer soyersoyer changed the title staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME Oct 24, 2021
@pelwell pelwell merged commit 6cfe1a8 into raspberrypi:rpi-5.10.y Oct 25, 2021
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 25, 2021
kernel: ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
See: raspberrypi/linux#4652

kernel: media: bcm2835-codec: Limit video callbacks
See: raspberrypi/linux#4646

kernel: staging/bcm2835-camera: Add support for H264_MIN_QP, H264_MAX_QP, MPEG_VIDEO_FORCE_KEY_FRAME
See: raspberrypi/linux#4647

kernel: bcm2835-isp: Colorspace fixes
See: raspberrypi/linux#4643

kernel: Unicam Media Controller support
See: raspberrypi/linux#4641

kernel: config: Enable FSFS_FS_SECURITY
See: raspberrypi/linux#4637

kernel: gpio: bcm-virt: Fix the get() method
See: raspberrypi/linux#4638

firmware: userland: Reduce debug_sym error messages
See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238

firmware: arm_dt: Increase maximum line length to 98
See: raspberrypi/linux#4638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants