Skip to content

Instantly share code, notes, and snippets.

@pysh
pysh / keytool_cert_gen.md
Last active April 23, 2024 15:24
Keytool generate certificates

Export key from jks to pfx

keytool -importkeystore -srckeystore existing-store.jks -destkeystore new-store.p12 -deststoretype PKCS12

---

The command below will create a pkcs12 Java keystore server.jks with a self-signed SSL certificate:

keytool \
@pysh
pysh / AVSShader.avs
Last active April 23, 2024 15:23
AVSShader #AviSynth
AddAutoloadDir("X:\Apps\_VideoEncoding\StaxRip\Apps\FrameServer\AviSynth\plugins")
LoadPlugin("X:\Apps\_VideoEncoding\StaxRip\Apps\Plugins\Dual\L-SMASH-Works\LSMASHSource.dll")
LWLibavVideoSource("1iPebC-9jwI.mkv")
ConvertBits(bits=16)
ConvertToShader(Precision = 2)
s = last
Shader("X:\Apps\_VideoEncoding\StaxRip\Apps\Plugins\AVS\AviSynthShader\Sharpen Adaptive.hlsl", output = 1)
ExecuteShader(last, s, Precision=2, OutputPrecision=2, Clip1Precision=2)
ConvertFromShader(last, Precision = 2, Format="YV12")
@pysh
pysh / ffmpeg_snippets.md
Last active April 23, 2024 16:03
ffmpeg snippets #ffmpeg

Encoding audio and copy metadata, subs, chapters, etc

ffmpeg -i ".\input+.mkv" -y -vn -c:a libopus -b:a 64k ".\output+.mkv"

Encoding audio with channel layout and setting the title of the audio0

ffmpeg -i ".\input+.mkv" -y -vn -c:a libopus -af aformat=channel_layouts="7.1|5.1|stereo" -b:a 64k -metadata:s:a title="Audio#0 Title" ".\output+2.mkv"
@pysh
pysh / vcpkg_install_ffmpeg.cmd
Created April 27, 2024 16:52
How to install vcpkg with ffmpeg #ffmpeg #vcpkg
REM More info:
REM https://github.com/Microsoft/vcpkg
REM https://learn.microsoft.com/ru-ru/vcpkg/get_started/get-started-packaging
cd /D "d:\Sources\"
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
.\vcpkg install "ffmpeg:x64-windows"
@pysh
pysh / zabbix_upgrade_6.4_to_7.0.sh
Last active July 17, 2024 11:26
Zabbix upgrade 6.4 to 7.0
# Zabbix upgrade 6.4 to 7.0
# https://github.com/mvenzi/zabbix_upgrade
# CRIAR AS PASTAS PARA O BACKUP
mkdir -p /mnt/bkp_zabbix/etc_zabbix/zabbix_conf_files;
mkdir -p /mnt/bkp_zabbix/usr_sbin/zabbix_server_files;
mkdir -p /mnt/bkp_zabbix/usr_share_doc/zabbix_files;
mkdir -p /mnt/bkp_zabbix/etc_nginx/conf_files;
mkdir -p /mnt/bkp_zabbix/etc_nginx/conf_d/conf_files;
@pysh
pysh / options.md
Last active July 19, 2024 11:24
yt-dlp options

Verbosity and Simulation Options:

--progress-template [TYPES:]TEMPLATE
                                Template for progress outputs, optionally
                                prefixed with one of "download:" (default),
                                "download-title:" (the console title),
                                "postprocess:",  or "postprocess-title:".
                                The video's fields are accessible under the
 "info" key and the progress attributes are
@pysh
pysh / vs_trim.vpy
Last active September 14, 2024 06:09
VapourSynth_Trim
from vapoursynth import core
import math
core.max_cache_size=1024
clipV = core.lsmas.LWLibavSource("\\\\?\\y:\.temp\YT_y\Большое шоу\Мега Большое шоу 9 сезон. Расширенная версия. [-110135406_456243369].mkv", cachefile="\\\\?\\y:\.temp\YT_y\Большое шоу\Мега Большое шоу 9 сезон. Расширенная версия. [-110135406_456243369].mkv.lwi")
clipA = core.bas.Source(source=r'y:\.temp\YT_y\Большое шоу\Мега Большое шоу 9 сезон. Расширенная версия. [-110135406_456243369].mkv') #, track, adjustdelay, exactsamples, enable_drefs, use_absolute_path, drc_scale)
def framesToSamples(frameNum, framerate=25, samplerate=48000):
return math.floor((samplerate/framerate)*frameNum)
@pysh
pysh / old_functions.ps1
Last active January 23, 2025 00:44
Old PS Video Functions
# Old PS functions
function Get-VMAFValue {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path -LiteralPath $_})]
[string]$ReferenceVideo,
@pysh
pysh / ffmpec_audio_encoding.ps1
Last active January 26, 2025 13:31
encoding audio with ffmpeg
<# Различные параметры кодирования звука
# rav1e
# $prmLibOpus = '-c:a:0 libopus -b:a:0 280k -c:a:1 libopus -b:a:1 280k -c:a:2 libopus -b:a:2 144k -c:a:3 libopus -b:a:3 144k'
# $prmLibOpus = '-c:a:0 libopus -b:a:0 320k -ac:0 6 -filter:0 aformat=channel_layouts=5.1 -c:a:1 libopus -b:a:1 320k -ac:1 6 -filter:1 aformat=channel_layouts=5.1 -c:a:2 libopus -b:a:2 160k -c:a:3 libopus -b:a:3 160k'
# $prmLibOpus = '-c:a:0 copy -c:a:1 libopus -b:a:1 160k'
@pysh
pysh / SVTAV_color_params.txt
Last active January 26, 2025 13:36
SVTAV coror parameters
--color-primaries
1: bt709, BT.709
2: unspecified, default
4: bt470m, BT.470 System M (historical)
5: bt470bg, BT.470 System B, G (historical)
6: bt601, BT.601
7: smpte240, SMPTE 240
8: film, Generic film (color filters using illuminant C)
9: bt2020, BT.2020, BT.2100
10: xyz, SMPTE 428 (CIE 1921 XYZ)