Skip to content

Instantly share code, notes, and snippets.

View nyanshiba's full-sized avatar
🎃
in the kotatsu

nyanshiba

🎃
in the kotatsu
View GitHub Profile
@nyanshiba
nyanshiba / programtxt_24fps.bat
Created October 9, 2017 18:12
番組情報から24fps化するか選択するサンプル
rem ffmpegのオプション
rem 通常
set FFOPTION3029=-c:a aac -b:a 192k -vf bwdif=0:-1:1,pp=ac,scale=1280:720:flags=lanczos+accurate_rnd -global_quality 29 -c:v h264_qsv -preset veryslow -g 300 -bf 16 -refs 16 -b_strategy 1 -look_ahead 1 -look_ahead_depth 100 -pix_fmt nv12
rem アニメ・映画
set FFOPTION2429=-c:a aac -b:a 192k -vf bwdif=0:-1:1,pp=ac,scale=1280:720:flags=lanczos+accurate_rnd -global_quality 27 -c:v h264_qsv -preset veryslow -g 300 -bf 16 -refs 16 -b_strategy 1 -look_ahead 1 -look_ahead_depth 100 -pix_fmt nv12
rem 番組情報の中に"ジャンル"という文字列がある行に行番号を付けて取得
for /f "delims=" %%a in ('findstr /n "ジャンル" "%1"') do (
set GENRE=%%a
)
@nyanshiba
nyanshiba / tepco_eco.bat
Created October 9, 2017 18:14
23時~7時の夜間時間(東京電力)にプログラムを実行して電気代を節約卍
rem dos標準の環境変数timeの先頭2文字が7以上且つ23未満の場合300秒待ってループ
:electric
if %time:~0,2% geq 7 (
if %time:~0,2% lss 23 (
timeout /t 300
goto :electric
)
)
rem ここから処理
@nyanshiba
nyanshiba / PostRecEnd.bat
Last active May 20, 2018 22:26
最小構成
@echo on
rem 180521
rem _EDCBX_DIRECT_
rem _EDCBX_DONTHIDE_
rem 視聴予約なら終了
if "%RecMode%" == "4" (
goto :eof
)
rem ファイル名をタイトルバーに表示
title %~nx0:%FileName%.ts
@echo off
rem ====================draw_mouse====================
set /p draw_mouse=マウスポインタ[0:描画しない、1:描画する]:
rem ====================映像入力====================
set /p ask_input_video=映像入力[Enter:全画面、tl:左上、bl:左下、tr:右上、br:右下、m:マニュアル領域、w:ウィンドウ領域]:
if "%ask_input_video%" == "tl" (
set "input_video=-video_size 960x540 -offset_x 0 -offset_y 0 -i desktop"
) else if "%ask_input_video%" == "bl" (
@echo on
rem カレントディレクトリをD&Dしたフォルダに
cd /d %1
rem フォルダ内のmovを順番に呼んで
for %%a in ( *.mov ) do (
rem tsに変換
ffmpeg -i "%%a" -c copy -bsf:v h264_mp4toannexb "%%~dpna.ts"
rem txtにファイルの名前のみ出力
@echo file %%~na.ts >> input.txt
@echo off
rem ====================環境変数設定====================
rem youtube-dl.exeのパス
set "ytdl_path=C:\DTV\bin\youtube-dl.exe"
rem ffmpeg.exeがあるディレクトリのパス
set "ff_dir=C:\DTV\ffmpeg"
rem vlc.exeのパス
set vlc_path=
rem 出力フォルダのパス
@echo off
rem D&Dした複数ファイルを表示
set cnt=0
setlocal enabledelayedexpansion
for %%a in ( %1 %2 %3 %4 %5 %6 %7 %8 %9 ) do (
if not %%a == "" (
set /a cnt+=1
echo !cnt!.%%a
)
)
@echo off
set /p length=文字数:
set /p ask=1=数、3=英数、4=英数記号:
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "& { switch ("%ask%") {"1" {$characters='123456789'}"3" {$characters='abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789'}"4" {$characters='abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789!$^&/()=?*+#_'}}; -join ${characters}[(1..%length% | ForEach-Object { Get-Random -Maximum ${characters}.length })] }"
pause
#180711
#_EDCBX_HIDE_
#視聴予約なら終了
if ($env:RecMode -eq 4) { exit }
#====================ユーザ設定====================
#--------------------Twitter--------------------
#ruby.exe
$ruby_path='C:\Ruby25-x64\bin\ruby.exe'
#tweet.rb