
我有配备 Arducam 相机和 Debian Bullseye 的 Raspberry Pi 3b+,我想要实现以下目标:
- 从 libcamera-vid 获取视频,800x600,15 fps
- 从默认音频源获取音频
- 将视频流式传输到 YouTube Live
- 将视频保存到文件夹 /mnt/smb,以便文件名包含时间戳(包括秒)
- 每 24 小时开始播放新视频
以下命令将视频流式传输到 Youtube:
libcamera-vid --inline --nopreview -t 0 --width 800 --height 600 --framerate 15 --codec h264 -o - | ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -thread_queue_size 1024 -use_wallclock_as_timestamps 1 -i pipe:0 -c:v copy -c:a aac -preset fast -strict experimental -f flv "$YOUTUBE_SERVER_URL$YOUTUBE_KEY"
使用 ffmpeg 保存视频到文件也很容易,但我无法同时完成这两项工作。我尝试使用 tee 分割视频流,也研究过液体肥皂,但到目前为止还没有成功。GStreamer 可能也是一种选择,但我不确定它是否能与 libcamera-vid 一起使用。