0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry Pi 3B+ に Emby をインストールした

Last updated at Posted at 2023-12-16

 手元の Raspberry Pi 3B+ は 5 年前に IoT の小手調べのために購入したものであるが、その後、使途が定まらないまま放置されていた。
 これを有効活用するため、メディアサーバーである Emby をインストールして、宅内のどこからでも PC やスマートフォン の web ブラウザで音楽鑑賞できる環境を構築した。
 追加のコストは 128GB の MicroSD カード ¥1,280 と (バター) ケース ¥110 の ¥1,390 である。
 運用を開始して二週間ほど経過したが何の支障もなく稼働している。

raspi.jpg

screenShot.png

Raspberry Pi OS・オーディオファイル

 Raspberry Pi OS (Legacy, 64-bit) をインストールした。
 オーディオファイルは老朽 PC 上の Rhyrmbox で利用していたもの(CD 約 300 枚分)をホームディレクトリ直下に作成した Music ディレクトリにコピーした。

Emby

 下記の記事通りで全く問題なくインストールできた。

 ただし、次の画面の 1. では上記の /home/user/Music を入力した。

メタデータの編集

 オーディオ・ファイルのタグはアルバム/楽曲のページの鉛筆アイコン(Edit Metadata)またはホーム画面左上隅の ≡ をクリックして表示される「メタデータマネージャ」から GUI で変更することができる。
 さらに、タグを一括変更する場合は次のように mutagen という外部ライブラリを用いた Python スクリプトで作業を省力できる。

# Pythonでmp3などのID3タグを編集するmutagenの使い方
#   https://note.nkmk.me/python-mutagen-mp3-id3/

# PythonでFLACファイルのタグを扱う方法
#   https://tranphonic.hatenablog.com/entry/2014/11/09/225201

from mutagen.flac import FLAC
import glob
import re

wild = "./source/*.flac"
reg_obj = re.compile("(.*Disc )([1-6])(\].*)")

for f in glob.glob(wild):
    audio = FLAC(f)
    print(audio["title"])
    # audio["album"] = "BEETHOVEN SYMPHONIES"
    # audio["artist"] = "Royal Philharmonic Orchestra"
    # audio["albumartist"] = "Royal Philharmonic Orchestra"
    # audio["discnumber"] = reg_obj.split(f)[2]
    audio["genre"] = "Pop" # "Classical;Beethoven"
    audio.pprint()
    audio.save()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?