Skip to content

Instantly share code, notes, and snippets.

2024-05-08T00:00:11.8626575Z Current runner version: '2.316.1'
2024-05-08T00:00:11.8650483Z ##[group]Operating System
2024-05-08T00:00:11.8651223Z Ubuntu
2024-05-08T00:00:11.8651605Z 22.04.4
2024-05-08T00:00:11.8651936Z LTS
2024-05-08T00:00:11.8652318Z ##[endgroup]
2024-05-08T00:00:11.8652720Z ##[group]Runner Image
2024-05-08T00:00:11.8653161Z Image: ubuntu-22.04
2024-05-08T00:00:11.8653646Z Version: 20240422.1.0
2024-05-08T00:00:11.8654604Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240422.1/images/ubuntu/Ubuntu2204-Readme.md
#Encode HDR video from Samsung:
* Encode and crop 100px from top
ffmpeg.exe -hide_banner -i input -vf scale=-2:480:flags=spline,crop=out_h=in_h-80:y=in_h-80 -an -c:v libx264 -pix_fmt yuv420p -preset veryslow -tune film out.mpv
ffmpeg.exe -hide_banner -i input -vf scale=-2:1080:flags=spline -c:v libx264 -pix_fmt yuv420p -preset veryslow -tune film -crf 18 -c:a aac -b:a 192k out.mp4
*Test encode first frame pic
ffmpeg.exe -hide_banner -i input.mp4 -vf scale=-1:360:flags=spline,zscale=transfer=linear:npl=100,format=gbrpf32le,zscale=primaries=bt709,tonemap=hable:desat=0,zscale=transfer=bt709:matrix=bt709:range=limited,format=yuv420p -vframes 1 output.png
ffmpeg.exe -hide_banner -i input.mp4 -vf scale=-1:720:flags=spline,zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -map 0 -c copy -c:v libx264 -pix_fmt yuv420p -preset medium -tune film -crf 20 -c:a copy output.mp4
@shinchiro
shinchiro / rename.bat
Last active January 7, 2019 10:03
mkvpropedit's usage
@echo OFF
set mkvpropedit="D:\mkvtoolnix\mkvpropedit.exe"
for %%A in (%*) do (
::%mkvpropedit% "%%~fA" --delete-attachment name:"Impress BT.ttf"
::%mkvpropedit% "%%~fA" --chapters "%%~nA_chapter.xml"
:: Comment should be placed above.
::
:: This will select first video/subtitle tracks to rename name and make first subtitle as default.
:: Adding fonts to the mkv.
%mkvpropedit% "%%~fA" --edit track:v1 --set name="[LowPower-Raws]" --set language=jpn ^
@shinchiro
shinchiro / git_config.txt
Last active November 18, 2017 13:21
git config
$ git config -l
user.name=shinchiro
user.email=shinchiro@users.noreply.github.com
user.signingkey <ID>
commit.gpgsign=true
core.editor=nano
credential.helper=wincred # works only on git for windows
sendemail.smtpserver=smtp.googlemail.com
sendemail.smtpencryption=tls
sendemail.smtpserverport=587
@shinchiro
shinchiro / widl
Created September 18, 2017 12:53
cd /git/mingw-w64
widl -I./include -I./direct-x/include -DBOOL=WINBOOL -h -o d3d11.h ./direct-x/include/d3d11.idl
@shinchiro
shinchiro / make_x265_vc.bat
Last active March 25, 2017 15:21
x265 Compilation with Visual Studio 2017
@echo OFF
set PATH=%~dp0\win_tools;%~dp0\win_tools\cmake\bin;%~dp0\win_tools\mercurial;%PATH%
cd "%~dp0\x265"
patch -p1 < %~dp0\patches\watermark.diff
patch -p1 < %~dp0\patches\optimization.diff
mkdir "%~dp0\x265\build\vc14-x86_64"
cd "%~dp0\x265\build\vc14-x86_64"
@shinchiro
shinchiro / compile.sh
Created February 18, 2017 21:50
Compile MEGAcli
#!/bin/bash
export PATH="/shinchiro/build32/install/bin:$PATH"
export PKG_CONFIG_LIBDIR="/d/MSYS/mega-sdk/build/install/lib/pkgconfig"
export PKG_CONFIG="pkg-config --static"
INSTALL_PATH="/d/MSYS/mega-sdk/build/install"
# LDFLAGS='-static -lpthread'
./autogen.sh
./configure --disable-shared --enable-static --disable-silent-rules --without-openssl --with-cryptopp=$INSTALL_PATH --without-sodium --with-zlib=$INSTALL_PATH --with-sqlite=$INSTALL_PATH --without-cares --without-curl --with-winhttp=/d/MSYS/mega-sdk/build --without-freeimage --with-readline=$INSTALL_PATH --with-termcap=$INSTALL_PATH --prefix=$INSTALL_PATH && make -j9 && make install
@shinchiro
shinchiro / git_tricks.txt
Last active April 25, 2020 04:03
Git's trick
1. Clone specific branch
git clone --single-branch -b new_branch git_url
2. Remove/clean git history log
git pull --depth 1
git gc --aggressive --prune=now
3. Export commit as patch
git format-patch -1
@shinchiro
shinchiro / FFmpegMapping.txt
Created December 19, 2016 06:32
FFmpeg mapping tricks
# Mapping can also be know selecting in ffmpeg.
# http://stackoverflow.com/a/12943003
1. Select only video and audio from mkv .Mux into mp4
ffmpeg -i input.mkv -map 0:v -map 0:a -c copy test.mp4
@shinchiro
shinchiro / HardsubWithFFmpeg.txt
Created December 14, 2016 04:03
How to hardsub subtitle with FFmpeg
::
:: This demonstrate on how to hardsub embeded subtitle and downscale video to 360p with only FFmpeg. Ensure FFmpeg is compiled with --enable-libass
ffmpeg -hide_banner -i "D:\oh\test\input.mkv" -vf "subtitles='D\:\\oh\\test\\input.mkv'",scale=-1:360:flags=spline -c:v libx264 -preset ultrafast output.mp4
::Character ':', '\' need to be escaped if present in input's path
:: Escape both characters with sed.
echo "D\:\\oh\\test\\input.mkv" | sed "s,\\,\\\\,g;s,:,\\:,g" >>name
set /p modified=< name