'프로그램 사용/gstreamer'에 해당되는 글 25건

  1. 2025.08.27 gstreamer 기초
  2. 2025.08.22 gstreamer pipeline
  3. 2025.08.21 gstreamer tee 예제
  4. 2025.08.21 gstreamer capsfilter
  5. 2024.01.11 gstreamer parse_launch
  6. 2023.12.20 nnstreamer
  7. 2023.12.06 gst-device-monitor-1.0
  8. 2023.04.10 gstremaer videobox + videomixer
  9. 2023.04.06 gst-inspector.c
  10. 2023.03.27 gstreamer videomixer 반쪽 성공

element는 gst-inspector로 확인하는 개별 기능(?)

pads는 대개 source, sink로 표현되는 입출력

bins는 모르겠고.. pipeline은 element(요소)들을 pads를 통해 데이터를 흐르도록 하는 연결의 모임 으로 보면 될 듯

 

element An element is the most important class of objects in GStreamer
pads Pads are an element's input and output, where you can connect other elements
bins A bin is a container for a collection of elements.
pipeline A pipeline is a top-level bin.

[링크 : https://gstreamer.freedesktop.org/documentation/application-development/introduction/basics.html?gi-language=c]

 

 

엘리먼트는 크게 세가지로 나누어 지는데

source만 있는 source element(v4l2src 등)

source와 sink가 있는 filter element, demuxer

sink만 있는 sink element(waylandsink, autoviedeosink 등) 이 있다.

 

또한 name 을 이용해서 named element로 사용할 수 있다.

source element Source elements generate data for use by a pipeline, for example reading from disk or from a sound card. 
Filters, convertors, demuxers, muxers and codecs Filters and filter-like elements have both input and outputs pads. 
 


Sink elements Sink elements are end points in a media pipeline.

[링크 : https://gstreamer.freedesktop.org/documentation/application-development/basics/elements.html?gi-language=c]

 

element에는 properties가 존재하는데

일부는 설정용도로 쓸 수 있고, 일부는 상태정보를 폴링(polling)으로 읽어갈 수 있다.

$ gst-inspect-1.0 autovideosink
Factory Details:
  Rank                     none (0)
  Long-name                Auto video sink
  Klass                    Sink/Video
  Description              Wrapper video sink for automatically detected video sink
  Author                   Jan Schmidt <thaytan@noraisin.net>

Plugin Details:
  Name                     autodetect
  Description              Plugin contains auto-detection plugins for video/audio in- and outputs
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstautodetect.so
  Version                  1.20.3
  License                  LGPL
  Source module            gst-plugins-good
  Source release date      2022-06-15
  Binary package           GStreamer Good Plugins (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gst-plugins-good1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBin
                         +----GstAutoDetect
                               +----GstAutoVideoSink

Implemented Interfaces:
  GstChildProxy

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      ANY

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'

Element Properties:
  async-handling      : The bin will handle Asynchronous state changes
                        flags: readablewritable
                        Boolean. Default: false
  filter-caps         : Filter sink candidates using these caps.
                        flags: readable, writable, 0x2000
                                                   video/x-raw

  message-forward     : Forwards all children messages
                        flags: readable, writable
                        Boolean. Default: false
  name                : The name of the object
                        flags: readable, writable, 0x2000
                        String. Default: "autovideosink0"
  parent              : The parent of the object
                        flags: readable, writable, 0x2000
                        Object of type "GstObject"
  sync                : Sync on the clock
                        flags: readable, writable
                        Boolean. Default: true
  ts-offset           : Timestamp offset in nanoseconds
                        flags: readable, writable
                        Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0 

 

Properties and values
Properties are used to describe extra information for capabilities. A property consists of a key (a string) and a value.

[링크 : https://gstreamer.freedesktop.org/documentation/application-development/basics/pads.html?gi-language=c]

 

주기적으로 읽는게 싫다면 signal을 제공하는 엘리먼트를 통해 이벤트 발생시 값을 수신할 수 있다.

$ gst-inspect-1.0 fpsdisplaysink
Factory Details:
  Rank                     none (0)
  Long-name                Measure and show framerate on videosink
  Klass                    Sink/Video
  Description              Shows the current frame-rate and drop-rate of the videosink as overlay or text on stdout
  Author                   Zeeshan Ali <zeeshan.ali@nokia.com>, Stefan Kost <stefan.kost@nokia.com>

Plugin Details:
  Name                     debugutilsbad
  Description              Collection of elements that may or may not be useful for debugging
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstdebugutilsbad.so
  Version                  1.20.3
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      2022-06-15
  Binary package           GStreamer Bad Plugins (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gst-plugins-bad1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBin
                         +----GstFPSDisplaySink

Implemented Interfaces:
  GstChildProxy

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      ANY

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'

Element Properties:
  async-handling      : The bin will handle Asynchronous state changes
                        flags: readable, writable
                        Boolean. Default: false
  fps-update-interval : Time between consecutive frames per second measures and update  (in ms). Should be set on NULL state
                        flags: readable, writable
                        Integer. Range: 1 - 2147483647 Default: 500 
  frames-dropped      : Number of frames dropped by the sink
                        flags: readable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  frames-rendered     : Number of frames rendered
                        flags: readable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  last-message        : The message describing current status
                        flags: readable
                        String. Default: null
  max-fps             : Maximum fps rate measured. Reset when going from NULL to READY.-1 means no measurement has yet been done
                        flags: readable
                        Double. Range:              -1 -   1.797693e+308 Default:              -1 
  message-forward     : Forwards all children messages
                        flags: readable, writable
                        Boolean. Default: false
  min-fps             : Minimum fps rate measured. Reset when going from NULL to READY.-1 means no measurement has yet been done
                        flags: readable
                        Double. Range:              -1 -   1.797693e+308 Default:              -1 
  name                : The name of the object
                        flags: readable, writable, 0x2000
                        String. Default: "fpsdisplaysink0"
  parent              : The parent of the object
                        flags: readable, writable, 0x2000
                        Object of type "GstObject"
  signal-fps-measurements: If the fps-measurements signal should be emitted.
                        flags: readable, writable
                        Boolean. Default: false
  silent              : Don't produce last_message events
                        flags: readable, writable
                        Boolean. Default: false
  sync                : Sync on the clock (if the internally used sink doesn't have this property it will be ignored
                        flags: readable, writable
                        Boolean. Default: true
  text-overlay        : Whether to use text-overlay
                        flags: readable, writable
                        Boolean. Default: true
  video-sink          : Video sink to use (Must only be called on NULL state)
                        flags: readable, writable
                        Object of type "GstElement"

Element Signals:
  "fps-measurements" :  void user_function (GstElement* object,
                                            gdouble arg0,
                                            gdouble arg1,
                                            gdouble arg2,
                                            gpointer user_data);

 

Signals
GObject signals can be used to notify applications of events specific to this object. Note, however, that the application needs to be aware of signals and their meaning, so if you're looking for a generic way for application-element interaction, signals are probably not what you're looking for. In many cases, however, signals can be very useful. See the GObject documentation for all internals about signals.

[링크 : https://gstreamer.freedesktop.org/documentation/plugin-development/basics/signals.html?gi-language=c]

 

bin - pipeline의 하위라는데 알아서 해주는게 포인트라고 보면되나?

$ gst-inspect-1.0 | grep bin
camerabin:  camerabin: Camera Bin
camerabin:  viewfinderbin: Viewfinder Bin
camerabin:  wrappercamerabinsrc: Wrapper camera src element for camerabin2
closedcaption:  cccombiner: Closed Caption Combiner
cluttergst3:  clutterautovideosink: Generic bin
codecalpha:  alphacombine: Alpha Combiner
codecalpha:  vp8alphadecodebin: VP8 Alpha Decoder
codecalpha:  vp9alphadecodebin: VP9 Alpha Decoder
debugutilsbad:  testsrcbin: Generic bin
dvb:  dvbbasebin: DVB bin
encoding:  encodebin: Encoder Bin
encoding:  encodebin2: Encoder Bin
libav:  avdec_binkaudio_dct: libav Bink Audio (DCT) decoder
libav:  avdec_binkaudio_rdft: libav Bink Audio (RDFT) decoder
libav:  avdec_binkvideo: libav Bink video decoder
libav:  avdec_bintext: libav Binary text decoder
libav:  avdec_xbin: libav eXtended BINary text decoder
opengl:  glfilterbin: GL Filter Bin
opengl:  glmixerbin: OpenGL video_mixer empty bin
opengl:  glsinkbin: GL Sink Bin
opengl:  glsrcbin: GL Src Bin
opengl:  glstereomix: OpenGL stereo video combiner
opengl:  glvideomixer: OpenGL video_mixer bin
playback:  decodebin: Decoder Bin
playback:  decodebin3: Decoder Bin 3
playback:  parsebin: Parse Bin
playback:  playbin: Player Bin 2
playback:  playbin3: Player Bin 3
playback:  uridecodebin: URI Decoder
playback:  uridecodebin3: URI Decoder
playback:  urisourcebin: URI reader
resindvd:  rsndvdbin: rsndvdbin
rist:  roundrobin: Round Robin
rtpmanager:  rtpbin: RTP Bin
staticelements:  bin: Generic bin
switchbin:  switchbin: switchbin
transcode:  transcodebin: Transcode Bin
transcode:  uritranscodebin: URITranscode Bin
vaapi:  vaapidecodebin: VA-API Decode Bin
webrtc:  webrtcbin: WebRTC Bin

 

Play a media file using playbin (as in Basic tutorial 1: Hello world!):

gst-launch-1.0 playbin uri=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm
A fully operation playback pipeline, with audio and video (more or less the same pipeline that playbin will create internally):

gst-launch-1.0 souphttpsrc location=https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm ! matroskademux name=d ! queue ! vp8dec ! videoconvert ! autovideosink d. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink

[링크 : https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c]

[링크 : https://gstreamer.freedesktop.org/documentation/tutorials/basic/gstreamer-tools.html?gi-language=c]

 

[링크 : http://ttps://medium.com/may-i-lab/gstreamer-gstreamer-기초-da5015f531fc]

[링크 : https://blog.may-i.io/tech-13/]

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer pipeline  (0) 2025.08.22
gstreamer tee 예제  (0) 2025.08.21
gstreamer capsfilter  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
nnstreamer  (0) 2023.12.20
Posted by 구차니

nxp의 selfie_segmenter.py 에서 추출한 파이프라인

원래 나온거랑은 약간의 줄 추가가 있을 뿐 순서는 차이가 없음

 

특이(?)하게도 v4lsrc가 가장 처음에 시작하는게 아니라

imxpositor_g2d 라고 입력받은걸 양쪽으로 출력하는 비디오 믹서가 파이프라인의 시작에 존재한다.

imxcompositor_g2d latency=33333333 min-upstream-latency=33333333 name=comp sink_1::ypos=0 sink_0::ypos=0 sink_0::xpos=480 \
! cairooverlay name=cairo_text \
! fpsdisplaysink name=wayland_sink text-overlay=false video-sink=waylandsink \
v4l2src device=/dev/video3 \
! video/x-raw,width=640,height=480,framerate=30/1 \
! aspectratiocrop aspect-ratio=1/1 \
! imxvideoconvert_g2d rotation=horizontal-flip \
! video/x-raw,width=480,height=480 \
! tee name=t \
t. ! queue max-size-buffers=1 leaky=2 \
! imxvideoconvert_g2d \
! video/x-raw,width=256,height=256 \
! videoconvert \
! video/x-raw,format=RGB \
! tensor_converter \
! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 \
! tensor_filter framework=tensorflow-lite model=/opt/gopoint-apps/downloads/selfie_segmenter_int8.tflite accelerator=true:npu custom=Delegate:External,ExtDelegateLib:libvx_delegate.so name=tensor_filter latency=1 \
! tensor_decoder mode=image_segment option1=snpe-depth option2=0 \
! imxvideoconvert_g2d \
! video/x-raw,width=480,height=480,format=RGBA \
! comp.sink_0 \
t. ! queue max-size-buffers=1 leaky=2 \
! comp.sink_1

 

자리를 조금 움직여서 보기 편하게(?) 만들면 아래와 같이

v4lsrc로 시작해서 fpsdisplaysink 로 끝내는 순차적인 구성으로 변경이 가능하다.

v4l2src device=/dev/video3 \
! video/x-raw,width=640,height=480,framerate=30/1 \
! aspectratiocrop aspect-ratio=1/1 \
! imxvideoconvert_g2d rotation=horizontal-flip \
! video/x-raw,width=480,height=480 \
! tee name=t \
t. ! queue max-size-buffers=1 leaky=2 \
! imxvideoconvert_g2d \
! video/x-raw,width=256,height=256 \
! videoconvert \
! video/x-raw,format=RGB \
! tensor_converter \
! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 \
! tensor_filter framework=tensorflow-lite model=/opt/gopoint-apps/downloads/selfie_segmenter_int8.tflite accelerator=true:npu custom=Delegate:External,ExtDelegateLib:libvx_delegate.so name=tensor_filter latency=1 \
! tensor_decoder mode=image_segment option1=snpe-depth option2=0 \
! imxvideoconvert_g2d \
! video/x-raw,width=480,height=480,format=RGBA \
! imxcompositor_g2d latency=33333333 min-upstream-latency=33333333 name=comp sink_1::ypos=0 sink_0::ypos=0 sink_0::xpos=480 \
! cairooverlay name=cairo_text \
! fpsdisplaysink name=wayland_sink text-overlay=false video-sink=waylandsink \
t. ! queue max-size-buffers=1 leaky=2 \
! comp.sink_1

 

tee 로 나눈걸 다시 명시적으로 하는걸 생략하면 아래처럼도 변형가능하다.

v4l2src device=/dev/video3 \
! video/x-raw,width=640,height=480,framerate=30/1 \
! aspectratiocrop aspect-ratio=1/1 \
! imxvideoconvert_g2d rotation=horizontal-flip \
! video/x-raw,width=480,height=480 \
! tee name=t \
! queue max-size-buffers=1 leaky=2 \
! imxvideoconvert_g2d \
! video/x-raw,width=256,height=256 \
! videoconvert \
! video/x-raw,format=RGB \
! tensor_converter \
! tensor_transform mode=arithmetic option=typecast:float32,div:255.0 \
! tensor_filter framework=tensorflow-lite model=/opt/gopoint-apps/downloads/selfie_segmenter_int8.tflite accelerator=true:npu custom=Delegate:External,ExtDelegateLib:libvx_delegate.so name=tensor_filter latency=1 \
! tensor_decoder mode=image_segment option1=snpe-depth option2=0 \
! imxvideoconvert_g2d \
! video/x-raw,width=480,height=480,format=RGBA \
! imxcompositor_g2d latency=33333333 min-upstream-latency=33333333 name=comp sink_1::ypos=0 sink_0::ypos=0 sink_0::xpos=480 \
! cairooverlay name=cairo_text \
! fpsdisplaysink name=wayland_sink text-overlay=false video-sink=waylandsink \
t. \
! queue max-size-buffers=1 leaky=2 \
! comp.sink_1

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer 기초  (0) 2025.08.27
gstreamer tee 예제  (0) 2025.08.21
gstreamer capsfilter  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
nnstreamer  (0) 2023.12.20
Posted by 구차니

gemini를 찬양하라(?)

 

# Example with avenc_aac
gst-launch-1.0 -e \
filesrc location=video1.mp4 ! decodebin name=demux1 \
filesrc location=video2.mp4 ! decodebin name=demux2 \
demux1. ! queue ! videoconvert ! x264enc ! tee name=vtee1 \
demux1. ! queue ! audioconvert ! audioresample ! avenc_aac ! tee name=atee1 \
demux2. ! queue ! videoconvert ! x264enc ! tee name=vtee2 \
demux2. ! queue ! audioconvert ! audioresample ! avenc_aac ! tee name=atee2 \
vtee1. ! queue ! mp4mux name=mux1 ! filesink location=output1.mp4 \
vtee2. ! queue ! mp4mux name=mux2 ! filesink location=output2.mp4 \
atee2. ! queue ! mux1.audio_0 \
atee1. ! queue ! mux2.audio_0

 

name. 으로 해서 이전것에서 새끼(?)치면 되나보다.

굳이 그리자면 이런식으로 나오는 듯.

 

2021.02.08 - [프로그램 사용/gstreamer] - gstreamer tee

 

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer 기초  (0) 2025.08.27
gstreamer pipeline  (0) 2025.08.22
gstreamer capsfilter  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
nnstreamer  (0) 2023.12.20
Posted by 구차니

gstreamer 파이프라인 예제를 보다가 이상한걸 발견

video/x-raw가 엘리먼트 이름은 아닐텐데..하고 gpt에 물어보니 capsfilter 라고 해서 찾아보니

gst-launch-1.0 -v v4l2src ! videorate ! video/x-raw,framerate=25/2 ! theoraenc ! oggmux ! filesink location=recording.ogg

[링크 : https://gstreamer.freedesktop.org/documentation/videorate/?gi-language=c]

 

"capsfilter caps=" 생략하고 쓰면 알아서 capsfilter로 인식하는 건가?

Example launch line
 gst-launch-1.0 videotestsrc ! capsfilter caps=video/x-raw,format=GRAY8 ! videoconvert ! autovideosink

Limits acceptable video from videotestsrc to be grayscale. Equivalent to
 gst-launch-1.0 videotestsrc ! video/x-raw,format=GRAY8 ! videoconvert ! autovideosink

[링크 : https://gstreamer.freedesktop.org/documentation/coreelements/capsfilter.html?gi-language=c]

 

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer pipeline  (0) 2025.08.22
gstreamer tee 예제  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
nnstreamer  (0) 2023.12.20
gst-device-monitor-1.0  (0) 2023.12.06
Posted by 구차니

nnstreamer python 예제를 보다보니, 아래와 같이 pipeline 문자열을 이용해서 구성하고

이름으로 싱크를 찾아 콜백을 연결해 주는걸 보니, 일일이 element 생성해서 연결할 필요가 없을 것 같아서 검색중

        gst_launch_cmdline += "tensor_sink name=tensor_sink t. ! "

        self.pipeline = Gst.parse_launch(gst_launch_cmdline)

        # bus and message callback
        bus = self.pipeline.get_bus()
        bus.add_signal_watch()
        bus.connect("message", self.on_bus_message)

        self.tensor_filter = self.pipeline.get_by_name("tensor_filter")
        self.wayland_sink = self.pipeline.get_by_name("img_tensor")

        # tensor sink signal : new data callback
        tensor_sink = self.pipeline.get_by_name("tensor_sink")
        tensor_sink.connect("new-data", self.new_data_cb)

    # @brief Callback for tensor sink signal.
    def new_data_cb(self, sink, buffer):
        """Callback for tensor sink signal.

        :param sink: tensor sink element
        :param buffer: buffer from element
        :return: None
        """

 

parse쪽은 c 로는 아래의 함수를 쓰면 될 것 같은데

gst_parse_launch 
GstElement *
gst_parse_launch (const gchar * pipeline_description,
                  GError ** error)
Create a new pipeline based on command line syntax. Please note that you might get a return value that is not NULL even though the error is set. In this case there was a recoverable parsing error and you can try to play the pipeline.

To create a sub-pipeline (bin) for embedding into an existing pipeline use gst_parse_bin_from_description.

Parameters:

pipeline_description – the command line describing the pipeline
error – the error message in case of an erroneous pipeline.
Returns ( [transfer: floating]) – a new element on success, NULL on failure. If more than one toplevel element is specified by the pipeline_description, all elements are put into a GstPipeline, which than is returned.

[링크 : https://gstreamer.freedesktop.org/documentation/gstreamer/gstparse.html?gi-language=c]

 

아래의 함수를 이용해서 찾으면 될...지도?

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBin
                    ╰──GstPipeline

gst_bin_get_by_name 
GstElement *
gst_bin_get_by_name (GstBin * bin,
                     const gchar * name)
Gets the element with the given name from a bin. This function recurses into child bins.

Parameters:

bin – a GstBin
name – the element name to search for
Returns ( [transfer: full][nullable]) – the GstElement with the given name

[링크 : https://gstreamer.freedesktop.org/documentation/gstreamer/gstbin.html?gi-language=c#gst_bin_get_by_name]

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer tee 예제  (0) 2025.08.21
gstreamer capsfilter  (0) 2025.08.21
nnstreamer  (0) 2023.12.20
gst-device-monitor-1.0  (0) 2023.12.06
gstremaer videobox + videomixer  (0) 2023.04.10
Posted by 구차니

Neural Network gstreamer인가?

 

NNStreamer provides a set of GStreamer plugins so developers may apply neural networks, attach related frameworks (including ROSIIOFlatBuffers, and Protocol Buffers), and manipulate tensor data streams in GStreamer pipelines easily and execute such pipelines efficiently

[링크 : https://nnstreamer.ai/#get-started]

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer capsfilter  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
gst-device-monitor-1.0  (0) 2023.12.06
gstremaer videobox + videomixer  (0) 2023.04.10
gst-inspector.c  (0) 2023.04.06
Posted by 구차니

v4l2src 관련해서 기존에 웹캠에서 지원하는 모드들 찾는다고 고생했는데 간단한 유틸리티를 알게 됨 -_-

 

$ man gst-device-monitor-1.0
SYNOPSIS
       gst-device-monitor-1.0 [DEVICE_CLASSES[:FILTER_CAPS]] [DEVICE_CLASSES[:FILTER_CAPS]]

 

$ gst-device-monitor-1.0 Video/Source
Probing devices...


Device found:

name  : 720p HD Camera
class : Video/Source
caps  : image/jpeg, width=1280, height=720, framerate=30/1
        image/jpeg, width=640, height=480, framerate=30/1
        image/jpeg, width=640, height=360, framerate=30/1
        image/jpeg, width=352, height=288, framerate=30/1
        image/jpeg, width=320, height=240, framerate=30/1
        image/jpeg, width=160, height=120, framerate=30/1
        video/x-raw, format=YUY2, width=1280, height=720, framerate=10/1
        video/x-raw, format=YUY2, width=640, height=480, framerate=30/1
        video/x-raw, format=YUY2, width=640, height=360, framerate=30/1
        video/x-raw, format=YUY2, width=352, height=288, framerate=30/1
        video/x-raw, format=YUY2, width=320, height=240, framerate=30/1
        video/x-raw, format=YUY2, width=160, height=120, framerate=30/1
properties:
object.path = v4l2:/dev/video0
device.api = v4l2
media.class = Video/Source
device.product.id = 308
device.vendor.id = 11134
api.v4l2.path = /dev/video0
api.v4l2.cap.driver = uvcvideo
api.v4l2.cap.card = "720p\ HD\ Camera:\ 720p\ HD\ Camera"
api.v4l2.cap.bus_info = usb-0000:00:14.0-6
api.v4l2.cap.version = 6.2.16
api.v4l2.cap.capabilities = 84a00001
api.v4l2.cap.device-caps = 04200001
device.id = 33
node.name = v4l2_input.pci-0000_00_14.0-usb-0_6_1.0
node.description = "720p\ HD\ Camera"
factory.name = api.v4l2.source
node.pause-on-idle = false
factory.id = 10
client.id = 32
clock.quantum-limit = 8192
media.role = Camera
node.driver = true
object.id = 35
object.serial = 35
gst-launch-1.0 pipewiresrc path=35 ! ...

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstreamer parse_launch  (0) 2024.01.11
nnstreamer  (0) 2023.12.20
gstremaer videobox + videomixer  (0) 2023.04.10
gst-inspector.c  (0) 2023.04.06
gstreamer videomixer 반쪽 성공  (0) 2023.03.27
Posted by 구차니

videobox를 이용해서 어느정도는 원하는 위치로 옮길순 있는데 자유자재로 옮기긴 힘든 듯?

gst-launch-1.0 \
   videotestsrc pattern=1 ! \
   video/x-raw,format=AYUV,framerate=\(fraction\)10/1,width=100,height=100 ! \
   videobox border-alpha=0 top=-70 bottom=-70 right=-220 ! \
   videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.5 ! \
   videoconvert ! xvimagesink \
   videotestsrc ! \
   video/x-raw,format=AYUV,framerate=\(fraction\)5/1,width=320,height=240 ! mix.

[링크 : https://gstreamer.freedesktop.org/documentation/videomixer/index.html?gi-language=c]

 

bottom 
“bottom” gint
Pixels to box at bottom (<0 = add a border)
Flags : Read / Write
Default value : 0

left 
“left” gint
Pixels to box at left (<0 = add a border)
Flags : Read / Write
Default value : 0

right 
“right” gint
Pixels to box at right (<0 = add a border)
Flags : Read / Write
Default value : 0

top 
“top” gint
Pixels to box at top (<0 = add a border)
Flags : Read / Write
Default value : 0

[링크 : https://gstreamer.freedesktop.org/documentation/videobox/index.html?gi-language=c]

 

ximagesink 에다가 sync=false 하니 프레임이 잘 나온다.

videomixer가 더 앞에 있으니 videomixer에 sync=false를 넣어야 할 줄 알았는데 의외네

$ gst-launch-1.0 v4l2src device=/dev/video2 ! jpegdec ! videomixer name=mix ! videoconvert ! ximagesink sync=false v4l2src device=/dev/video0 ! jpegdec ! mix.

[링크 : https://stackoverflow.com/questions/38392956/gstreamer-videomixer-very-low-framerate]

 

 

$ gst-launch-1.0 \
v4l2src device=/dev/video2 ! jpegdec ! \
videobox top=0 bottom=0 left=-960 ! \
videomixer name=mix sink_0::alpha=1 sink_1::alpha=1 ! \
videoconvert ! \
ximagesink window-width=1920 window-height=1080 sync=false \
v4l2src device=/dev/video0 ! jpegdec ! \
videobox top=0 bottom=0 ! mix.

'프로그램 사용 > gstreamer' 카테고리의 다른 글

nnstreamer  (0) 2023.12.20
gst-device-monitor-1.0  (0) 2023.12.06
gst-inspector.c  (0) 2023.04.06
gstreamer videomixer 반쪽 성공  (0) 2023.03.27
gstreamer videomixer ... 2?  (0) 2023.03.27
Posted by 구차니

한번 빌드해서 원하는 결과만 덤프하는 용도로 수정이 가능하려나?

[링크 : https://github.com/GStreamer/gstreamer/blob/main/subprojects/gstreamer/tools/gst-inspect.c]

 

 gst-inspect 에서 원하는 정보는 아래의 Pad template 부분

Pad Templates:
  SINK template: 'sink_%u'
    Availability: On request
    Capabilities:
      video/x-raw
                 format: { (string)AYUV, (string)BGRA, (string)ARGB, (string)RGBA, (string)ABGR, (string)Y444, (string)Y42B, (string)YUY2, (string)UYVY, (string)YVYU, (string)I420, (string)YV12, (string)NV12, (string)NV21, (string)Y41B, (string)RGB, (string)BGR, (string)xRGB, (string)xBGR, (string)RGBx, (string)BGRx }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
  
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: { (string)AYUV, (string)BGRA, (string)ARGB, (string)RGBA, (string)ABGR, (string)Y444, (string)Y42B, (string)YUY2, (string)UYVY, (string)YVYU, (string)I420, (string)YV12, (string)NV12, (string)NV21, (string)Y41B, (string)RGB, (string)BGR, (string)xRGB, (string)xBGR, (string)RGBx, (string)BGRx }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Element has no clocking capabilities.
Element has no URI handling capabilities.

 

Pad Templates를 출력하는 함수

static void
print_pad_templates_info (GstElement * element, GstElementFactory * factory)

[링크 : https://github.com/GStreamer/gstreamer/blob/main/subprojects/gstreamer/tools/gst-inspect.c#L816]

 

Capabilities 부분을 출력하는 함수

static void
print_caps (const GstCaps * caps, const gchar * pfx)

[링크 : https://github.com/GStreamer/gstreamer/blob/main/subprojects/gstreamer/tools/gst-inspect.c#L194]

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gst-device-monitor-1.0  (0) 2023.12.06
gstremaer videobox + videomixer  (0) 2023.04.10
gstreamer videomixer 반쪽 성공  (0) 2023.03.27
gstreamer videomixer ... 2?  (0) 2023.03.27
gstreamer pad - sink 와 src  (0) 2023.03.27
Posted by 구차니

되는데 엄청 느리다.

아마 async 옵션을 안줘서 그런거 같은데..

 

아무튼 gstaremer의 파이프를 구성하는데 ximagesink가 비디오를 출력하기 위한 마지막 sink 니까

파이프 구성없이 v4l2src를 실행하고 jpegdec 한다음(MJPG 웹캠이라) mix 라는 이름을 가지고 있던 videomixer 에게 던지면 끝

$ gst-launch-1.0 v4l2src ! jpegdec ! videomixer name=mix ! videoconvert ! ximagesink v4l2src device=/dev/video2 ! jpegdec ! mix.

'프로그램 사용 > gstreamer' 카테고리의 다른 글

gstremaer videobox + videomixer  (0) 2023.04.10
gst-inspector.c  (0) 2023.04.06
gstreamer videomixer ... 2?  (0) 2023.03.27
gstreamer pad - sink 와 src  (0) 2023.03.27
gstreamer cheat sheet - tee, queue  (0) 2023.03.22
Posted by 구차니