$ sudo apt update && sudo apt upgrade
$ sudo apt-get dist-upgrade

 

glib 설치

1. glib download

https://download.gnome.org/sources/glib/

 

Index of /sources/glib/

 

download.gnome.org

2. 압축 풀기

~$ tar xvf glib-2.9.6.tar.gz

3. 구성

~$ cd glib-2.9.6/
~/glib-2.9.6$ ./configure

4. configure 중간에 없다고 오류나는 패키지들 설치

http://www.gnu.org/software/gettext/gettext.html

 

gettext - GNU Project - Free Software Foundation

gettext Usually, programs are written and documented in English, and use English at execution time for interacting with users. This is true not only from within GNU, but also in a great deal of proprietary and free software. Using a common language is quit

www.gnu.org

~$ sudo apt-get install gettext

 

GStreamer 설치

$ sudo apt update

설치

$ sudo apt install libgstreamer1.0-0 libgstreamer1.0-dev gstreamer1.0-tools gstreamer1.0-doc gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly  gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstreamer-plugins-base1.0-dev

확인

$ gst-inspect-1.0 --version

웹캠 확인

$ gst-launch-1.0 autovideosrc device=/dev/video0 ! autovideosink

샘플코드

#include <gst/gst.h>
#include <iostream>

// compile & run
// $ g++ gstreamer_example.cpp -o gstreamer_example `pkg-config --cflags --libs gstreamer-1.0`
// $ ./gstreamer_example

int main() 
{
    GstElement *pipeline, *source, *sink;
    GstBus *bus;
    GstMessage *msg;
    GstStateChangeReturn ret;

    gst_init(NULL, NULL);

    pipeline = gst_pipeline_new ("pipeline");
    source = gst_element_factory_make ("autovideosrc", "source");
    sink = gst_element_factory_make ("autovideosink", "sink");

    if (!pipeline || !source || !sink) 
    {
        std::cout << "not all elements created: pipeline[" << !pipeline
            << "] source[" << !source
            << "] sink["<< !sink << "]" << std::endl;
        return -1;
    }

    g_object_set(G_OBJECT (sink), "sync", FALSE, NULL);

    gst_bin_add_many (GST_BIN (pipeline), source, sink, NULL);
    if (gst_element_link (source, sink) != TRUE) 
    {
        std::cout << "Elements could not be linked." << std::endl;
        gst_object_unref (pipeline);
        return -1;
    }

    ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
    if (ret == GST_STATE_CHANGE_FAILURE) 
    {
        std::cout << "Unable to set the pipeline to the playing state." << std::endl;
        gst_object_unref (pipeline);
        return -1;
    }

    bus = gst_element_get_bus (pipeline);

    std::cout << "press CTRL + C" << std::endl;

    for (;;);

    gst_object_unref(bus);
    gst_element_set_state(pipeline, GST_STATE_NULL);
    gst_object_unref(pipeline);
}

컴파일 및 실행

$ g++ gstreamer_example.cpp -o gstreamer_example `pkg-config --cflags --libs gstreamer-1.0`

$ ./gstreamer_example

 

 

'OS > Linux' 카테고리의 다른 글

CMake Install  (0) 2022.10.01
VSCode: ssh로 접근해서 편집된 파일 저장 시 permission 문제  (0) 2022.08.22
WSL2에서 GUI 사용하기  (0) 2021.10.19
Installing Linux Developer Tools  (0) 2021.10.19
Linux OS version  (0) 2021.10.07
$ wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
$ sudo apt-get update
$ sudo apt-get install atom

WSL2가 설치되었고 Ubuntu(20.04 LTS)도 설치되어 있음.

 

Xming X Server for Windows 설치

(2021.10.19 - Xming-6-9-0-31-setup.exe)

https://sourceforge.net/projects/xming/

 

Xming X Server for Windows

Download Xming X Server for Windows for free. X Window System Server for Windows. Xming is the leading X Window System Server for Microsoft Windows 8/7/Vista/XP (+ server 2012/2008/2003). It is fully featured, small and fast, simple to install and because

sourceforge.net

XLaunch 실행

Multiple windows 선택
No Access Control 체크
[마침]

Windows 보안 경고 화면이 뜨면 모두 체크하고 [액세스 허용] 클릭

만약 체크를 잘못하고 넘어간 경우:

"제어판 > 시스템 및 보안 > Windows Defender 방화벽"

Windows Defender 방화벽을 통해 앱 또는 기능 허용

 

WSL2 > Ubuntu 상에서 DNS 서버 IP 주소 확인

$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.20.96.1

.bashrc에 추가, 설정 적용

$ echo "export DISPLAY=172.20.96.1:0" >> ~/.bashrc
$ source ~/.bashrc

gedit 패키지 설치 후 확인

$ sudo apt-get update
$ sudo apt-get install gedit
$ gedit

XLauncher(Xming)을 통해 윈도우 상에서 뜬 리눅스 GUI

GUI 프로그램 설치

Nautilus : 리눅스 기본 파일 관리자

File Roller : 압축 관리 프로그램

$ sudo apt -y install nautilus file-roller

Atom : text 편집기

$ wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
$ sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
$ sudo apt-get update
$ sudo apt-get install atom

 

설치된 패키지 확인

$ dpkg --get-selections

'OS > Linux' 카테고리의 다른 글

CMake Install  (0) 2022.10.01
VSCode: ssh로 접근해서 편집된 파일 저장 시 permission 문제  (0) 2022.08.22
glib/streamer install  (0) 2021.11.15
Installing Linux Developer Tools  (0) 2021.10.19
Linux OS version  (0) 2021.10.07

Across the different distros of Linux, there are different packages you'll need to install:

  • Debian, Ubuntu, popOS, and other Debian-based distributions:
$ sudo apt-get update
$ sudo apt-get install build-essential tar curl zip unzip
  • CentOS
$ sudo yum install centos-release-scl
$ sudo yum install devtoolset-7
$ scl enable devtoolset-7 bash

 

Ubuntu

$ sudo apt-get install bison
$ sudo apt-get install pkg-config

$ sudo apt-get install python3-distutils

 

'OS > Linux' 카테고리의 다른 글

CMake Install  (0) 2022.10.01
VSCode: ssh로 접근해서 편집된 파일 저장 시 permission 문제  (0) 2022.08.22
glib/streamer install  (0) 2021.11.15
WSL2에서 GUI 사용하기  (0) 2021.10.19
Linux OS version  (0) 2021.10.07

커널에 대한 정보

uname -a

OS 버전에 대한 정보

:~$ cat /etc/issue
Ubuntu 20.04.3 LTS \n \l

:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

:~$ getconf LONG_BIT
64

:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

'OS > Linux' 카테고리의 다른 글

CMake Install  (0) 2022.10.01
VSCode: ssh로 접근해서 편집된 파일 저장 시 permission 문제  (0) 2022.08.22
glib/streamer install  (0) 2021.11.15
WSL2에서 GUI 사용하기  (0) 2021.10.19
Installing Linux Developer Tools  (0) 2021.10.19

+ Recent posts