-
Notifications
You must be signed in to change notification settings - Fork 8k
video: add video compression support to tcpserversink sample #95862
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
base: main
Are you sure you want to change the base?
Changes from all commits
ae1dfbb
2e9c2b0
ce9469b
81bc8e5
e5aaab5
4adeb03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# Copyright (c) 2025 STMicroelectronics. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
mainmenu "TCP camera streaming sample application" | ||
|
||
menu "Video capture configuration" | ||
|
||
config VIDEO_SOURCE_CROP_LEFT | ||
int "Crop area left value" | ||
default 0 | ||
help | ||
Left value of the crop area within the video source. | ||
|
||
config VIDEO_SOURCE_CROP_TOP | ||
int "Crop area top value" | ||
default 0 | ||
help | ||
Top value of the crop area within the video source. | ||
|
||
config VIDEO_SOURCE_CROP_WIDTH | ||
int "Crop area width value" | ||
default 0 | ||
help | ||
Width value of the crop area within the video source. | ||
If set to 0, the crop is not applied. | ||
|
||
config VIDEO_SOURCE_CROP_HEIGHT | ||
int "Crop area height value" | ||
default 0 | ||
help | ||
Height value of the crop area within the video source. | ||
If set to 0, the crop is not applied. | ||
|
||
config VIDEO_FRAME_HEIGHT | ||
int "Height of the video frame" | ||
default 0 | ||
help | ||
Height of the video frame. If set to 0, the default height is used. | ||
|
||
config VIDEO_FRAME_WIDTH | ||
int "Width of the video frame" | ||
default 0 | ||
help | ||
Width of the video frame. If set to 0, the default width is used. | ||
|
||
config VIDEO_PIXEL_FORMAT | ||
string "Pixel format of the video frame" | ||
help | ||
Pixel format of the video frame. If not set, the default pixel format is used. | ||
|
||
config VIDEO_CAPTURE_N_BUFFERING | ||
int "Capture N-buffering" | ||
default 2 | ||
help | ||
Framerate versus memory usage tradeoff. | ||
"2" allows to capture while sending data (optimal framerate). | ||
"1" allows to reduce memory usage but capture framerate is lower. | ||
If not set defaults to "2". | ||
|
||
config VIDEO_CTRL_HFLIP | ||
bool "Mirror the video frame horizontally" | ||
help | ||
If set, mirror the video frame horizontally | ||
|
||
config VIDEO_CTRL_VFLIP | ||
bool "Mirror the video frame vertically" | ||
help | ||
If set, mirror the video frame vertically | ||
|
||
config VIDEO_ENCODED_PIXEL_FORMAT | ||
string "Pixel format of the encoded frame" | ||
default VIDEO_PIX_FMT_H264 | ||
help | ||
Compression format used by the video encoder if enabled. | ||
If not set defaults to H264 video bitstream with startcodes. | ||
|
||
endmenu | ||
|
||
source "Kconfig.zephyr" |
hfruchet-st marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Video buffer pool | ||
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=10000000 | ||
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=10 | ||
|
||
# Camera interface | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pRAA" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those 3 DCMIPP / SENSOR related config are not needed since they depend on the sensor and moreover are already set within the boards/shields/st_b_cams_imx_mb1854/Kconfig.defconfig which is applied when selecting the st_b_cams_imx_mb1854 shield |
||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=2592 | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=1944 | ||
CONFIG_FPU=y | ||
|
||
# Capture | ||
CONFIG_VIDEO_FRAME_WIDTH=1920 | ||
CONFIG_VIDEO_FRAME_HEIGHT=1080 | ||
CONFIG_VIDEO_PIXEL_FORMAT="NV12" | ||
CONFIG_VIDEO_CAPTURE_N_BUFFERING=2 | ||
|
||
# Video encoder | ||
CONFIG_MAIN_STACK_SIZE=4096 | ||
CONFIG_VIDEO_ENCODED_PIXEL_FORMAT="H264" | ||
|
||
# Network buffers | ||
CONFIG_NET_BUF_RX_COUNT=4 | ||
CONFIG_NET_BUF_TX_COUNT=8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Video buffer pool | ||
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=10000000 | ||
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=10 | ||
|
||
# Camera interface | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pRAA" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those 3 DCMIPP / SENSOR related config are not needed since they depend on the sensor and moreover are already set within the boards/shields/st_b_cams_imx_mb1854/Kconfig.defconfig which is applied when selecting the st_b_cams_imx_mb1854 shield |
||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=2592 | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=1944 | ||
CONFIG_FPU=y | ||
|
||
# Capture | ||
CONFIG_VIDEO_FRAME_WIDTH=1920 | ||
CONFIG_VIDEO_FRAME_HEIGHT=1080 | ||
CONFIG_VIDEO_PIXEL_FORMAT="NV12" | ||
CONFIG_VIDEO_CAPTURE_N_BUFFERING=2 | ||
|
||
# Video encoder | ||
CONFIG_MAIN_STACK_SIZE=4096 | ||
CONFIG_VIDEO_ENCODED_PIXEL_FORMAT="H264" | ||
|
||
# Network buffers | ||
CONFIG_NET_BUF_RX_COUNT=4 | ||
CONFIG_NET_BUF_TX_COUNT=8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2025 STMicroelectronics. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,videoenc = &venc; | ||
}; | ||
}; | ||
|
||
&venc { | ||
status = "okay"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Video buffer pool | ||
CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=10000000 | ||
CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=10 | ||
|
||
# Camera interface | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_PIXEL_FORMAT="pRAA" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those 3 DCMIPP / SENSOR related config are not needed since they depend on the sensor and moreover are already set within the boards/shields/st_b_cams_imx_mb1854/Kconfig.defconfig which is applied when selecting the st_b_cams_imx_mb1854 shield |
||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_WIDTH=2592 | ||
CONFIG_VIDEO_STM32_DCMIPP_SENSOR_HEIGHT=1944 | ||
CONFIG_FPU=y | ||
|
||
# Capture | ||
CONFIG_VIDEO_FRAME_WIDTH=1920 | ||
CONFIG_VIDEO_FRAME_HEIGHT=1080 | ||
CONFIG_VIDEO_PIXEL_FORMAT="NV12" | ||
CONFIG_VIDEO_CAPTURE_N_BUFFERING=2 | ||
|
||
# Video encoder | ||
CONFIG_MAIN_STACK_SIZE=4096 | ||
CONFIG_VIDEO_ENCODED_PIXEL_FORMAT="H264" | ||
|
||
# Network buffers | ||
CONFIG_NET_BUF_RX_COUNT=4 | ||
CONFIG_NET_BUF_TX_COUNT=8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2025 STMicroelectronics. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zephyr,videoenc = &venc; | ||
}; | ||
}; | ||
|
||
&venc { | ||
status = "okay"; | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.