Skip to content

Instantly share code, notes, and snippets.

View jsfag's full-sized avatar

Pushkin jsfag

View GitHub Profile
@jsfag
jsfag / converter_ffmpeg_cuda_scale.bat
Created August 29, 2022 04:45
FFMPEG re-encodes in.mp4 with GPU acceleration [CUDA, SCALE].
ffmpeg -hwaccel cuda -i .\in.mp4 -c:v h264_nvenc -preset fast -b:v 4M -maxrate 6M -vf scale=-1:720 out.mp4
@jsfag
jsfag / disable_gpu_partition.ps1
Created August 28, 2022 10:41
Enable and disable GPU partition (edit for your PCI addresses and VM name).
# Change to name of TARGET-VM.
$vm='win10'
# Change to PCI device location (💡 Location).
$Location = 'PCIROOT(0)#PCI(0301)#PCI(0000)#PCI(0000)#PCI(0000)'
Remove-VMAssignableDevice -LocationPath $locationPath -VMName $vm
Mount-VMHostAssignableDevice -LocationPath $locationPath
@jsfag
jsfag / includer_powercfg_ultimate.bat
Created August 28, 2022 10:36
Enables the 'Ultimate Performance' selectable item in 'Power Options' (Windows 10).
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
@jsfag
jsfag / converter_ffmpeg_h264_amf_scale.bat
Created August 28, 2022 10:26
FFMPEG re-encodes in.mp4 with GPU acceleration [AMDGPU, SCALE].
ffmpeg.exe -i .\in.mp4 -threads 16 -usage ultralowlatency -c:v:0 hevc_amf -level 1 -quality quality -b:v 2M -vf scale=1280x720 -bufsize 2000M -maxrate 6M -c:a aac -b:a 128k out.mp4
@jsfag
jsfag / converter_ffmpeg_h264_amf.bat
Created August 28, 2022 10:25
FFMPEG re-encodes in.mp4 with GPU acceleration [AMDGPU, NO-SCALE].
ffmpeg.exe -i in.mp4 -threads 16 -usage ultralowlatency -c:v:0 h264_amf -level 1 -quality quality -b:v 6M -bufsize 2000M -maxrate 8M -c:a aac -b:a 128k out.mp4
@jsfag
jsfag / joiner_ffmpeg_copy.bat
Created August 28, 2022 10:18
FFMPEG lists files and concatenates without conversion them into the one.
(for %%i in (*.mp4) do @echo file '%%i') > list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4
@jsfag
jsfag / converter_ffmpeg_png_jpg.bat
Created August 28, 2022 10:15
FFMPEG converts all *.PNG without alpha to *.JPG in the current directory.
for %%i in (*.png) do ffmpeg -y -i "%%i" -vf format=yuva444p,geq='if(lte(alpha(X,Y),16),255,p(X,Y))':'if(lte(alpha(X,Y),16),128,p(X,Y))':'if(lte(alpha(X,Y),16),128,p(X,Y))' "%%~ni".jpg
@jsfag
jsfag / converter_ffmpeg_jpg.bat
Created August 28, 2022 10:13
FFMPEG converts all *.JPG to *.JPG in the current directory.
for %%i in (*.jpg) do ffmpeg -y -i "%%i" "%%i"
@jsfag
jsfag / android_instructions.md
Created October 21, 2019 10:00 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@jsfag
jsfag / sysctl.conf
Created June 29, 2018 11:14 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file. Increasing the TCP congestion
# window is particularly important.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1