LoginSignup
57
52

More than 5 years have passed since last update.

Raspberry Pi のカメラモジュールでハイビジョン撮影して iOS に streaming 配信する

Last updated at Posted at 2014-06-16

Cameramodule をセットした Raspberry Pi で、raspivid で動画撮影し、ffmpeg をセグメンタにして HLS で配信するスクリプト
これをサーバのドキュメントルートで実行する。segments フォルダが存在していることが前提(そこにセグメントファイルを作成する)
こんな感じで、8〜9秒ほどの遅延でストリーミング配信できました

raspivid -n -w 1080 -h 720 -fps 25 -vf -hf -t 86400000 -b 1800000 -ih -o - \
| ffmpeg -y \
    -i - \
    -c:v copy \
    -map 0:0 \
    -f ssegment \
    -segment_time 4 \
    -segment_format mpegts \
    -segment_list stream.m3u8 \
    -segment_list_size 1 \
    -segment_list_flags live \
    -segment_list_type m3u8 \
    "segments/%01d.ts" 


trap "rm stream.m3u8 segments/*.ts" EXIT

このページを参考にし、元のスクリプトだと鏡像反転してしまうのとセグメンタの遅延が大きかったので少し変更しました

57
52
2

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
57
52