Coder Social home page Coder Social logo

bmovt's Introduction

bmovt: Boot Movie Maker

GitHub release (latest SemVer) GitHub

レトロコンピュータのブート画面っぽい動画を作るプログラム。

README English Ver.

はじめ

S-knife 様のコンピュータのブート画面っぽいもの(エフェクトなし_v1)を参考にさせていただきました。

略儀ながら、ここに感謝の意を表します。

概要

PC-9801シリーズ用_歴代Windows起動画面集め

レトロパソコンの起動時の文字が流れる、あの感じの動画を作るプログラムです。

デモ

bmovt_demo

使い方

  1. Release からダウンロードして圧縮ファイルを解凍してください。

  2. 解凍したフォルダの ./config/config.yaml を確認・編集してください。

    output_path: "./boot.mp4"                     # 動画の出力ディレクトリ/動画名.mp4
    font_path: "./res/Myrica/Myrica.TTC"          # フォントのパス
    width: 1920                                   # 解像度ヨコ
    height: 1080                                  # 解像度タテ
    fps: 60                                       # FPS
    fourcc: "mp4a"                                # 動画作成時のコーデック: ../tests/fourcc_tag-mp4.txt を参照
    crf: 16                                       # 動画圧縮プロパティ: 0(品質:良, サイズ:大) < crf < 64(品質:悪, サイズ:小)
    separator: !!python/str "=+\n+"               # 区切り文字
    bg_color: !!python/tuple [0,0,0,255]          # バックグラウンドの色: tuple(r, g, b, a)
    font_color: !!python/tuple [255,255,255,255]  # フォントの色: tuple(r, g, b, a)
    font_size: 32                                 # テキストサイズ: pixels: https://www.linesmix.com/fonts.html
    spacing: 4                                    # テキストの行間: pixels
  3. 解凍したフォルダの ./res フォルダに移動してください。

  4. loading.txt を編集してください。

    {
        # key: value, 
        0: [" "], 
        1: [" ", "."],
        2: ["/", "-", "\\"], 
        3: ["Loading", "Loading.", "Loading..", "Loading..."],
    }
  5. boot_text.txt を編集してください。

    一行目  :表示する際の設定
    二行目以降:表示するテキスト
    
    LOADING: ローディングの設定
        - TYPE      : ローディングの表示タイプ
                      loading.txt の key を入力
                      ローディングを使用しない場合、NONE を入力
        - TIME      : ローディングの時間
        - INTERVAL  : ローディング文字の表示間隔
        - UNIT      : TIME, INTERVAL の単位
                      "SEC" or "FRAME" を入力
    
    SHOW: 表示テキストの設定
        - TYPE      : テキストの表示タイプ
            - MOMENT    : 瞬時
                          1 frame で全て表示
            - GRADUALLY : 徐々
                          表示される文字数:文字数 / (TIME / INTERVAL)
            - L_BY_L    : 行ごとに文字表示
                          TIME, INTERVAL の順に数字を読込、処理
                          TIME != 0: INTERVAL = TIME / 改行数 
                          INTERVAL != 0: TIME = INTERVAL * 改行数
            - F_BY_F    : フレームごとに一文字表示
        - TIME      : 表示時間
        - INTERVAL  : 表示間隔
        - UNIT      : TIME, INTERVAL の単位
                      "SEC" or "FRAME" を入力
    
  6. プログラムを実行して、動画を作成してください。

環境

  • Windows 10
  • Python 3.10
  • conda 22.9.0

ソースコードを編集したい方は、下記を参考に環境を構築してください。

こちらをクリックしてください

仮想環境構築

conda create -n bmovt --file bmovt.yaml

プロキシ設定が必要な方は、下記を参考に設定してください。

# windows
# if you need to use proxy, please set proxy setting.
set HTTP_PROXY=http://<userid>:<password>@<server-address>:<port>
set HTTPS_PROXY=http://<userid>:<password>@<server-address>:<port>

# example
set HTTP_PROXY=http://proxy.example.com:8080
set HTTPS_PROXY=http://proxy.example.com:8080

# check proxy
echo %HTTP_PROXY%
echo %HTTPS_PROXY%

実行

python -m bmovt

py -> exe

Nuitka で実行ファイルを作ると、クッソ時間が掛かります。(1 ~ 2 時間)

また、Nuitka は GCC[MinGW64] がないと C:\Users\UserName\AppData にインストールするか聞いてきますので [YES] を選択してください。

conda install -c conda-forge nuitka zstandard ordered-set -y

nuitka --mingw64 --follow-imports --onefile bmovt

$ nuitka3 --help
    --mingw64           : mingw64 でコンパイル, default: MSVC
    --follow-imports    : 必要なモジュールをバイナリファイルに含める
    --onefile           : バイナリファイルを1つにまとめる
Nuitka options 説明
--help ヘルプメッセージの表示
--onefile 1つの実行ファイルをまとめる
--include-package パッケージ全体を含める
--follow-imports インポートされたモジュールを含める
--output-filename 実行ファイルの名前
--mingw64 mingw64 でコンパイル, default: MSVC
--windows-icon-from-ico アイコンの設定。Windows 限定
--enable-plugin プラグインの有効化
conda install -c conda-forge pyinstaller -y

pyinstaller ./bmovt/__main__.py --name "bmovt" --icon ".res/bmovt.ico" --onefile --clean

# --- or ---

pyinstaller bmovt.spec --clean
Pyinstaller options 説明
-h, --help ヘルプメッセージの表示
--clean キャッシュを削除
-F, --onefile 1つの実行ファイルにまとめる
-n NAME, --name NAME 実行ファイルの名前
--add-data <SRC;DEST or SRC:DEST> バイナリ以外のファイルやフォルダの追加
--add-binary <SRC;DEST or SRC:DEST> バイナリファイルの追加
--hidden-import MODULENAME コードにないモジュールのインポート
--debug all デバッグ出力
-i, --icon <img.ico> アイコンの設定

注意

  • 現時点では、長い文字列を自動的に改行する機能は実装していないでのご注意ください。

  • ffmpeg を使用しているので、環境変数に追加していない人はインストールしてパスを通してください。

    conda install -c conda-forge ffmpeg
    
  • Nuitka でバイナリファイルを作る時、ノートンさんが [Heur.AdvML.B] を出します。その時は、下図を参考にバイナリファイルを作成するディレクトリをノートンさんに知らせてあげましょう。詳しくは、コチラを参照してください。

    norton

更新情報

  • 2022/12/09:
    v0.0.1を公開。

開発者情報 & 文責

ライセンス

LICENSE ファイルをご確認してください。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.