Skip to content

Instantly share code, notes, and snippets.

<#
# Одиночная обработка с удалением исходного файла
Invoke-MKVRemux -InputFile "video.mkv" -FrameRate 25 -CleanTags -RemoveSource
# Пакетная обработка с удалением исходных файлов
Get-ChildItem "C:\Videos\*.mkv" | Start-BatchMKVRemux -FrameRate 25 -CleanTags -RemoveSource
# Пакетная обработка с предпросмотром (без реального выполнения)
Get-ChildItem "C:\Videos\*.mkv" | Start-BatchMKVRemux -FrameRate 25 -CleanTags -RemoveSource -WhatIf
# Скрипт переименования видеофайлов по данным TheTV DB
param(
[string]$FolderPath = "C:\Videos",
[string]$ApiKey = "YOUR_THETVDB_API_KEY"
)
# Подключение необходимых библиотек
Add-Type -AssemblyName System.Web.Extensions
function Get-TvShowMetadata {
<#
.SYNOPSIS
Multi-format Audio Track Encoder for MKV files
.DESCRIPTION
Extracts and encodes audio tracks from MKV files to FDK AAC and Opus formats
with intelligent bitrate selection and metadata preservation.
.PARAMETER InputFile
Path to the input MKV file
.PARAMETER OutputDir
Directory to save encoded audio files
# Define the path to FFmpeg executable
$ffmpegPath = "ffmpeg" # Modify this if FFmpeg is not in your PATH
# Function to check if FFmpeg is installed
function Check-FFmpeg {
try {
& $ffmpegPath -version | Out-Null
return $true
} catch {
Write-Host "FFmpeg is not installed or not found in the specified path." -ForegroundColor Red
@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)
@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 / 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 / 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 / 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 / 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;