だいぶ前(2019年5月9日)にWindowsロケールをUTF-8にして不具合のあるアプリ。でちょっとお試ししたものの、ヘタレなのでもとに戻してしばらく立ちます。その後どうなったかを見てみようかということで再度設定、確認してみました。
追記: 結論から先にいうと、やっぱりやめたほうが良さそうです。
こんな感じ。まあ、これで問題なければ使えます。
だいぶ前(2019年5月9日)にWindowsロケールをUTF-8にして不具合のあるアプリ。でちょっとお試ししたものの、ヘタレなのでもとに戻してしばらく立ちます。その後どうなったかを見てみようかということで再度設定、確認してみました。
Neovimで日本語のファイル内をうろついているときに、もっといい感じで移動できるといいのに、と常々感じてはいたのですが。実はだいぶ前に deton/jasentence.vim と deton/jasegment.vim というのを見つけてまして、もうちょっとちゃんといじってみようかなと。
jasentence.vim は )( を使って「。」や「、」への移動(センテンス移動)を行えるプラグインです。"、。,.?!" を見てくれるらしいので、ついでに "「" や "」" も見てくれればいいのにな、と思ったり思わなかったり。まあそれはさておき。
英語だと w や e での移動は単語単位になりますが、文の構造上単語を切り出すのが難しい日本語では、漢字・カタカナ・ひらがな・その他という感じで大雑把な単位での移動になってしまいます。:help word-motions では、
などとなっています。
当然、日本語でも同じキーで移動したいわけで、じゃあやっぱり形態素解析で文を見てもらったほうがいい感じで動作するのかな、と。
jasegment.vim がそのへんをうまくやってくれるようで、後ろで動いてくれるエンジンには CaboCha や TinySegmenter、MeCab などを使えるようです。デフォルトでは KNBコーパスで文節を学習させたデータが使われるようで、それでもいいんですが、ここは MeCab を使ってみようかと。
Windows用バイナリは MeCab: Yet Another Part-of-Speech and Morphological Analyzer に用意されているのですが、せっかくなので WSL2 上の ArchLinux で動作させてみようかなと。幸い、AUR をmecabで検索すると mecab、mecab-git、mecab-ipadic、python-mecab、mecab-ipadic-neologd-git などが登録されているようですので、ビルドとインストールは makepkg でうまいこといきそうです。ちなみにソースは mecab だと tarball を拾ってきて、mecab-git だと github から拾ってくるようです。github のほうは ipadic と jumandic をソースツリーに取り込んでるように見えます。ここでは github からのほうを使ってみます。
ということで早速始めます。
git clone https://aur.archlinux.org/mecab-git.git
cd mecab-git
makepkg -sri
でも辞書はインストールされていません。なので mecab-ipadic をインストールします。
git clone https://aur.archlinux.org/mecab-ipadic.git
cd mecab-ipadic
makepkg -sri
辞書は /usr/lib/mecab/dic/ipadic 以下にインストールされました。さらに mecab-ipadic-neologd-git もインストールします。
git clone https://aur.archlinux.org/mecab-ipadic-neologd-git.git
cd mecab-ipadic-neologd-git
makepkg -sri
こちらの辞書は /usr/lib/mecab/dic/mecab-ipadic-neologd にインストールされました。
MeCab の辞書指定は /etc/mecabrc で行います。
dicdir = /usr/lib/mecab/dic/ipadic
標準では ipadic が指定されていますが、不満が出てこなければこのままでもいいか、と手を付けずに置きます。
念の為、mecab になにか食わせてみます。
次にコマンドプロンプトから食わせてみます。
ちゃんとできてますね。
では、Neovimでやってみます。
let g:jasegment#mecab#cmd = 'wsl mecab'let g:jasegment#model = 'mecab'
でも、どちらかというとカーソル移動では knbc_bunsetu のほうが好みかも。
ffmpeg -i "%~nx1" -map 0:0 -c copy "%~dpn1.m2v" ffmpeg -i "%~nx1" -map 0:1 -c copy "%~dpn1-1101.aac" C:\Apps\aviutl\exe_files\qaac64 -V 127 "%~dpn1-1101.aac" rem ffmpeg -i "%~nx1" -map 0:1 -c:a libfdk_aac -vbr 5 "%~dpn1-1101.m4a" ffmpeg -i "%~nx1" -map 0:2 -c copy "%~dpn1-1102.aac" C:\Apps\aviutl\exe_files\qaac64 -V 127 "%~dpn1-1102.aac" rem ffmpeg -i "%~nx1" -map 0:2 -c:a libfdk_aac -vbr 5 "%~dpn1-1102.m4a"
remuxer -i {video} -i {audio1} -i {audio2} -o {mp4file}
reg add HKLM\SYSTEM\Setup\MoSetup /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /fを管理者用コマンドプロンプトで実行します。これでCPUがサポート外でもアップグレードが可能になります。
$ git clone https://github.com/rdp/ffmpeg-windows-build-helpers
$ cd ffmpeg-windows-build-helpers
$ ./cross_compile_ffmpeg.sh -h
$ ./cross_compile_ffmpeg.sh --build-ffmpeg-shared=y --ffmpeg-git-checkout-version=n5.0 --fdk-aac-git-checkout-version=v2.0.2 --gcc-cpu-count=8 --disable-nonfree=n --build-intel-qsv=y --build-lsw=y --compiler-flavors=win64
windows WSL detected: you must first disable 'binfmt' by running this
sudo bash -c 'echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop'
then try again
$ sudo bash -c 'echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop'
$ ./cross_compile_ffmpeg.sh --build-ffmpeg-shared=y --ffmpeg-git-checkout-version=n5.0 --fdk-aac-git-checkout-version=v2.0.2 --gcc-cpu-count=8 --disable-nonfree=n --build-intel-qsv=y --build-lsw=y --compiler-flavors=win64
config_options+=--enable-libsvthevc
--enable-libbluray --enable-fontconfig
--enable-libfreetypeを削除します。たぶんこれは字幕に必要だからだと思いますが、うちでは不要なので問題なしです。
--build-intel-qsv=yを削除します。
Done! You will find 64-bit shared non-redistributable binaries in /home/kats/work/ffmpeg-windows-build-helpers/sandbox/win64/ffmpeg_git_with_fdk_aac_n5.0_shared/bin
$ cd /home/kats/work/ffmpeg-windows-build-helpers/sandbox/win64/ffmpeg_git_with_fdk_aac_n5.0_shared $ 7z a ffmpeg_with_fdk_aac_n5.0_share.7z bin doc include lib presets LICENSE.md README.md $ cp ffmpeg_with_fdk_aac_n5.0_share.7z /mnt/c/Users/kats/work
copy a.txt+b.txt c.txtでできますが、MP4ファイルの場合にはコンテナの中にビデオストリームとオーディオストリームが格納されていて、撮影情報とかメモとかいろんなタグが含まれていて、そのまま連結してもうまくいきません。file dir/input1.mp4 file dir/input2.mp4 file dir/input3.mp4その上で、以下のコマンドで連結します。
ffmpeg -f concat -c copy -i listfile.lst outfile.mp4もしもファイル名にスペースを含むようなら、''(シングルクォーテーション)でくくります。""(ダブルクォーテーション)ではエラーになります。
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input1.ts ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input2.ts ffmpeg -i "concat:input1.ts|input2.ts" -c copy -bsf:a aac_adtstoasc output.mp4上の2行のコマンドでそれぞれH264ストリームを抜き出して input1.ts、input2.ts という中間ファイルを作成します。
ffmpeg -i input1.mp4 -c copy -bsf:v hevc_mp4toannexb -f mpegts input1.ts ffmpeg -i input2.mp4 -c copy -bsf:v hevc_mp4toannexb -f mpegts input2.ts ffmpeg -i "concat:input1.ts|input2.ts" -c copy -bsf:a aac_adtstoasc output.mp4コーデックが異なったりする場合には再エンコードが必要になるので、その分時間がかかりますが、詳細はこちらに。 ちなみにうちで使用しているffmpegはこちらからダウンロードしています。
C:\WINDOWS\system32# diskpart Microsoft DiskPart バージョン 10.0.19041.964 Copyright (C) Microsoft Corporation. コンピューター: UZI DISKPART> list disk ディスク 状態 サイズ 空き ダイナ GPT ### ミック ------------ ------------- ------- ------- --- --- ディスク 0 オンライン 7452 GB 1024 KB * ディスク 1 オンライン 931 GB 1024 KB * ディスク 2 オンライン 5589 GB 0 B * ディスク 3 オンライン 5589 GB 1024 KB * ディスク 4 オンライン 476 GB 1024 KB DISKPART> exit DiskPart を終了しています...
C:\WINDOWS\system32# mbr2gpt /validate /disk:4 /allowfullos MBR2GPT: Attempting to validate disk 4 MBR2GPT: Retrieving layout of disk MBR2GPT: Validating layout, disk sector size is: 512 bytes MBR2GPT: Validation completed successfully
C:\WINDOWS\system32# mbr2gpt /convert /disk:4 ERROR: MBR2GPT can only be used from the Windows Preinstallation Environment. Use /allowFullOS to override. C:\WINDOWS\system32# mbr2gpt /convert /disk:4 /allowfullos MBR2GPT will now attempt to convert disk 4. If conversion is successful the disk can only be booted in GPT mode. These changes cannot be undone! MBR2GPT: Attempting to convert disk 4 MBR2GPT: Retrieving layout of disk MBR2GPT: Validating layout, disk sector size is: 512 bytes MBR2GPT: Trying to shrink the OS partition MBR2GPT: Creating the EFI system partition MBR2GPT: Installing the new boot files MBR2GPT: Performing the layout conversion MBR2GPT: Migrating default boot entry MBR2GPT: Adding recovery boot entry MBR2GPT: Fixing drive letter mapping MBR2GPT: Conversion completed successfully Call WinReReapir to repair WinRE MBR2GPT: Failed to update ReAgent.xml, please try to manually disable and enable WinRE. MBR2GPT: Before the new system can boot properly you need to switch the firmware to boot to UEFI mode! C:\WINDOWS\system32#
安価で優秀なデバッグプローブはないかしら、と探したら、 Raspberry Pi Debug Probe というのがあったんですが、これは3線がにゅるんと出てるだけです。 もちろんSWDなら3線を繋げばいいのではありますが、汎用的に考えるなら5x2のリボンケーブルコネクタが欲し...