miriwoのブログ

IT系の技術や少し趣味よりのことも投稿してゆくよ😊

Mac ターミナルの入力を補完するFigを導入する方法

概要

  • ターミナルの入力を補完するツールのFigの導入方法をまとめる。

方法

  1. 下記にアクセスする。

    fig.io

  2. 「Download for free」をクリックする。

  3. インストールされた「fig@iatest.dmg」を開く。

  4. 下記ウインドウが開いたらアイコンをドラッグアンドドロップでアプリケーションにディレクトリ移動する。

  5. アプリケーションフォルダの「Fig」をダブルクリックで開く。

  6. 下記のウインドウが開いたら「Setup」をクリックする。

  7. ウインドウに下記が表示されたら「Enable」をクリックする。

  8. 「Fig」にチェックを入れ、左下の鍵を閉じる。

  9. アプリケーション設定ウインドウに再度移動しいくつか説明されるので「Continue」をクリックする。

  10. メールアドレスを入力する。

  11. 入力したメールアドレス宛にコードが届くので次画面で入力してアクティベートする。

  12. 勝手にターミナルが開きチュートリアルが開始されるので案内に沿って体験する。

  13. ターミナルでの入力で補完が効くようになる。

  14. VScodeのターミナルを使用している場合、Fig導入後にVScodeを再起動すれば補完が効くようになる。

FFmpeg を使って動画ファイルをgifに変換する

概要

  • 動画ファイルであるmovをgifに変換する方法をまとめる。

前提

  • Homebrewがインストールされ、brewコマンドが実行できる環境になっていること。

方法

  1. 下記コマンドを実行してFFmpegをHomebrewでインストールする。

     brew install ffmpeg
    
  2. 下記コマンドを実行してmovをgifに変換する。

     ffmpeg -i movファイル名 生成されるgifファイル名
    
  3. ちなみに ffmpeg -hを実行するとコマンドの使い方を教えてくれる。

     $ ffmpeg -h
     ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
       built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
       configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
       libavutil      57. 28.100 / 57. 28.100
       libavcodec     59. 37.100 / 59. 37.100
       libavformat    59. 27.100 / 59. 27.100
       libavdevice    59.  7.100 / 59.  7.100
       libavfilter     8. 44.100 /  8. 44.100
       libswscale      6.  7.100 /  6.  7.100
       libswresample   4.  7.100 /  4.  7.100
       libpostproc    56.  6.100 / 56.  6.100
     Hyper fast Audio and Video encoder
     usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
    
     Getting help:
         -h      -- print basic options
         -h long -- print more options
         -h full -- print all options (including all format and codec specific options, very long)
         -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol
         See man ffmpeg for detailed description of the options.
    
     Print help / information / capabilities:
     -L                  show license
     -h topic            show help
     -? topic            show help
     -help topic         show help
     --help topic        show help
     -version            show version
     -buildconf          show build configuration
     -formats            show available formats
     -muxers             show available muxers
     -demuxers           show available demuxers
     -devices            show available devices
     -codecs             show available codecs
     -decoders           show available decoders
     -encoders           show available encoders
     -bsfs               show available bit stream filters
     -protocols          show available protocols
     -filters            show available filters
     -pix_fmts           show available pixel formats
     -layouts            show standard channel layouts
     -sample_fmts        show available audio sample formats
     -dispositions       show available stream dispositions
     -colors             show available color names
     -sources device     list sources of the input device
     -sinks device       list sinks of the output device
     -hwaccels           show available HW acceleration methods
    
     Global options (affect whole program instead of just one file):
     -loglevel loglevel  set logging level
     -v loglevel         set logging level
     -report             generate a report
     -max_alloc bytes    set maximum size of a single allocated block
     -y                  overwrite output files
     -n                  never overwrite output files
     -ignore_unknown     Ignore unknown stream types
     -filter_threads     number of non-complex filter threads
     -filter_complex_threads  number of threads for -filter_complex
     -stats              print progress report during encoding
     -max_error_rate maximum error rate  ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.
     -vol volume         change audio volume (256=normal)
    
     Per-file main options:
     -f fmt              force format
     -c codec            codec name
     -codec codec        codec name
     -pre preset         preset name
     -map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
     -t duration         record or transcode "duration" seconds of audio/video
     -to time_stop       record or transcode stop time
     -fs limit_size      set the limit file size in bytes
     -ss time_off        set the start time offset
     -sseof time_off     set the start time offset relative to EOF
     -seek_timestamp     enable/disable seeking by timestamp with -ss
     -timestamp time     set the recording timestamp ('now' to set the current time)
     -metadata string=string  add metadata
     -program title=string:st=number...  add program with specified streams
     -target type        specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-")
     -apad               audio pad
     -frames number      set the number of frames to output
     -filter filter_graph  set stream filtergraph
     -filter_script filename  read stream filtergraph description from a file
     -reinit_filter      reinit filtergraph on input parameter changes
     -discard            discard
     -disposition        disposition
    
     Video options:
     -vframes number     set the number of video frames to output
     -r rate             set frame rate (Hz value, fraction or abbreviation)
     -fpsmax rate        set max frame rate (Hz value, fraction or abbreviation)
     -s size             set frame size (WxH or abbreviation)
     -aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
     -vn                 disable video
     -vcodec codec       force video codec ('copy' to copy stream)
     -timecode hh:mm:ss[:;.]ff  set initial TimeCode value.
     -pass n             select the pass number (1 to 3)
     -vf filter_graph    set video filters
     -ab bitrate         audio bitrate (please use -b:a)
     -b bitrate          video bitrate (please use -b:v)
     -dn                 disable data
    
     Audio options:
     -aframes number     set the number of audio frames to output
     -aq quality         set audio quality (codec-specific)
     -ar rate            set audio sampling rate (in Hz)
     -ac channels        set number of audio channels
     -an                 disable audio
     -acodec codec       force audio codec ('copy' to copy stream)
     -vol volume         change audio volume (256=normal)
     -af filter_graph    set audio filters
    
     Subtitle options:
     -s size             set frame size (WxH or abbreviation)
     -sn                 disable subtitle
     -scodec codec       force subtitle codec ('copy' to copy stream)
     -stag fourcc/tag    force subtitle tag/fourcc
     -fix_sub_duration   fix subtitles duration
     -canvas_size size   set canvas size (WxH or abbreviation)
     -spre preset        set the subtitle options to the indicated preset
    

Mac 画面を録画する

概要

  • Macにて画面の収録(録画)をする方法をまとめる。

方法

  1. ショートカットの確認

    1. 設定を開き「キーボード」をクリックする。
    2. 「ショートカット」をクリックし「収録のオプション」のショートカットがなにか確認する(筆者の場合「shift」+「cmd」+「7」だった)

  2. 画面の収録

    1. 画面収録オプションのショートカットを押下する。
    2. 収録範囲を決め「選択部分を取り込む」をクリックする。
    3. 「収録」をクリックする。
    4. 収録が始まる。
    5. 収録を止めたい場合はもう一度画面収録オブションのショートカットを押下する。
    6. 「画面収録を停止」をクリック
    7. 画面右下に収録した動画のプレビューが出るのでクリックする。

    8. 表示されたウインドウで「✕」もしくは「完了」をクリックするとデスクトップに収録動画が保存される。

Mac 「cmd」+「v」の貼り付けを「ペーストしてスタイルをあわせる」に変更する方法

概要

  • Macの「cmd」+「v」の貼り付けを「ペーストしてスタイルをあわせる」に変更する方法をメモ程度にまとめる。

方法

  1. 環境設定 → キーボードを開く。
  2. ショートカットを開く。
  3. アプリケーションを選択して「+」をクリックする。

    [

  4. アプリケーションを「全アプリケーション」にメニュータイトルを「ペーストしてスタイルをあわせる」と記入し、キーボードショートカットの欄をクリックして「cmd」+「v」を押下する。

Mac Slackのポップアップ通知が来ない問題

概要

  • MacにてSlackアプリにてポップアップ通知が来ない問題が発生した。自分の場合の解決策を見つけたのでまとめる。

発生した問題

  • 自分にメンションがついた内容が投稿されてもMacの通知設定にて設定してある方法で通知が行われない。

テスト通知を出す方法

  • 下記の方法でテスト通知を出そうと試みたがボタンをクリックしてもテスト通知のポップアップが表示されない。通知音も鳴らない。

miriwo.hatenablog.com

解決方法

  1. Slackのアプリを削除する。
  2. library/Application Supportディレクトリ直下のSlackディレクトリを削除する。
  3. Slackのアプリを再インストールする。
  4. Slackのアプリから通知設定を確認して通知をONに設定する。
  5. Macの通知設定でSlackの通知をONに設定する。
  6. Slackのアプリを再起動する。
  7. Slackにてテスト通知を行い確認する。

Slack テスト通知を出す方法

概要

  • MacのSlack通知でテスト通知を出す方法をまとめる。

方法

  1. Slackの右上の自分のアイコンをクリックする。

  2. 「環境設定」をクリックする。

  3. 「通知」をクリックする。

  4. サウンド&表示」の「例を表示する」をクリックする。

  5. テスト通知が表示される。