GraalVM 更高效

GraalVM 提前将您的 Java 应用程序编译成独立的二进制文件。 与在 Java 虚拟机 (JVM) 上运行的应用程序相比,这些二进制文件更小,启动速度快 100 倍,无需预热即可提供峰值性能,并且使用更少的内存和 CPU。 GraalVM 减少了应用程序的攻击面。 它从应用程序二进制文件中排除未使用的类、方法和字段。 它将反射和其他动态 Java 语言功能限制为仅构建时间。 它在运行时不会加载任何未知代码。 Spring Boot、Micronaut、Helidon 和 Quarkus 等流行的微服务框架以及 Oracle Cloud Infrastructure、Amazon Web Services、Google Cloud Platform 和 Microsoft Azure 等云平台都支持 GraalVM。 与在 Java 虚拟机 (JVM) 上运行的应用程序相比,通过配置文件引导的优化和 G1(垃圾优先)垃圾收集器,您可以获得更低的延迟以及同等或更好的峰值性能和吞吐量。 您可以像 IDE 中的任何其他 Java 开发工具包一样使用 GraalVM JDK →Read more

探针让你明察秋豪

Probes 探针 Probes are callbacks that can be installed by the application and will notify the application about the states of the dataflow. 探针就是一些回调函数,它可以装载到应用程序中,由应用程序回调这些函数,以通知数据流的状态信息。 需求 应用程序应该能够监视和控制 pads 上的数据流。 有以下需求: 当 pad 空闲时收到通知,并确保 pad 保持空闲状态。 这对于能够在不破坏数据流的情况下实现元素的动态重新链接至关重要。 当数据、事件 event 或查询 query 在 pad 上推送或发送时收到通知。 还应该可以检查和修改数据。 能够根据回调的结果丢弃 drop、传递 pass 和阻塞 block 数据。 能够根据应用程序线程执行的方法在阻塞的 pad 上丢弃或传递数据。 概述 函数 gst_pad_add_probe() […] →Read more

k8s concepts

Pod:在同一主机上一起部署的一组容器。Pod 是节点上最小的可部署单元,它提供了一种挂载存储、设置环境变量以及供其他容器配置信息的方法。当 Pod 中的所有容器退出时,Pod 也会消亡。 Service:定义一组逻辑 Pod 及其访问策略的抽象。 Volume:可供 Pod 中运行的容器访问的目录。 Kubernetes 架构使用基础资源作为一组更高级资源的基本层。高级资源实现了实际生产使用场景所需的功能,这些功能利用/扩展了基础资源的功能。在图 2.1 中,你可以看到 ReplicaSet 资源控制着一个或多个 Pod 资源的创建。其他的一些高级资源的示例包括: ReplicaSet:定义相同配置 Pod 运行的期望数量。如果 ReplicaSet 中的一个 Pod 终止,则会启动一个新的 Pod,从而将运行中的 Pod 数量恢复到期望数量。 Deployment:为 Pod 和 ReplicaSet 赋予声明式更新的能力。 Job:创建一个或多个运行完即停止的 Pod。 CronJob:基于时间计划来创建 Job。 Namespace:大多数 Kubernetes 资源都属于一个(并且只有一个)命名空间。命名空间定义了名称的范围,其中特定命名空间中的资源命名必须唯一。命名空间还提供了一种通过基于角色的访问控制(RBAC)、网络策略和资源配额等将用户和应用程序相互隔离的方法。这些控制允许创建一个多租户 Kubernetes 集群,允许多个用户共享同一个集群并避免相互影响(例如,「近邻干扰」问题)。 →Read more

Caps Negotiation

Caps Negotiatio## Caps Negotiation 能力协商概述 Caps negotiation is the act of finding a media format (GstCaps) between elements that they can handle. This process in GStreamer can in most cases find an optimal solution for the complete pipeline. 能力协商是指在两个元素之间寻找一个彼此可以处理的媒体格式,在 GStreamer 中多数情况下是为了整个管道寻找一个优化的方案。 Caps negotiation basics In GStreamer, negotiation of the media format always follows the following […] →Read more

GStreamer State Transition

overview Both elements and pads can be in different states. The states of the pads are linked to the state of the element so the design of the states is mainly focused around the element states. An element can be in 4 states. NULL, READY, PAUSED and PLAYING. When an element is initially instantiated, it […] →Read more

gstreamer tips 2

install gstreamer and plugins sudo apt-get install -y gstreamer1.0-tools gstreamer1.0-nice gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libgstreamer1.0-dev git libglib2.0-dev libgstreamer-plugins-bad1.0-dev libsoup2.4-dev libjson-glib-dev send/receive rtp over rtp and udp gst-launch-1.0 videotestsrc ! video/x-raw, width=640, height=360 ! queue ! vpuenc_h264 ! rtph264pay ! udpsink host=192.168.60.5 port=5555 gst-launch-1.0 udpsrc port=5555 \ ! application/x-rtp, encoding-name=H264, payload=96 \ ! queue \ ! rtph264depay […] →Read more

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 […] →Read more

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/ […] →Read more

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 […] →Read more

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 […] →Read more