Skip to content

Instantly share code, notes, and snippets.

View JySzE's full-sized avatar
💭
In Goldenrod City

JySzE JySzE

💭
In Goldenrod City
View GitHub Profile

How to Offset Chapter Timecodes Using Python

This script processes XML files in a specified directory, adjusting the chapter start times based on a user-defined offset. It reads the XML files, identifies <ChapterTimeStart> tags, and updates their time values accordingly.

Here’s a step-by-step guide on how to use the script:

Prerequisites

  1. Python 3.x: The script is written in Python and requires Python 3.x to run.
  2. XML Files: The script is designed to work with XML files that contain chapter timecodes in the <ChapterTimeStart> tags.
  3. Text Editor: You can edit the script with any text editor, like VSCode or Sublime.

Parsing Video Metadata with Batch

Note: This script can be easily adapted or reduced to extract different metadata entries by modifying the findstr lines to match the desired fields.

The metadata is saved in a text file named output.txt.


Prerequisites

  1. FFmpeg: Ensure you have FFmpeg installed on your system.

Guide to Generating Keyframes with Batch

This guide explains how to use the provided batch script to generate keyframes from video files.

The script is designed for use with AviSynth and requires specific tools and configurations.


Requirements

  1. AviSynth+ (64-bit version)
@JySzE
JySzE / How to Sync File Names Between Two Folders Using Powershell.md
Created January 1, 2025 18:52
How to Sync File Names Between Two Folders Using Powershell

How to Sync File Names Between Two Folders Using Powershell

Purpose

This script renames files in a target folder to match the names of files in a source folder. It’s helpful for:

  • Batch Renaming: Ensuring file names in the target folder align with those in the source folder.
  • Complex Naming Requirements: Handling scenarios where file-specific naming conventions are required, and bulk renaming utilities aren’t suitable.

Step-by-Step Instructions

How to Use the Scripts to Scan and Remove EIA-608 Subtitles from MKV Files

This guide walks you through using two Python scripts for identifying and removing EIA-608 subtitles from MKV video files. The first script scans MKV files in a specified directory for EIA-608 subtitles and logs the file paths. The second script removes the subtitles while backing up the original files.


1. Prerequisites

  • Python: Ensure you have Python installed on your system.
  • MPV Player: Download and install the MPV player. Ensure you update the mpv.com path in the script.
  • FFmpeg: Download and install FFmpeg. Add it to your system's PATH to run it from the command line.
@JySzE
JySzE / build-mpv_silicon.sh
Last active March 27, 2025 14:47 — forked from dbrookman/build-mpv_silicon.sh
How to build mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
@JySzE
JySzE / mpv.conf
Last active March 28, 2025 02:34
JySzE MacOS MPV Config [ No longer maintained ]
# MacOS Version 1.1
# 03/09/2025
# Requires MPV v0.38.0 or newer
###############################################################################################################################################
# Player GUI Options
###############################################################################################################################################

For Windows 10, change these keys in regedit:

  • Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command
  • Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\open\command
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\edit\command
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cmdfile\shell\edit\command

From: %SystemRoot%\system32\NOTEPAD.EXE %1 To: "%ProgramFiles%\Sublime Text 3\sublime_text.exe" "%1" Or: "%ProgramFiles%{insert-path-to-fave-editor}" "%1"

@JySzE
JySzE / SoM_MPV_Builder.bat
Last active May 14, 2025 22:02
SoM MPV BUILDER
@echo off
COLOR 1F
mode con: cols=59 lines=52
set PATH=%SystemRoot%\System32;%PATH%
cd /d "%~dp0"
echo ==========================================================