pad는 입/출력을 모두 의미할 수 있고(PCB의 IC의 발이 pad 니까..)

pad의 종류에 sink와 src가 있는데

sink는 예상과는 다르게 입력이다. src가 해당 엘리먼트의 출력..(어떤 놈이 이렇게 이름을 이따구로 정해놓은거냐 -_-)

 

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

 

+

pad에 src만 있는 녀석을 소스

sink / src가 있는 녀석을 필터

sink 만 있는 녀석을 sink 라고 표현하는 듯

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

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

 

가장 만만(?)한 v4l 웹캠 입력을 예를 들어 보면 아래와 같은 파이프가 구성되는데

v4l2src 가 jpegdec를 거쳐 xvimagesink로 전달된다.

$ gst-launch-1.0 v4l2src ! jpegdec ! xvimagesink

 

v4l2src는 sink가 없는 엘리먼트인데 이걸 머라고 불러야 하나?

아무튼 src의 image/jpeg로 뱉어주면(아마 자동으로 서로 사용가능한 포맷을 맞추는 느낌?)

src
image/jpeg:
video/mpeg:
    mpegversion: 4
   systemstream: false
video/mpeg:
    mpegversion: { (int)1, (int)2 }
video/mpegts:
   systemstream: true
video/x-bayer:
         format: { bggr, gbrg, grbg, rggb }
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-dv:
   systemstream: true
video/x-fwht:
video/x-h263:
        variant: itu
video/x-h264:
  stream-format: { (string)byte-stream, (string)avc }
      alignment: au
video/x-h265:
  stream-format: byte-stream
      alignment: au
video/x-pwc1:
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-pwc2:
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-raw:
         format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-sonix:
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-vp8:
video/x-vp9:
video/x-wmv:
     wmvversion: 3
         format: WVC1

video/x-raw(format:Interlaced):
         format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, BGRA, BGRx, BGR15, RGB15 }
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
 interlace-mode: alternate
Presence – always

Direction – src

Object type – GstPad

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

 

jpegdec 에서는 image/jpeg로 받아 video/x-raw로 변환해서 출력하고

Pad Templates
sink
image/jpeg:
Presence – always

Direction – sink

Object type – GstPad

src
video/x-raw:
         format: { I420, RGB, BGR, RGBx, xRGB, BGRx, xBGR, GRAY8 }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
Presence – always

Direction – src

Object type – GstPad

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

 

xvimagesink는 video/x-raw로 받아서 화면으로 출력한다.

Pad Templates
sink
video/x-raw:
      framerate: [ 0/1, 2147483647/1 ]
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
Presence – always

Direction – sink

Object type – GstPad

[링크 : https://gstreamer.freedesktop.org/documentation/xvimagesink/index.html]

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

gstreamer videomixer 반쪽 성공  (0) 2023.03.27
gstreamer videomixer ... 2?  (0) 2023.03.27
gstreamer cheat sheet - tee, queue  (0) 2023.03.22
gstreamer를 이용하여 uvc 웹캠 (mjpg) 보기  (0) 2023.03.22
gstream videomixer  (0) 2023.02.17
Posted by 구차니

Hamming 적용(끝부분으로 갈수록 0에 가깝게 억제) -> 손실 발생 -> 겹침(overlap) 적용 -> 손실 최소화

[링크 : https://m.blog.naver.com/ksunghwank/140119596852]

 

앞뒤에 0으로 된 신호가 있다고 간주하도록 신호의 앞 뒤를 0으로 눌러서 하면

유한시간 간격으로 좁힌다 라고 하는데 discrete 이기 때문인가?

[링크 : https://medialink.tistory.com/135]

 

특별한 이유가 없다면 Hanning 윈도우 적용하는 것이 좋다라..

Rectangluar는 가장 높은 주파수 분해능을 제공

Hamming, Hanning은 연속적인 파형 분석에 주로 사용됨

[링크 : https://m.blog.naver.com/lecroykorea/221549211257]

 

 

아무튼.. 요약하자면 입력받은 데이터를 그대로 때려박아도(rectangular) 상관없지만

분석 유형에 따라 Hanning등을 적용하는 것이 더 나을 수도 있다. 정도인가?

 

+

오버랩 블록의 몇 %를 다음 블록에서 다시 사용

그렇다면 전체 분석되는 주파수 범위가 늘어날 것 같은데, 시간 해상도를 높이는데 사용된다고 한다.

어떻게 보면.. Moving average 처럼 주파수를 옆으로 shift 해가면서 분석되서 나오는 주파수도 넓히고

새로운 주파수가 아닌 과거 주파수를 포함하긴 하지만 더 짧은 시간 주기로 결과를 낼 수 있는

반대로 생각하면 연산량에 더 많아지는 결과를 얻을 수 있게 될 듯?

[링크 : https://m.blog.naver.com/suya309/221467948212]

 

 

+

2023.03.30

[링크 : https://sanghyu.tistory.com/38]

[링크 : https://paeton.tistory.com/entry/Window-Function을-쓰는-이유

 

[링크 : https://dsp.stackexchange.com/questions/13856/filter-size-vs-fft-size-and-overlap-add]

[링크 : https://commons.wikimedia.org/wiki/File:FFT_size_vs_filter_length_for_Overlap-add_convolution.svg]

[링크 : https://dsp.stackexchange.com/questions/47448/window-periodoverlap-and-fft]

 

[링크 : https://www.katjaas.nl/FFTwindow/FFTwindow.html]

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

spectrogram  (0) 2023.03.29
fft 분석 패러미터  (0) 2023.03.29
cabs()  (0) 2023.02.15
FFT 분석 기법  (0) 2023.02.07
fft window 함수  (0) 2022.11.16
Posted by 구차니

원본 설명.. tee는 그나마 알아듣겠는데

tee
Split data to multiple pads. Branching the data flow is useful when e.g. capturing a video where the video is shown on the screen and also encoded and written to a file. Another example is playing music and hooking up a visualisation module.

One needs to use separate queue elements (or a multiqueue) in each branch to provide separate threads for each branch. Otherwise a blocked dataflow in one branch would stall the other branches.

Example launch line
 gst-launch-1.0 filesrc location=song.ogg ! decodebin ! tee name=t ! queue ! audioconvert ! audioresample ! autoaudiosink t. ! queue ! audioconvert ! goom ! videoconvert ! autovideosink

Play song.ogg audio file which must be in the current working directory and render visualisations using the goom element (this can be easier done using the playbin element, this is just an example pipeline).

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

 

queue는 도대체 어떻게 해석을 해야하냐..

queue
Data is queued until one of the limits specified by the , and/or properties has been reached. Any attempt to push more buffers into the queue will block the pushing thread until more space becomes available.

The queue will create a new thread on the source pad to decouple the processing on sink and source pad.

You can query how many buffers are queued by reading the property. You can track changes by connecting to the notify::current-level-buffers signal (which like all signals will be emitted from the streaming thread). The same applies to the and properties.

The default queue size limits are 200 buffers, 10MB of data, or one second worth of data, whichever is reached first.

As said earlier, the queue blocks by default when one of the specified maximums (bytes, time, buffers) has been reached. You can set the property to specify that instead of blocking it should leak (drop) new or old buffers.

The signal is emitted when the queue has less data than the specified minimum thresholds require (by default: when the queue is empty). The signal is emitted when the queue is filled up. Both signals are emitted from the context of the streaming thread.

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

 

 

마태복음님 만세!

얼마나 직관적인가!!

Multiple outputs (tee)
This page describes the tee element, which allows audio & video streams to be sent to more than one place.

[링크 : https://github.com/matthew1000/gstreamer-cheat-sheet/blob/master/tee.md]

 

queue는 쓰레드 경계로 쓰거나 버퍼(속도가 다를 경우 완충을 위한)로 사용된다.

Queues
A queue can appear almost anywhere in a GStreamer pipeline. Like most elements, it has an input (sink) and output (src). It has two uses:

As a thread boundary - i.e. The elements after a queue will run in a different thread to those before it
As a buffer, for when different parts of the pipeline may move at different speeds.

[링크 : https://github.com/matthew1000/gstreamer-cheat-sheet/blob/master/queues.md]

 

 

+

$ gst-launch-1.0 videotestsrc ! videoconvert ! tee name=t ! queue ! autovideosink t. ! queue ! autovideosink
$ gst-launch-1.0 videotestsrc ! videoconvert ! tee name=t ! queue ! autovideosink t. ! queue ! autovideosink t. ! queue ! autovideosink

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

Posted by 구차니

장치 상태는 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
Posted by 구차니

videowall 처럼 여러개를 한 화면에 띄우는 기능 이라는데

묘하게 그냥 곱게(?) 작동하는 예제 찾기가 힘드네

 

[링크 : https://stackoverflow.com/questions/7426482/trying-to-play-multiple-video-files-simultaneously-in-gstreamer]

 

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]

Posted by 구차니

chatGPT에게 fftw의 complex (복소수)를 어떻게 진폭으로 바꾸냐고 물어보니 나온 함수

 

#include <complex.h>
double cabs(double complex z);
float cabsf(float complex z);
long double cabsl(long double complex z);

Link with -lm.

Description
The cabs() function returns the absolute value of the complex number z. The result is a real number.

Versions
These functions first appeared in glibc in version 2.1.

Conforming to
C99.

Notes
The function is actually an alias for hypot(a, b) (or, equivalently, sqrt(a*a + b*b)).

[링크 : https://linux.die.net/man/3/cabs]

 

그나저나 저 copmlex라는 변수 타입은 어디서 어떻게 정의 되어 있나?

C99 지원하는 컴파일러의 primitive인가?

 

ISO C99 supports complex floating data types, and as an extension GCC supports them in C90 mode and in C++. GCC also supports complex integer data types which are not part of ISO C99. You can declare complex types using the keyword _Complex. As an extension, the older GNU keyword __complex__ is also supported.

[링크 : http://./cortexa53-crypto-poky-linux/usr/src/debug/glibc/2.33-r0/git/include/complex.h]

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

fft 분석 패러미터  (0) 2023.03.29
FFT 윈도우, 오버랩  (0) 2023.03.23
FFT 분석 기법  (0) 2023.02.07
fft window 함수  (0) 2022.11.16
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
Posted by 구차니

한줄요약

걍 18.04로 돌아갈래!!!

 

요런게 뜰 때 눈치 챘어야 했는데...

WARNING: Host distribution "ubuntu-22.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.

 

 

ubuntu 22.04에 python3.10이 설치되어 있는데

1. python3.10 이후 패키지 변경으로 인해 아래와 같은 에러가 발생한다.

강제로 python 3.9를 설치하고 /usr/bin/python 과 /usr/bin/python3 심볼릭 링크를 바꾸어 주면 우회는 가능

"ImportError: cannot import name 'Mapping' from 'collections'" with Python 3.10

[링크 : https://github.com/tensorflow/tensorboard/issues/5478]

 

2. SIGSTKSZ 에 (가 어디 있나요... -_-

아무튼 glibc 버전이 2.34 이후 부터 SIGSTKSZ가 상수가 아닌 함수로 변경되었다고.. (니미!)

| In file included from /usr/include/signal.h:328,
|                  from ./signal.h:52,
|                  from ../../m4-1.4.18/lib/c-stack.c:49:
| ../../m4-1.4.18/lib/c-stack.c:55:26: error: missing binary operator before token "("
|    55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
|       |                          ^~~~~~~~

[링크 : https://stackoverflow.com/questions/69719688/buildroot-error-when-building-with-ubuntu-21-10]

$ getconf -a | grep libc
GNU_LIBC_VERSION                   glibc 2.35

[링크 : https://ososoi.tistory.com/79]

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

Do not use Bitbake as root.  (0) 2023.08.28
imx8 yocto  (0) 2023.08.28
라즈베리 파이 with yocto project  (2) 2015.07.30
yocto project 구조  (0) 2015.07.29
라즈베리 파이 2 yocto 프로젝트?  (0) 2015.06.08
Posted by 구차니

cifs 마운트 하려는 데 아래와 같은 이상한(?) 에러가 뜨길래 찾아보니

mount: /mnt: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.

 

아래와 같은 패키지가 설치되지 않으면 마운트가 안된다고 한다.

samba 패키지는 서버/클라이언트라 마운트랑 상관이 없다.

$ sudo apt install cifs-utils

[링크 : https://askubuntu.com/questions/946132/error-mounting-samba-network-drive-wrong-fs-type-bad-option]

'프로그램 사용 > SMB(Samba)' 카테고리의 다른 글

nas samba warn  (0) 2019.03.17
smb 와 selinux 설정  (0) 2019.02.14
smb 서비스 속도향상하기(SSD-bcache, AIO)  (0) 2019.02.01
samba acpi s3 wake up  (0) 2017.08.11
삼바 서버 자동 접속 끊기(timeout) - 검색중  (0) 2017.05.31
Posted by 구차니

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

FFT 윈도우, 오버랩  (0) 2023.03.23
cabs()  (0) 2023.02.15
fft window 함수  (0) 2022.11.16
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
real to complex  (0) 2022.11.04
Posted by 구차니
프로그램 사용/gcc2023. 1. 26. 19:55

필수

-O3 -ftree-vectorize

(-O2 에서는 -ftree-vectorize가 적용되지 않는다.)

 

옵션(?)

-mfpu=neon -fopt-info-vec[-all]

 

neon을 지정안해주어도 cortex-a9 에서 vfp로 되는진 모르겠지만

약간 변환되는게 있고

neon을 지정해주면 많이 늘어난다

 

[링크 : https://developer.arm.../Compiling-NEON-Instructions/Vectorization/Enabling-auto-vectorization-in-GCC-compiler]

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

gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
gcc / 문자열 선언  (0) 2022.03.17
static link  (0) 2022.02.07
Posted by 구차니