Skip to content

Instantly share code, notes, and snippets.

View ScribbleGhost's full-sized avatar

ScribbleGhost ScribbleGhost

View GitHub Profile
@ScribbleGhost
ScribbleGhost / Get the overall video bit rate of multiple video files.py
Last active November 22, 2022 08:34
Scanning through a folder recursively to detect the overall bit rate of video files with a certain extension.
import ffmpeg # pip install ffmpeg-python (not to be cinfused with python)
import psutil # pip install psutil (might require wheels, which might be incompatible with versions above Python 3.9)
import os
import glob
import csv
# The path in which you would like to look for video files
directory = 'M:\VIDEO\MOVIES'
# The file types you want to check
@ScribbleGhost
ScribbleGhost / Adding (attaching) pictures or images to MP3 files with the mutagen library in Python 3.py
Created September 22, 2022 08:06
Adding (attaching) pictures or images to MP3 files with the mutagen library in Python 3
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC
audio_path = 'sample_original - Copy.mp3'
audio = MP3(audio_path, ID3=ID3)
# Remember to change to image/jpeg if JPG or image/png if PNG.
# https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.4.0-frames.html#attached-picture
# Remember that no description should be similar.
@ScribbleGhost
ScribbleGhost / simple_ffmpeg_script.py
Created September 16, 2022 12:12
A simple example on how you can run FFmpeg in a Python script
import subprocess
ffmpeg_options = [
'ffmpeg',
"-i", 'C:\\Users\\admin\\Desktop\\your_file.xyz',
'-c:v', 'copy',
'-c:a', 'copy',
'-y',
'out.mp4'
]
import os
import subprocess
import shutil
from os import startfile
import codecs
# Check if FLAC.exe exists in PATH
if not shutil.which('flac') is not None:
print('\nSeems like FLAC.exe is missing...')
print('Please download FLAC from: https://xiph.org/flac/download.html')
@ScribbleGhost
ScribbleGhost / gist:00ce8f3c73f0ad3a7ac9b0578b375def
Created August 4, 2022 07:42
Remove the track title (track name) from an audio track in an MKV file
for /r %i in (*.mkv) do (mkvpropedit "%i" --edit track:a1 --set "name=")
@ScribbleGhost
ScribbleGhost / source tags.csv
Created July 26, 2022 11:35
Explining the difference between different sources and how they are tagged.
SOURCE TAG DESCRIPTION
BR-DISK Usually the whole ISO (digital disc image) of a Blu-Ray release.
REMUX Untouched and unprocessed data from a source.
Blu-ray Encoded or reencoded data from a Blu-Ray.
WEBDL WEBDL Untouched video a streaming site as opposed to a screencapture.
WEBRip Older tag for untouched DLs. Now used for screencaptured content from streaming sites.
HDTV Usually a screen recording of a digital TV signal. Often includes channel logos and commercial cuts.
DVD VOB,VTS,BUP,IFO -files from DVDs. Or it can be an ISO of the DVD.
SDTV Usually a screen recording of an analog TV signal. Often includes channel logos and commercial cuts.
Unknown Unknown source.
SUBTAG LANGUAGE
aa Afar
ab Abkhazian
ae Avestan
af Afrikaans
ak Akan
am Amharic
an Aragonese
ar Arabic
as Assamese
@ScribbleGhost
ScribbleGhost / Should I use the "Fix OCR errors" option in Subtitle edit? Here is an example (check the history to compare)
Created July 14, 2022 07:07
Should I use the "Fix OCR errors" option in Subtitle edit? Here is an example (check the history to compare)
1
00:00:01,043 --> 00:00:03,837
[ Gunfire, explosion ]
2
00:00:04,838 --> 00:00:06,757
Get us out of here.
I'll hold them off.
3
@ScribbleGhost
ScribbleGhost / EAC log with or without gap detection.log
Last active July 7, 2022 07:20
EAC log with or without gap detection
Exact Audio Copy V1.6 from 23. October 2020
EAC extraction logfile from 4. July 2022, 15:56
Unknown Artist / Unknown Title
Used drive : ASUS BW-XXXX-X Adapter: 1 ID: 0
Read mode : Secure
Utilize accurate stream : Yes
for /r %i in (*.mkv) do (ffmpeg -i "%i" -vf "fps=12,setpts=0.25*PTS,scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 %~ni.gif)