どうも体調があまり良くないです

夏バテが尾を引いているのか,あるいは9月末までの真夏のような気候からこの2週間くらいで気温が急降下した影響による(いわゆる季節の変わり目)からでしょうか.いずれにせよ,どうも先週からやる気が出ません.

熱があるわけではなく,胃腸も快調ではないですがそんなにひどい状況ではありません.

睡眠の影響が一番大きいかもしれません.現役の最後の5年位から時々入眠剤を処方してもらっています.1年くらい前からはよく効くというデエビゴを処方してもらって時々服用していますが,激的な効果はないです.

やる気が出る・出ないというのは現役中はあんまり関係なかったです.やる気がない日(そのほうが多かった😥)も,とりあえず出勤してしまえばあとはやれる範囲で仕事をするしかなく(やれる仕事がなければやってるふりだけして過ごす😥),それでも給料はもらえました.

リタイアしてわかったのは,やはりやる気が出る日と出ない日が自然にあって,やる気が出ない日には無理をすると影響があとを引くなど,良いことはありません.ダラダラ過ごすのが一番良いということです.どっちにしても給料はもらえませんし😥

しかし,家の周りと畑の草刈りをもう一回り(たぶん1日2時間の作業で所要5〜6日)しないといけませんし,他にも解体処分しないものが家の中にあります😥

もう一週間くらい先延ばしにしてもそんなに草は伸びないでしょうから,気長にやることにします.あんまり考えすぎると,睡眠に影響して悪循環になってしまいます.

Raspberry Pi OS Bookwormでfcitx5-mozcのかな入力ができない

かな入力って日常的に使っている人はあまり多くないため,日本語入力ソフトにおける検証が十分なされないことが多々あることをこれまでの経験で知っています.

Manjaro AMD64, 同 ARM64, Debian AMD64ではfcitx5-mozcはちゃんとかな入力可能です.

しかし,先日リリースされたRaspberry Pi OS Bookwormにfcitx5-mozcをインストールした状態ではだめです.少なくとも今のところだめです.どうだめかというと,濁点を打とうとすると, “ふ” になってしまいます.「だくてん」と打ったつもりが,「たふくてん」と表示されます.これでは使い物になりません.

実はManjaro ARM64は日本語のかな入力はfcitx5-mozcでちゃんとできるのですが,FirefoxでWordPressの編集などをしているとよく固まります.そんなわけでRaspberry Pi OS Bookwormが使えるんだったら乗り換えようかと考えていただけに,ちょっと残念です.

その後: 濁点は解決したものの長音記号がNG

いろいろ,いじって濁点は解決しましたが,長音記号が出ません.いじっているのは,CUIのシステムのキーマップ,/etc/X11/xorg.conf.d/内の設定,KDEのキー設定など思いついたキーボード設定に関わるところ手当り次第です.

長音記号についてはシフトを押すと出ますが,基本的にタイピングは文章を考えながらやるので,長音記号のときにいちいちシフトを押すことを気にかけていては文章の作成の思考が止まってしまうので,非常に使いづらいとしか言いようがありません.

ちゃんとかな入力ができているManjaro AMD64のKDE Plasma Desktop + fcitx5-mozcの設定を真似ていますが,どうしたものかDebian ARM64 KDE Plasma Desktop + fcitx5-mozcではうまくいきません.

さらに後の注: 解決

/etc/X11/xorg.conf.d/00-keyboardというファイルを以下の中身のテキストファイルとして作ります

Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "jp"
    Option "XkbModel" "jp106"
    Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

ただし,Waylandでは/etc/X11/xorg.conf.d/以下を参照しないようなので意味をなしません.

クリーンインストールが楽 (Raspberry Pi OS Bookworm UG)

Raspberry Pi 3 (Raspberry Pi OS Bullseye)でRTSPを見るのはffplayが楽だと記事を書いた翌日に,Raspberry Pi OS Bookwormがリリースされました.Debian Bookwormは随分前にリリースされ,Raspberry Pi OS Bookwormも近々リリースされると聞いてはいましたが,翌日とはなんというめぐり合わせでしょう.

それで,早速Raspberry Pi 3 Model Bと同Model B+にインストールしてあるRaspberry Pi OSをBullseyeからBookwormにupgradeしてみましたが,結構手間と時間がかかるうえ,ちょっとしたトラブルにも巻き込まれてしまいました.

もし,Raspberry PiをRTSPを見るなど単機能のみに使用するのでしたら,クリーンインストールのほうがずっと楽だし時間もかかかりませんし,トラブルも起きにくいです.

Upgradeしてだめならクリーンインストールという方が時間を潰すには適していますが😅

ところで,Raspberry Pi OS Bookwormもデフォルトのインストールでは,swapにファイルを使うdphys-swapfileでした.SDカードをswapに使うのは全くメリットがないので,デフォルトでZRAMを採用してほしかったですが,まあたぶん開発元ではいろんな議論があったのでょう.

書き込みが遅いし書き込みを繰り返すと寿命が来る.

キンモクセイ

キンモクセイの香りはとてもいい香りの代名詞ですね.あんまりいい香りすぎて筆者が子供の頃には,やたらとトイレの芳香剤に使われました.だから,今でもキンモクセイの香りがすると,トイレをイメージしてしまいます.

昔は自分がひねくれているからこじつけているのだろうと思っていましたが,最近では脳科学的にも嗅覚と記憶の結びつきの強さが示唆されているようで,ある意味被害者ですね😅

How to View RTSP by Raspberry Pi 3 Using ffplay (FFMPEG)

The following article is outdated. For the Raspberry Pi OS only, you can use VLC to watch RTSP as of 3 November 2023.

Original Article follows;

For Raspberry Pis, there are many outdated or sometimes harmful guides to watching video streams (RTSP) generated by webcams. The biggest issue obstructing the approach is that Debian removed RTSP capability from the VLC media player. People who want to simply watch RTSP on the Raspberry Pi are straying.

The goal of this article is to run ffplay on the Raspberry Pi OS automatically.

Disclaimer

The first purpose of this article is to record what I did. However, I am happy if this will be helpful to someone, no matter how much or little. I would like to state this article is based on GPLv3. No warranty at all.

Prior Information

  • The information in this article is tested on Raspberry Pi 3 Model B (RPi3) and Raspberry Pi 3 Model B+ (RPi3+) both of them have 1GB RAM. Raspberry Pi 4 Model B is not tested but may work as well.
  • URL to webcam is in the form of “rtsp://user_id:password@ipaddress/designated_string”
  • Used OS is Raspberry Pi OS bullseye. The next generation, bookworm, will be released soon. This article will or will not be updated after bookworm release.

Raspberry Pi OS installation

Details of the OS installation are omitted in this article because there are many guides, including official and unofficial ones. It is lucky if you find one that suits to you. The installation is not difficult, so you can manage to install it even if the guide you found is not friendly.

The recommendable points are as follows:

  • Install Raspberry Pi OS (64bit) full version, not the LITE version.
  • Enable auto-login (just according to the default).
  • Disable screen blanking.
  • Enable the ssh server (sshd).

The following section assumes the WiFi setup is finished and that all packages have been updated.

Recommended Option: Zram

This is not a must, but I strongly recommend installing ZRAM. Many distros enable ZRAM on their default installation today, but Raspberry Pi OS bullseye doesn’t.

Installation is not difficult. Just install zram-tools with an apt command like,

sudo apt install zram-tools

then swap on the RAM with compression starts functioning. ZRAM has extremely high priority, so the bullseye default, swap-on-file, will never work again. Because the swap file remains just a huge, redundant file, you may want to remove it. It is removed as follows:

sudo systemctl stop dphys-swapfile
sudo systemctl disable dphys-swapfile
sudo rm -v /var/swap

Test ffplay

During the OS installation, you have a mouse, a keyboard, and a monitor connected to the RPi3(+). Keep them connected until the set-up finishes.

The program to view RTSP, ffplay, is included in the FFMPEG package that comes with the Raspberry Pi OS. Open a terminal and execute the next command as a user.

ffplay -fs -loglevel quiet rtsp://user_id:password@ip_address/designated_string

where use_id, password, ip_address, and designated_string are those of the corresponding webcam.

If you get a full-screen video stream, you are one step closer. If you can’t, I can just say “It depends.”

Type “q” to quit the video.

Next, create a shell script file as a user with your favorite editor. You can name it whatever you like. For simplicity, it is named “run_ffplay.sh” here. Inside, it is like,

#!/bin/sh
sleep 20
/usr/bin/ffplay -fs -loglevel quiet rtsp://user_id:password@ip_address/designated_string >/dev/null 2>&1 &

This script sleeps 20 seconds before the execution of ffplay. I don’t know if 20 seconds is optimum. Please trim it if you like.

You can place the script file wherever you want, but your home directory is safe. Then give it execute permission.

chmod a+x run_ffplay.sh

Just run the script to see if you get a full-screen video again.

./run_ffplay.sh

Again, type “q” to quit.

Autostart

You need to create an autostart configuration file in the directory "~/.config/autostart/". By the default of bullseye installation, "~/.config" has been created then you will need,

mkdir ~/.config/autostart

Then create a file named “ffplay.desktop” in the directory with your editor. The contents will like,

[Desktop Entry]
Type=Application
Name=ffplay
Exec=/THE/PATH/TO/run_ffplay.sh

I know I’m being nosy, but /THE/PATH/TO should be the path to run_ffplay.sh. All done; just cross-finger and sudo reboot; exit.

If success, you can remove the mouse and the keyboard.

Shutdown

Unfortunately, there is no smart shutdown method provided without a keyboard and a mouse. Login to the box via ssh from another PC, then execute the command sudo poweroff. Installing an electrical switch on the GPIO and configuring it will be fun. LIRC will be a smarter alternative.

Conclusion

Since Debian removed RTSP capability from the VLC media player, many people are struggling. You can use ffplay of the FFMPEG package as an alternative.

; exit may be redundant.
Or simply poweroff may work.