ffmpeg -i in.m3u8 -acodec copy -bsf:a aac_adtstoasc -vcodec copy out.mp4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function gRS($length, $opt = '111') { | |
$r = ''; | |
//numbers only | |
$r .= ( ( (int) $opt[0] === 1) ? '012345678923456789' : ''); | |
//numbers with small letters | |
$r .= ( ( (int) $opt[1] === 1) ? 'abcdefghijklmnopqrstuvwxyz' : ''); | |
//numbers with small and capital letters | |
$r .= ( ( (int) $opt[2] === 1) ? 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' : ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Create an alphanumeric captcha the easy way - by ToshY | 05-05-2019 */ | |
function imageCaptcha($chars = 6, $lines, $bg_colour = array('R'=>204,'G'=>153,'B'=>255), $line_colours = array(array('R'=>153,'G'=>51,'B'=>102)), $txt_colours = array(array('R'=>0,'G'=>0,'B'=>0),array('R'=>255,'G'=>255,'B'=>255)), $fonts = array('arial.ttf')){ | |
// dimensions / fontsize based on amount of characters | |
$MW = round($chars * ( 100 / 3) ); $MH = round($MW / 3); $fs = round( ( 30 * (1 - exp( -0.005 * $MW ) ) ) , 2); | |
// init image with user dimensions | |
$img = imagecreatetruecolor( $MW, $MH ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Batch rename files with regex replace | |
.DESCRIPTION | |
BATCHREGEX makes it easy to batch rename your files using regex. Supply the directory of the files you need to rename; supply the regex expression you want applyp; | |
supply the new file names (including capturing groups as `$1, `$2, etc.; please note the backtick). Some experience with regex would be nice before using this. | |
Please note that the default mode for $safe_mode = 1, which means that it will show what happens when you'd rename the files but it will NOT execute the command. | |
When setting $safe_mode = 0, your regex will be executed so there's no turning back... | |
.EXAMPLE | |
In the following examples, pretend we have the following files "MyAwesomeVideo - 01 (somerubbish).mp4",..., "MyAwesomeVideo - 50 (somerubbish).mp4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The directory of the ASS files that need to be cleaned | |
$dir = "C:\Users\Kintoki\Desktop\ASS_files" | |
$files = Get-ChildItem "$dir" | Where-Object {$_.Extension -eq ".ass"} | |
#Start batch loop | |
for ($i=0; $i -lt $files.Count; $i++) { | |
$subs = $files[$i].FullName | |
$ASS = Get-Content -LiteralPath $subs | |
Write-Host ('>> File: ' + $files[$i].BaseName) | |
#Remove non-used styles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "Automatically" adds font but for some reason it still needs user interaction when the file already exists | |
function addNewFonts{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$dir | |
) | |
if($dir[-1] -ne [IO.Path]::DirectorySeparatorChar){$dir = $dir + [IO.Path]::DirectorySeparatorChar} | |
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14) | |
Get-ChildItem -Path ($dir + '*') -Include @('*.ttf','*.otf') | % { $fonts.CopyHere($_.fullname, 16) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use FFprobe to get file metadata, e.g. streams, tags, etc., in JSON format | |
import json | |
import subprocess as sp | |
def get_file_metadata(input_file): | |
return json.loads(sp.check_output(["ffprobe","-v","quiet","-print_format","json","-show_streams","-show_format",input_file]).decode('utf-8')) | |
file_metadata = get_file_metadata(r"D:\hello_world.mp4") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change metadata like Title, Comment, Description, by using Exiftool | |
# Tested with ExifTool 11.98 on Win10 and Ubuntu 18.04 | |
import subprocess as sp | |
def change_file_metadata(input_file, meta_dict={'-Title':'','-Comment':''}): | |
return sp.check_output(["exiftool", "-api", "largefilesupport=1", "-overwrite_original"] + [ '{}={}'.format(k,v) for k, v in meta_dict.items() ] + [input_file]) | |
change_file_metadata(r"D:\hello_world.mp4",{'-Title':'Hello Darkness','-Comment':'My Old Friend'}) | |
# b' 1 image files updated\r\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri May 8 00:07:46 2020 | |
@author: ToishY | |
My favorite online string increment tool "was" dead (http://www.mynikko.com/tools/tool_incrementstr.html), so I made this snippet back then. | |
Haven't tested it fully but seems to work. | |
Note: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
VOD HLS streaming for BunnyCDN with Token authentication V2 | |
NOTES: | |
> Credits to Dejan from BunnyCDN Support for the function for token authentication V2 | |
> I've created this snippet to show how to use HLS streaming with the directory tokens. | |
This is a workaround which works by appending the token query string for every request to the TS segments (see JS below) |
OlderNewer