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

  1. 2025.09.21 GstPipelineStudio on odroidc2
  2. 2025.09.20 GstPipelineStudio install on armbian
  3. 2025.09.20 GstPipelineStudio install 실패
  4. 2025.09.11 gstpipelinestudio
  5. 2025.08.27 gstreamer 기초
  6. 2025.08.22 gstreamer pipeline
  7. 2025.08.21 gstreamer tee 예제
  8. 2025.08.21 gstreamer capsfilter
  9. 2024.01.11 gstreamer parse_launch
  10. 2023.12.20 nnstreamer

odroid c2 / armbian 에서 빌드 성공, 실행 성공

 

실행하면 다음과 같이 나온다.

 

videotestsrc와 waylandsink 를 추가하는데

sink를 추가하니 오른쪽 끝에 스크롤 돌려서 나와서 추가딘지도 모르고 몇번을 눌렀으니 주의

 

src_0 와 sink_0 중에 골라서 드래그 하면 선으로 이어진다.

 

그리고 play 버튼을 누르면 하단에 videotestsrc가 실행되고 출력되는걸 확인할 수 있다.

 

우클릭하면 properties가 나오는데

 

머 이것저것 나오긴한다.

 

waylandsink로 프로퍼티를 보면

 

먼가 잔뜩 나오긴 한다. 머.. 이거야 capfilter를 통해서 설정해야 하는데, 참조하긴 충분하려나?

 

저장하고 파일을 열어보니 xml로 그래프 로 저장된다.

$ cat test 
<?xml version="1.0" encoding="utf-8"?>
<Graph id="0">
  <Node name="videotestsrc" id="1" type="Source" pos_x="41.492188" pos_y="111.921875">
    <Port name="src_0" id="1" direction="Output" presence="Always">
      <Property name="_caps" value="video/x-raw, format=(string){ A444_16LE, A444_16BE, AYUV64, RGBA64_LE, ARGB64, ARGB64_LE, BGRA64_LE, ABGR64_LE, RGBA64_BE, ARGB64_BE, BGRA64_BE, ABGR64_BE, A422_16LE, A422_16BE, A420_16LE, A420_16BE, A444_12LE, GBRA_12LE, A444_12BE, GBRA_12BE, Y412_LE, Y412_BE, A422_12LE, A422_12BE, A420_12LE, A420_12BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, A420_10LE, A420_10BE, BGR10A2_LE, RGB10A2_LE, Y410, A444, GBRA, AYUV, VUYA, RGBA, RBGA, ARGB, BGRA, ABGR, A422, A420, AV12, Y444_16LE, GBR_16LE, Y444_16BE, GBR_16BE, v216, P016_LE, P016_BE, Y444_12LE, GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, I422_10LE, I422_10BE, NV16_10LE32, Y210, UYVP, v210, I420_10LE, I420_10BE, P010_10LE, NV12_10LE40, NV12_10LE32, P010_10BE, MT2110R, MT2110T, NV12_10BE_8L128, NV12_10LE40_4L4, Y444, BGRP, GBR, RGBP, NV24, v308, IYU2, RGBx, xRGB, BGRx, xBGR, RGB, BGR, Y42B, NV16, NV61, YUY2, YVYU, UYVY, VYUY, I420, YV12, NV12, NV21, NV12_16L32S, NV12_32L32, NV12_4L4, NV12_64Z32, NV12_8L128, Y41B, IYU1, YUV9, YVU9, BGR16, RGB16, BGR15, RGB15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }; video/x-bayer, format=(string){ bggr, rggb, grbg, gbrg, bggr10le, rggb10le, grbg10le, gbrg10le, bggr10be, rggb10be, grbg10be, gbrg10be, bggr12le, rggb12le, grbg12le, gbrg12le, bggr12be, rggb12be, grbg12be, gbrg12be, bggr14le, rggb14le, grbg14le, gbrg14le, bggr14be, rggb14be, grbg14be, gbrg14be, bggr16le, rggb16le, grbg16le, gbrg16le, bggr16be, rggb16be, grbg16be, gbrg16be }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }" />
    </Port>
  </Node>
  <Node name="waylandsink" id="4" type="Sink" pos_x="360.66797" pos_y="109.390625">
    <Port name="sink_0" id="4" direction="Input" presence="Always">
      <Property name="_caps" value="video/x-raw, format=(string){ AYUV, RGBA, ARGB, BGRA, ABGR, P010_10LE, v308, RGBx, xRGB, BGRx, xBGR, RGB, BGR, Y42B, NV16, NV61, YUY2, YVYU, UYVY, I420, YV12, NV12, NV21, Y41B, YUV9, YVU9, BGR16, RGB16 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw(memory:DMABuf), format=(string)DMA_DRM, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]" />
    </Port>
  </Node>
  <Link id="2" node_from="1" node_to="4" port_from="1" port_to="4" active="true" />
</Graph>

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

GstPipelineStudio install on armbian  (0) 2025.09.20
GstPipelineStudio install 실패  (0) 2025.09.20
gstpipelinestudio  (0) 2025.09.11
gstreamer 기초  (0) 2025.08.27
gstreamer pipeline  (0) 2025.08.22
Posted by 구차니

그래도 24.04 라서 그런가 20.04 보단 수월하게 설치되네

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"

 

다만 git readme에 써있는것 보다는 조금 많은 걸 추가로 설치해야 한다.

sudo apt install python3-pip ninja-build pkg-config meson cmake libgstreamer-plugins-bad1.0-dev
sudo apt install libgtk-4-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install appstream-util gettext

[링크 : https://stackoverflow.com/questions/9500898/compiler-error-msgfmt-command-not-found]

[링크 : https://github.com/patrickelectric/GstPipelineStudio]

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

GstPipelineStudio on odroidc2  (0) 2025.09.21
GstPipelineStudio install 실패  (0) 2025.09.20
gstpipelinestudio  (0) 2025.09.11
gstreamer 기초  (0) 2025.08.27
gstreamer pipeline  (0) 2025.08.22
Posted by 구차니

odroid c2 / ubuntu mate 20.04

 

적힌거랑은 다르게 libgtk-4가 없어서 libgtk-3로 깔았는데

libgtk-3-dev

apt install python3-pip ninja-build pkgconfig
pip3 install --user meson
apt install libgtk-4-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

meson builddir -Dbuildtype=release
ninja -C builddir
./builddir/target/release/gst_pipeline_studio

 

2022년에 커밋된(가장 마지막으로) 녀석이라, 2020 년 버전으로는 무리인 듯.

commit 9e4e915b1d5c4603c312dcb007e0efbe137789af (HEAD -> main, origin/main, origin/HEAD)
Author: Stéphane Cerveau <scerveau@collabora.com>
Date:   Wed Feb 9 11:29:42 2022 +0100

    release: mention flathub for a new release

 

glibc가 낮으면 포기하는데 편하지

$ meson builddir -Dbuildtype=release

The Meson build system
Version: 1.9.0
Source dir: /home/odroid/GstPipelineStudio
Build dir: /home/odroid/GstPipelineStudio/builddir
Build type: native build
WARNING: Failed to load Cargo.lock: Could not find an implementation of tomllib, nor toml2json
Project name: gst_pipeline_studio
Project version: 0.2.3
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/usr/bin/python3)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in meson 2.0.
         See also: https://github.com/mesonbuild/meson/issues/9300
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.1
Dependency glib-2.0 found: NO. Found 2.64.6 but need: '>= 2.66'
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency glib-2.0 found: NO 

meson.build:13:0: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Invalid version, need 'glib-2.0' ['>= 2.66'] found '2.64.6'.

A full log can be found at /home/odroid/GstPipelineStudio/builddir/meson-logs/meson-log.txt
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

 

[링크  : https://github.com/patrickelectric/GstPipelineStudio]

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

GstPipelineStudio on odroidc2  (0) 2025.09.21
GstPipelineStudio install on armbian  (0) 2025.09.20
gstpipelinestudio  (0) 2025.09.11
gstreamer 기초  (0) 2025.08.27
gstreamer pipeline  (0) 2025.08.22
Posted by 구차니

2021년 시작해서 2022년 이후로는 수정이 없는 프로젝트

그래도 보면서 할 수 있으면 괜찮아 보이는데, 한번 설치해서 해봐야겠다

[링크 : https://github.com/patrickelectric/GstPipelineStudio?tab=readme-ov-file]

[링크 : https://blogs.igalia.com/scerveau/introducing-gstpipelinestudio-0-3-4/]

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

GstPipelineStudio install on armbian  (0) 2025.09.20
GstPipelineStudio install 실패  (0) 2025.09.20
gstreamer 기초  (0) 2025.08.27
gstreamer pipeline  (0) 2025.08.22
gstreamer tee 예제  (0) 2025.08.21
Posted by 구차니

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' 카테고리의 다른 글

GstPipelineStudio install 실패  (0) 2025.09.20
gstpipelinestudio  (0) 2025.09.11
gstreamer pipeline  (0) 2025.08.22
gstreamer tee 예제  (0) 2025.08.21
gstreamer capsfilter  (0) 2025.08.21
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' 카테고리의 다른 글

gstpipelinestudio  (0) 2025.09.11
gstreamer 기초  (0) 2025.08.27
gstreamer tee 예제  (0) 2025.08.21
gstreamer capsfilter  (0) 2025.08.21
gstreamer parse_launch  (0) 2024.01.11
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 구차니