How to modify imxv4l2videosrc's Properties,such as crop-meta-width and crop-meta-height

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify imxv4l2videosrc's Properties,such as crop-meta-width and crop-meta-height

Jump to solution
557 Views
adorable
Contributor III

My problem:when the pipeline is playing,I want to modifyed imxv4l2videosrc's properities,crop-meta-width and crop-meta-height.In my c-code, I used g_object_set() to changed properites,without err,but not worked.But at the beginning of playing, properities with crop-meta-width and crop-meta-height worked well.

My question: How I could modified imxv4l2videosrc's properities:crop-meta-width and crop-meta-height when the pipeline is paused or playing.

Or how I could replace imxv4l2videosrc with imxv4l2videosrc ,properities different.

Pipeline:imxv4l2videosrc device=/dev/video1 crop-meta-width=640 crop-meta-height=480 ! overlaysink

0 Kudos
1 Solution
515 Views
adorable
Contributor III

This topic has been solved through modifyed replace imxv4l2videosrc with imxv4l2videosrc crop-meta-width=x crop-meta-height=x.Such as follows:

gst_element_set_state(data->src, GST_STATE_PAUSED);
remove_element_src(data);
create_element_src(data);
gst_element_set_state(data->src, GST_STATE_PLAYING);

The full code in git bellow as:

https://github.com/tttg/replace_videosrc.git

 

View solution in original post

0 Kudos
5 Replies
516 Views
adorable
Contributor III

This topic has been solved through modifyed replace imxv4l2videosrc with imxv4l2videosrc crop-meta-width=x crop-meta-height=x.Such as follows:

gst_element_set_state(data->src, GST_STATE_PAUSED);
remove_element_src(data);
create_element_src(data);
gst_element_set_state(data->src, GST_STATE_PLAYING);

The full code in git bellow as:

https://github.com/tttg/replace_videosrc.git

 

0 Kudos
552 Views
joanxie
NXP TechSupport
NXP TechSupport

what board do you use? refer to the latest yocto user guide, current gstreamer doesn't use imxv4l2videosrc:

VPU video encoding only works on SoC with VPU encoder support. imxv4l2src is only supported on i.MX 6 and i.MX 7. i. MX 8 supports opensource plugin v4l2src as camera source

 

0 Kudos
548 Views
adorable
Contributor III

Hi,using the latest gstreamer-imx from your git,which means only imxv4l2videosrc support imxg2dcompositor,but imxv4l2src doesnot support this.

So,we use imxv4l2videosrc and has been cuccessed composite video0 and video1 to one streamer out.

The problem now is videox's scale,because using imxg2dcompositor,which specified physical address continuelly,so coundnot use videoscale,so we want to use imxv4l2videosrc's properities:crop-meta-width and crop-meta-height.

0 Kudos
544 Views
joanxie
NXP TechSupport
NXP TechSupport

try to use gst-inpect-1.0 imxv4l2videosrc  to check all of parameters for imxv4l2videosrc

 

0 Kudos
534 Views
adorable
Contributor III

root@Hzncc:~# gst-inspect-1.0 imxv4l2videosrc
Factory Details:
Rank primary (256)
Long-name V4L2 CSI Video Source
Klass Source/Video
Description Capture video streams using V4L2 CSI interface
Author Philip Craig <phil@blackmoth.com.au>

Plugin Details:
Name imxv4l2video
Description GStreamer i.MX Video4Linux2 elements
Filename /usr/lib/gstreamer-1.0/libgstimxv4l2video.so
Version 0.13.1
License LGPL
Source module gstreamer-imx
Binary package Unknown package release
Origin URL Unknown package origin

GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstPushSrc
+----GstImxV4l2VideoSrc

Implemented Interfaces:
GstURIHandler
GstPhotography

Pad Templates:
SRC template: 'src'
Availability: Always
Capabilities:
video/x-raw


Element Flags:
no flags set

Element Implementation:
Has change_state() function: gst_base_src_change_state

Element has no clocking capabilities.

URI handling capabilities:
Element can act as source.
Supported URI protocols:
imxv4l2

Pads:
SRC: 'src'
Pad Template: 'src'

Element Properties:
analog-gain : Analog gain applied to the sensor
flags: readable, writable
Float. Range: 1 - 3.402823e+38 Default: 1
aperture : Aperture defines the size of lens opening (0 = auto)
flags: readable, writable
Unsigned Integer. Range: 0 - 255 Default: 0
capabilities : Tells the photo capabilities of the device
flags: readable
Unsigned Long. Range: 0 - 4294967295 Default: 0 0:00:00.167508667 2443 0xea0c00 ERROR default gst-inspect.c:346:print_element_properties_info: imxv4l2videosrc0: property 'capabilities' of type ulong: consider changing to uint/uint64

color-temperature : Color temperature in Kelvin units for manual white balance
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 0
color-tone-mode : Color tone setting changes color shading in the photo
flags: readable, writable
Enum "GstPhotographyColorToneMode" Default: 0, "normal"
(0): normal - GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL
(1): sepia - GST_PHOTOGRAPHY_COLOR_TONE_MODE_SEPIA
(2): negative - GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEGATIVE
(3): grayscale - GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRAYSCALE
(4): natural - GST_PHOTOGRAPHY_COLOR_TONE_MODE_NATURAL
(5): vivid - GST_PHOTOGRAPHY_COLOR_TONE_MODE_VIVID
(6): colorswap - GST_PHOTOGRAPHY_COLOR_TONE_MODE_COLORSWAP
(7): solarize - GST_PHOTOGRAPHY_COLOR_TONE_MODE_SOLARIZE
(8): out-of-focus - GST_PHOTOGRAPHY_COLOR_TONE_MODE_OUT_OF_FOCUS
(9): sky-blue - GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKY_BLUE
(10): grass-green - GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRASS_GREEN
(11): skin-whiten - GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKIN_WHITEN
(12): posterize - GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE
(13): whiteboard - GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD
(14): blackboard - GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD
(15): aqua - GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA
ev-compensation : EV compensation affects the brightness of the image
flags: readable, writable
Float. Range: -2.5 - 2.5 Default: 0
exposure-time : Exposure time defines how long the shutter will stay open (0 = auto)
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 0
flash-mode : Flash mode defines how the flash light should be used
flags: readable, writable
Enum "GstPhotographyFlashMode" Default: 0, "auto"
(0): auto - GST_PHOTOGRAPHY_FLASH_MODE_AUTO
(1): off - GST_PHOTOGRAPHY_FLASH_MODE_OFF
(2): on - GST_PHOTOGRAPHY_FLASH_MODE_ON
(3): fill-in - GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN
(4): red-eye - GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE
flicker-mode : Flicker reduction mode defines a line frequency for flickering prevention
flags: readable, writable
Enum "GstPhotographyFlickerReductionMode" Default: 0, "off"
(0): off - GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF
(1): 50hz - GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ
(2): 60hz - GST_PHOTOGRAPHY_FLICKER_REDUCTION_60HZ
(3): auto - GST_PHOTOGRAPHY_FLICKER_REDUCTION_AUTO
focus-mode : Focus mode defines the range of focal lengths to use in autofocus search
flags: readable, writable
Enum "GstPhotographyFocusMode" Default: 0, "auto"
(0): auto - GST_PHOTOGRAPHY_FOCUS_MODE_AUTO
(1): macro - GST_PHOTOGRAPHY_FOCUS_MODE_MACRO
(2): portrait - GST_PHOTOGRAPHY_FOCUS_MODE_PORTRAIT
(3): infinity - GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY
(4): hyperfocal - GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL
(5): extended - GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED
(6): continuous-normal - GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL
(7): continuous-extended - GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED
(8): manual - GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL
image-capture-supported-caps: Caps describing supported image capture formats
flags: readable
Caps (NULL)
image-preview-supported-caps: Caps describing supported image preview formats
flags: readable
Caps (NULL)
iso-speed : ISO speed defines the light sensitivity (0 = auto)
flags: readable, writable
Unsigned Integer. Range: 0 - 6400 Default: 0
lens-focus : Focus point in diopter units
flags: readable, writable
Float. Range: 0 - 3.402823e+38 Default: 0
max-exposure-time : Maximum exposure time for automatic exposure mode
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 0
min-exposure-time : Minimum exposure time for automatic exposure mode
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 0
noise-reduction : Which noise reduction modes are enabled (0 = disabled)
flags: readable, writable
Flags "GstPhotographyNoiseReduction" Default: 0x00000000, "(none)"
(0x00000001): bayer - GST_PHOTOGRAPHY_NOISE_REDUCTION_BAYER
(0x00000002): ycc - GST_PHOTOGRAPHY_NOISE_REDUCTION_YCC
(0x00000004): temporal - GST_PHOTOGRAPHY_NOISE_REDUCTION_TEMPORAL
(0x00000008): fixed - GST_PHOTOGRAPHY_NOISE_REDUCTION_FIXED
(0x00000010): extra - GST_PHOTOGRAPHY_NOISE_REDUCTION_EXTRA
scene-mode : Scene mode works as a preset for different photo shooting mode settings
flags: readable, writable
Enum "GstPhotographySceneMode" Default: 15329208, ""
(0): manual - GST_PHOTOGRAPHY_SCENE_MODE_MANUAL
(1): closeup - GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP
(2): portrait - GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT
(3): landscape - GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE
(4): sport - GST_PHOTOGRAPHY_SCENE_MODE_SPORT
(5): night - GST_PHOTOGRAPHY_SCENE_MODE_NIGHT
(6): auto - GST_PHOTOGRAPHY_SCENE_MODE_AUTO
(7): action - GST_PHOTOGRAPHY_SCENE_MODE_ACTION
(8): night-portrait - GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT
(9): theatre - GST_PHOTOGRAPHY_SCENE_MODE_THEATRE
(10): beach - GST_PHOTOGRAPHY_SCENE_MODE_BEACH
(11): snow - GST_PHOTOGRAPHY_SCENE_MODE_SNOW
(12): sunset - GST_PHOTOGRAPHY_SCENE_MODE_SUNSET
(13): steady-photo - GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO
(14): fireworks - GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS
(15): party - GST_PHOTOGRAPHY_SCENE_MODE_PARTY
(16): candlelight - GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT
(17): barcode - GST_PHOTOGRAPHY_SCENE_MODE_BARCODE
white-balance-mode : White balance affects the color temperature of the photo
flags: readable, writable
Enum "GstPhotographyWhiteBalanceMode" Default: 0, "auto"
(0): auto - GST_PHOTOGRAPHY_WB_MODE_AUTO
(1): daylight - GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT
(2): cloudy - GST_PHOTOGRAPHY_WB_MODE_CLOUDY
(3): sunset - GST_PHOTOGRAPHY_WB_MODE_SUNSET
(4): tungsten - GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN
(5): fluorescent - GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT
(6): manual - GST_PHOTOGRAPHY_WB_MODE_MANUAL
(7): warm-fluorescent - GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT
(8): shade - GST_PHOTOGRAPHY_WB_MODE_SHADE
white-point : Describe color white as raw values
flags: readable, writable
Array of GValues of type "guint"
zoom : How much the resulted image will be zoomed
flags: readable, writable
Float. Range: 1 - 10 Default: 1
name : The name of the object
flags: readable, writable
String. Default: "imxv4l2videosrc0"
parent : The parent of the object
flags: readable, writable
Object of type "GstObject"
blocksize : Size in bytes to read per buffer (-1 = default)
flags: readable, writable
Unsigned Integer. Range: 0 - 4294967295 Default: 4096
num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)
flags: readable, writable
Integer. Range: -1 - 2147483647 Default: -1
typefind : Run typefind before negotiating
flags: readable, writable
Boolean. Default: false
do-timestamp : Apply current stream time to buffers
flags: readable, writable
Boolean. Default: false
imx-capture-mode : Capture mode of camera, varies with each v4l2 driver,
for example ov5460:
ov5640_mode_VGA_640_480 = 0,
ov5640_mode_QVGA_320_240 = 1,
ov5640_mode_NTSC_720_480 = 2,
ov5640_mode_PAL_720_576 = 3,
ov5640_mode_720P_1280_720 = 4,
ov5640_mode_1080P_1920_1080 = 5
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 0
fps-n : (Obsolete; use fps property instead) Numerator of the framerate at which the input stream is to be captured
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 30
fps : Framerate at which the input stream is to be captured
flags: readable, writable
Fraction. Range: 0/1 - 2147483647/1 Default: 30/1
input : Video input selected with VIDIOC_S_INPUT
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 1
device : Device location
flags: readable, writable
String. Default: "/dev/video0"
num-additional-buffers: Number of additional V4L2 buffers to allocate in the buffer pool (only used if the allocation query's min value is nonzero)
flags: readable, writable
Unsigned Integer. Range: 1 - 4294967295 Default: 1
queue-size : Number of V4L2 buffers to request
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 6
crop-meta-x : X value for crop metadata
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 0
crop-meta-y : Y value for crop metadata
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 0
crop-meta-width : WIDTH value for crop metadata
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 0
crop-meta-height : HEIGHT value for crop metadata
flags: readable, writable
Integer. Range: 0 - 2147483647 Default: 0

0 Kudos