justinjoy / gst-android-camera

GNU Lesser General Public License v2.1
32 stars 9 forks source link

How can i handle Zoom on the pipeline ahcsrc ? #14

Closed sofien4387 closed 2 years ago

sofien4387 commented 2 years ago

I want to add capabilty to zoom on my pipeline, do you have any idea how can i add it on my ahcsrc pipeline. Thank you in advance

justinjoy commented 2 years ago

ahcsrc has zoom property that takes a float value as a ratio. You can set a float value to the property regardless of pipeline status. However, note that the supported zoom value is varied per android device.

sofien4387 commented 2 years ago

Thank you Justin for your feedback, i have already added this caps to my pipeline but nothing happened and i have already added the caps of flash mode but the same result :

sprintf(pipeline, "ahcsrc device=0 flash-mode=2 zoom=8.0 ! video/x-raw,format=(string)NV21,width=320, height=240 , framerate=30/1 ! tee name=t " "t. ! queue ! videoflip method=clockwise ! autovideosink sync=false " "t. ! queue ! video/x-raw, width=320, height=240 , framerate=30/1 ! videoconvert ! videoflip method=clockwise ! x264enc noise-reduction=10000 speed-preset=fast tune=zerolatency byte-stream=true threads=4 key-int-max=15 intra-refresh=true ! mpegtsmux name=mux ! queue max-size-bytes=0 max-size-buffers=0 ! queue ! rtpmp2tpay mtu=1000 pt=96 ! udpsink host=%s port=5001 openslessrc ! queue max-size-bytes=0 max-size-buffers=0 ! audioconvert ! audioresample ! audio/x-raw,channels=1,rate=8000 ! queue leaky=downstream ! opusenc bitrate=8000 ! mux.", data->host);

Is there plugin must be addedd because, i had seen the this caps exist on the plugin : gstreamer-photography-1.0 ?

or this caps are depends the hardware of the device if the zoom and flash light mode are supported or not ?

For information, i use the version of gstreamer : gstreamer-1.16.2 ( does not contain this plugin)

I appreciate your help and thank you in advance for your help

justinjoy commented 2 years ago

Since ahcsrc is an implementation of gst-photography, you can access zoom property of ahcsrc or via gst_photography_set_zoom function. They should be the same behaviour.

Also, zoom and flash-mode features depend on android hardware, so some devices may or may not allow to access the feature via API even though it has flash and zoom that is working with its manufacturer's app.

sofien4387 commented 2 years ago

Thank you for help Justin, have a nice day :)