Archive


Category: Uncategorized

  • GStreamer Tips

    Display the (Logitech) webcam (/dev/video0) on screen (autovideosink ==> display on screen) gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink Latency is high due to video conversion Using native MJPG stream of the Logitech Camera gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,framerate=30/1 ! jpegparse ! jpegdec ! videoconvert ! autovideosink Record a video gst-launch-1.0 v4l2src ! x264enc […]

  • v4l2 utils

    installation sudo apt install v4l-utils sudo apt show v4l-utils Package: v4l-utils Version: 1.20.0-2 Priority: optional Section: utils Maintainer: Gregor Jasny <gjasny@googlemail.com> Installed-Size: 1826 kB Depends: libv4l-0 (= 1.20.0-2), libv4l2rds0 (= 1.20.0-2), libc6 (>= 2.28), libgcc-s1 (>= 3.5), libstdc++6 (>= 5.2), libudev1 (>= 183) Breaks: ivtv-utils (<< 1.4.1-2), media-ctl Replaces: ivtv-utils (<< 1.4.1-2), media-ctl Homepage: https://linuxtv.org/downloads/v4l-utils/ […]

  • v4l2looback

    commands to install v4l2loopback sudo rmmod v4l2loopback.ko sudo insmod v4l2loopback.ko video_nr=12 max_buffers=2 exclusive_caps=1 card_label="VirtualCam" Other commands sudo modprobe v4l2loopback video_nr=12 max_buffers=2 exclusive_caps=1 card_label="VirtualCam" sudo modprobe v4l2loopback video_nr="12"\ 'card_label=VirtualCam' \ exclusive_caps=1 max_buffers=2 gst-launch-1.0 videotestsrc ! \ video/x-raw, format=YUY2, width=320, height=240 ! \ xvimagesink gst-launch-1.0 v4l2src device=/dev/video12 ! autovideosink gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video12 gst-launch-1.0 -v videotestsrc […]

  • gitlab runner

    在执行 pipeline 上机器上安装 gitlab runner # Download the binary for your system sudo curl -L –output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 # Give it permission to execute sudo chmod +x /usr/local/bin/gitlab-runner # Create a GitLab Runner user sudo useradd –comment 'GitLab Runner' –create-home gitlab-runner –shell /bin/bash # Install and run as a service sudo gitlab-runner install –user=gitlab-runner –working-directory=/home/gitlab-runner […]

  • multi user chat by boost beast

    overview @startuml main -> io_context: construct main -> shared_state: construct main -> listener: construct main -> listener : run @enduml classes @startuml class http_session { beast::tcp_stream stream_; beast::flat_buffer buffer_; boost::shared_ptr state_; boost::optional parser_; struct send_lambda; void fail(beast::error_code ec, char const* what); void do_read(); void on_read(beast::error_code ec, std::size_t); void on_write(beast::error_code ec, std::size_t, bool close); void run(); […]

  • EMQ with python

    start EMQX docker run -d –name emqx -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx:latest install paho-mqtt library pip3 install paho-mqtt start subscriber import paho.mqtt.client as mqtt ​ # The callback function of connection def on_connect(client, userdata, flags, rc): print(f"Connected with result code {rc}") client.subscribe("$SYS/#") # The callback function for received message […]

  • c++ 中恼人的依赖管理

    Java 有 maven, Python 有 pip, C++ 呢? C++ 有 vcpkg 和 conan 示例 比较一下 libzmq 的安装 从源码编译安装 git clone git@github.com:zeromq/libzmq.git cd libzmq ./autogen.sh ./configure make make install 从 vcpkg 安装 git clone https://github.com/microsoft/vcpkg.git ./bootstrap-vcpkg.bat # For powershell ./bootstrap-vcpkg.sh # For bash ./vcpkg install zeromq 参见 https://github.com/52doho/vcpkg-vs-conan https://devbins.github.io/post/conan/

  • boost asio executor

    boost::asio "Executors and Asynchronous Operations" — https://chriskohlhoff.github.io/executors/

  • 向曾国藩学习

    向曾国藩学习 早起 自省 读书写笔记 曾国藩语录 1.凡人做一事,便须全副精神注在此一事,首尾不懈,不可见异思迁,做这样,想那样,坐这山,望那山。人而无恒,终身一无所成。 2.人该省事,不该怕事。人该脱俗,不可矫俗。不该顺时,不可趋时。 3.天可补,海可填,南山可移。日月既往,不可复追。 4.天下古今之庸人,皆以一惰字致败;天下古今之人才,皆以一傲字致败。 5.用功不求太猛,但求有恒。 6.既往不恋,当下不杂,未来不迎。 7.多躁者必无沉毅之识,多畏者必无卓越之见,多欲者必无慷慨之节,多言者必无质实之心,多勇者必无文学之雅。 8.士人读书,第一要有志,第二要有识,第三要有恒。有志,则断不甘为下流。有识,则知学问无尽,不敢以一得自足;如河伯之观海,如井蛙之窥天,皆无见识也。有恒,则断无不成之事。此三者缺一不可。 9.一个喜欢读书的人,品格不会坏到哪去;一个品格好的人,一生的运气不会差到哪去。 10.与多疑人共事,事必不成。与好利人共事,己必受累。 11.行事不可任心,说话不可任口。 12.轻财足以聚人,侓己足以服人,量宽足以得人,身先足以率人。 13.观人四法:讲信用、无官气、有条理、少大话。 14.坚其志,苦其心,劳其力,事无大小,必有所成。 15.少年经不得顺境,中年经不得闲境,晚年经不得逆境。

  • SRS with WebRTC

    1. RTMP to WebRTC Start SRS with configuration – rtpm2rtc.conf CANDIDATE="192.168.1.10" docker run –rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \ –env CANDIDATE=$CANDIDATE -p 8000:8000/udp \ registry.cn-hangzhou.aliyuncs.com/ossrs/srs:4 ./objs/srs -c conf/rtmp2rtc.conf use ffmpeg to push stream docker run –rm -it registry.cn-hangzhou.aliyuncs.com/ossrs/srs:encoder ffmpeg -stream_loop -1 -re -i doc/source.flv \ -c copy -f flv rtmp://host.docker.internal/live/livestream 2. WebRTC […]