Skip to content

Instantly share code, notes, and snippets.

openSUSE Leap 15でNVENCを有効にしたffmpegをビルドし、mpeg2-tsのGPUエンコードを行う

Nvidia GPUが存在するLinux環境では、NVIDIAのハードウェアエンコーディング/デコーディング機能であるNVENC/NVDECが利用可能ですが、openSUSEの標準パッケージとして利用可能なffmpegではNVENC/NVDECが有効化されていません。これはNVIDIAのライセンス規約により同機能を有効にしたffmpegのバイナリ再配布が許されていないためです。(おそらくほとんどのディストリビューション添付のffmpegも同じはず)

そこで、ffmpegをソースからビルドし、NVENC/NVDECを使えるようにします

ビルド依存環境のダウンロード

zypperでffmpegに必要な各種ライブラリとツールをダウンロードします

@jazzl0ver
jazzl0ver / fix_dropbox_centos.txt
Created October 16, 2018 14:37
Fuck you, Dropbox!
# Starting October 15, Dropbox has fucked all his CentOS 6 (and many other) users
# by changing OS requirements:
# ----
# We are reaching out to let you know that device(s) which do not meet our new
# operating system requirements have been logged out of the Dropbox desktop
# application. Dropbox has ended support for Ubuntu 13.10 and below, and Fedora 20
# and below.
# ...
# Your device(s) must now be on glibc 2.19 or higher to log back into the Dropbox
# desktop application
#!/bin/bash
# ==============================================================
# CPU limit daemon - set PID's max. percentage CPU consumptions
# ==============================================================
# Variables
CPU_LIMIT=20 # Maximum percentage CPU consumption by each PID
DAEMON_INTERVAL=3 # Daemon check interval in seconds
BLACK_PROCESSES_LIST= # Limit only processes defined in this variable. If variable is empty (default) all violating processes are limited.
WHITE_PROCESSES_LIST= # Limit all processes except processes defined in this variable. If variable is empty (default) all violating processes are limited.
@idleberg
idleberg / scoop.md
Last active April 29, 2024 02:02
Scoop Aliases

Common aliases for the scoop package manager

# Install app
scoop alias add i 'scoop install $args[0]' 'Install app'
scoop alias add add 'scoop install $args[0]' 'Install app'

# Uninstall app
scoop alias add rm 'scoop uninstall $args[0]' 'Uninstall an app'
scoop alias add remove 'scoop uninstall $args[0]' 'Uninstall an app'
#!/bin/sh
#
# Script to start CPU limit daemon
#
set -e
case "$1" in
start)
if [ $(ps -eo pid,args | gawk '$3=="/usr/bin/cpulimit_daemon.sh" {print $1}' | wc -l) -eq 0 ]; then
nohup /usr/bin/cpulimit_daemon.sh >/dev/null 2>&1 &
@craigmaslowski
craigmaslowski / compress-images.ps1
Last active May 28, 2023 16:57
Powershell script to compress all jpg, gif, or png files recursively in the given path with ImageMagick
param([string]$path = ".\", [int]$minSize = 0, [switch]$jpg, [switch]$png, [switch]$gif, [switch]$verbose, [switch]$report)
function Get-Size
{
param([string]$pth)
"{0:n2}" -f ((gci -path $pth -recurse | measure-object -property length -sum).sum /1mb) + " mb"
}
function Get-Size-Kb
{
#!/bin/bash -x
## https://github.com/major/MySQLTuner-perl
wget http://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
chmod +x mysqltuner.pl
@agentsim
agentsim / highsierra_bootable.sh
Created June 10, 2017 02:23
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@piouc
piouc / nicovideo_fake_premium.user.js
Created April 22, 2017 17:58
nicovideo fake premium
// ==UserScript==
// @name nicovideo fake premium
// @namespace org.kamisama.nicovideo-fake-premium
// @include http://www.nicovideo.jp/watch/sm*
// @version 1
// @grant none
// @run-at document-start
// ==/UserScript==
/*
@jcward
jcward / Readme.txt
Created April 14, 2017 15:08
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format: