Skip to content

Instantly share code, notes, and snippets.

View omair18's full-sized avatar

omair18 omair18

View GitHub Profile
@omair18
omair18 / postman_installation.md
Created February 15, 2023 02:36 — forked from Akhil-Suresh/postman_installation.md
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@omair18
omair18 / promtail_docker_logs.md
Created January 11, 2022 07:29 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
@omair18
omair18 / ffmpeg_gstreamer.sh
Last active October 13, 2020 14:57
useful ffmpeg & gstreamer commands
#restream rtsp to udp link
ffmpeg -i "rtsp://admin:admin123@192.168.100.2:554/" -pix_fmt yuv420p -deinterlace -vf "scale=640:360" -vsync 1 -threads 0 -vcodec libx264 -r 29.970 -g 60 -sc_threshold 0 -b:v 1024k -bufsize 0 -maxrate 1280k -preset medium -tune film -acodec aac -b:a 128k -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -vbsf h264_mp4toannexb -f mpegts udp://0.0.0.0:10000
# create a test stream and create rtmp stream
# start nginx server before running this
ffmpeg -r 30 -f lavfi -i testsrc -vf scale=1280:960 -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -f flv rtmp://localhost/mylive/test
import numpy as np
import cv2
from multiprocessing import Process
def send():
#originals
#cap_send = cv2.VideoCapture('videotestsrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! appsink', cv2.CAP_GSTREAMER) #orginal
#out_send = cv2.VideoWriter('appsrc ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000',cv2.CAP_GSTREAMER,0, 20, (320,240), True) #original
#cap_receive = cv2.VideoCapture('udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! appsink', cv2.CAP_GSTREAMER)
######
@omair18
omair18 / commands.sh
Created July 13, 2019 10:40
Various useful Linux commands for daily usage
#to check video card working right now
sudo lshw -C video
#!/bin/bash
# to know which device is connected at which port
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
### NOTE ###
The below gist is converted to a blog post and available at below link. Refer than instead.
http://hemenkapadia.github.io/blog/2016/05/07/Ubuntu-with-Nvidia-Bumblebee.html
#### Note about kernel versions ####
Between kernel versions 4.2 and 4.4 there are different options that need to bet set
@omair18
omair18 / pts2pcd
Created July 24, 2016 13:54 — forked from lorinma/pts2pcd
convert pts file to pcd file
filename="DamagedBeam.pts"
from numpy import loadtxt
from numpy import savetxt
lines = loadtxt(filename,skiprows=1)
size=str(lines[:,0].size)
header = "VERSION .7\nFIELDS x y z\nSIZE 4 4 4\nTYPE F F F\nCOUNT 1 1 1\nWIDTH "+size+"\nHEIGHT 1\nVIEWPOINT 0 0 0 1 0 0 0\nPOINTS "+size+"\nDATA ascii"
pcd=lines[:,[0,1,2]]
savetxt("DamagedBeam.pcd", pcd, fmt="%f",header=header,comments='')