ffmpeg でライブストリーミングしながらビデオとオーディオをファイルに保存
映像にはタイムスタンプ
ファイル名はタイムスタンプ
ファイルは60秒毎に分割
1 |
$ ffmpeg -f alsa -ac 1 -thread_queue_size 8192 -i plughw:CARD=Set,DEV=0 -f v4l2 -video_size 1080x720 -framerate 7.5 -i /dev/video1 -vf "drawtext=fontfile=/usr/share/fonts/truetype/fantasque-sans/Normal/TTF/FantasqueSansMono-Bold.ttf: fontsize=30: text='%{localtime\:%Y-%m-%d %X}': fontcolor=red@0.9: x=10: y=10" -c:v h264_omx -b:v 768k -bufsize 768k -vsync 1 -g 16 -c:a aac -b:a 128k -ar 11025 -af "volume=30dB" -flags +global_header -map 0 -map 1 -f tee "[f=flv]rtmp://localhost:1935/live1/hls|[f=segment:segment_time=60:strftime=1]%Y-%m-%d_%H-%M-%S_f.flv" |
1 |
$ arecord -L |
—