장치 상태는 v4l2-ctl로 보는데 일단 비디오 포맷이 MJPG이다.
$ v4l2-ctl --all -d 0 Driver Info (not using libv4l2): Driver name : uvcvideo Card type : 720p HD Camera: 720p HD Camera Bus info : usb-0000:00:14.0-6 Driver version: 5.4.229 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 640/480 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 614400 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 640, Height 480 Default : Left 0, Top 0, Width 640, Height 480 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 640, Height 480 Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=0 max=127 step=1 default=64 value=64 contrast 0x00980901 (int) : min=0 max=100 step=1 default=50 value=50 saturation 0x00980902 (int) : min=0 max=8 step=1 default=4 value=4 hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0 white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1 gamma 0x00980910 (int) : min=100 max=500 step=1 default=300 value=300 power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2 value=2 white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=10 default=3400 value=3400 flags=inactive sharpness 0x0098091b (int) : min=0 max=8 step=1 default=4 value=4 backlight_compensation 0x0098091c (int) : min=0 max=1 step=1 default=0 value=0 exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3 exposure_absolute 0x009a0902 (int) : min=50 max=10000 step=1 default=166 value=166 flags=inactive |
2개를 나란히 하는걸 보려고 했는데 일단 에러나니 패스하고
$ gst-launch-1.0 -vvv tee name=splitter v4l2src device=/dev/video0 do-timestamp=true ! image/jpeg, width=640, height=480, framerate=30/1 ! jpegparse ! jpegdec ! videoconvert ! videoscale ! xvimagesink sync=false splitter. v4l2src device=/dev/video2 do-timestamp=true ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! jpegdec ! videoconvert ! videoscale ! xvimagesink sync=false splitter. WARNING: erroneous pipeline: unexpected reference "splitter" - ignoring |
[링크 : https://gist.github.com/jetsonhacks/10b870c2948215da3e5e]
포인트는.. image/jpeg로 받아서 jpegparse 하고(jpeg 부분만 잘라내고)
jpegdec 하고(jpeg를 bmp 처럼 rgb로 변환)
xvimagesink에 적절한 videoscale로 맞추어서 출력하는 건가?
$ gst-launch-1.0 v4l2src device=/dev/video0 do-timestamp=true ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! jpegdec ! videoconvert ! videoscale ! xvimagesink sync=false |
화면 프레임이 떨어지지만 최소한도로 줄이면 아래와 같이 가능도 하다.
$ gst-launch-1.0 v4l2src ! jpegparse ! jpegdec ! videoscale ! xvimagesink |
'프로그램 사용 > gstreamer' 카테고리의 다른 글
gstreamer pad - sink 와 src (0) | 2023.03.27 |
---|---|
gstreamer cheat sheet - tee, queue (0) | 2023.03.22 |
gstream videomixer (0) | 2023.02.17 |
gstream compositing - 그러니까 비디오 믹서? (0) | 2021.07.21 |
gst h264 filesink (0) | 2021.07.14 |