Skip to content

Instantly share code, notes, and snippets.

View jackersson's full-sized avatar

Taras jackersson

View GitHub Profile
Gst-Pipelines
1: filesrc location=video.mp4 ! qtdemux ! h264parse ! avdec_h264 ! videoconvert n-threads=0 ! video/x-raw,format=RGB,width=1920,height=1080 ! appsink emit-signals=True sync=false
2: appsrc caps=video/x-raw,format=RGB,width=1920,height=1080 emit-signals=True is-live=true ! videoconvert ! x264enc tune=zerolatency ! mp4mux ! filesink location=1.mp4 sync=false
Getting an error:
> gst_segment_to_running_time: assertion 'segment->format == format' failed
"""
Loops video
Usage:
python gst_loop_playback.py -l "filesrc location=video0.mp4 ! decodebin ! videoconvert ! gtksink sync=False" -r 2
"""
import os
import traceback
import argparse
# *************** Installation **********************
git clone https://github.com/intel/libva.git
./autogen.sh
make -j8
sudo make install
git clone https://github.com/intel/intel-vaapi-driver.git
# Converts video from MPEG to MP4 so it can be opened by VLC or other media player
# And concats if needed
# Run in folder with videos ./mpeg_2_mp4.sh
# chmod u+x ./mpeg_2_mp4.sh
ALL_VIDEOS_FILE="all.txt"
STATUS_FILE="status.txt"
"""
python3 gst_video_split.py -f "/media/taras/Transcend/Dataai/OBI/test_with_overlay/00000004063000000.mp4" -o /media/taras/Transcend/Dataai/OBI/test_with_overlay/output -t 60
python3 gst_video_split.py -f "/media/taras/Transcend/Dataai/OBI/test/00000004063000000.mp4" -o /media/taras/Transcend/Dataai/OBI/test_with_overlay/output -t 60
"""
import os
import datetime
import traceback
@jackersson
jackersson / tensorflow.sh
Last active February 6, 2019 10:51
tensorflow.sh
#!/bin/bash
#!/usr/bin/env bash
#
SCRIPT_DIR="$(cd "$(dirname "${0}")"; pwd)"
RED="\033[1;31m"
YELLOW="\033[1;33m"
GREEN="\033[0;32m"
NO_COLOR="\033[0m"
required_libs = {
"gstreamer": "1.14.2".split("."),
"tensorflow": "1.10.0".split("."),
"opencv": "3.4.0".split(".")
}
def check_opencv():
major, minor, _ = 0, 0, 0
#!/usr/bin/python3
#-*- coding: utf-8 -*-
import logging
import timeit
import traceback
import time
import gi
gi.require_version('Gst', '1.0')
@jackersson
jackersson / setup.py
Created July 25, 2018 07:59
run_custom_script_with_pip_package
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
setup for AI Models package
"""
from setuptools import setup # , Command
from setuptools.command.install import install
with open('README.md') as readme_file:
@jackersson
jackersson / build-gstreamer.sh
Last active March 27, 2023 02:06
Build gstreamer from source
#!/bin/bash
# Set your target branch
BRANCH="1.14.2"
exec > >(tee build-gstreamer.log)
exec 2>&1
[ ! -d orc ] && git clone git://anongit.freedesktop.org/git/gstreamer/orc
[ ! -d gstreamer ] && git clone git://anongit.freedesktop.org/git/gstreamer/gstreamer