iizukanao / picam

Audio/video recorder for Raspberry Pi with language agnostic API
GNU Lesser General Public License v2.1
488 stars 78 forks source link

Text overlay (subtitle) with HLS #158

Open neon29 opened 3 years ago

neon29 commented 3 years ago

To add subtitle I have proceeded as follows:

Modify my run_picam.sh:

sudo bash /home/pi/make_dirs.sh
sudo touch /home/pi/picam/hooks/subtitle
sudo cat  /home/pi/picam/sub  > /home/pi/picam/hooks/subtitle
sudo /home/pi/picam/picam -o /run/shm/hls --alsadev hw:1,0

where cat contains:


text=♨☀♻♥⚠
font_file=/home/pi/NotoSansCJKjp-Regular.otf
pt=120
layout_align=middle,center
letter_spacing=40

I can then watch and listen to my stream at http://ip_address/hls/index.m3u8 for example thanks to VLC. However, I do not see any subtitle.

Does subtitles are expected to work with HLS?

iizukanao commented 3 years ago

@neon29 Yes, subtitles work with HLS. Have you put a font file /home/pi/NotoSansCJKjp-Regular.otf? If not, you can download the file from https://github.com/googlefonts/noto-cjk/raw/main/NotoSansCJKjp-Regular.otf

al3xt3ch commented 3 years ago

Got the same problem. Tried vlc and webstream via nginx. ` text=TEST font_file=/home/pi/Sentinel-Medium.otf pt=18 layout_align=middle,center

`