pepoとネットワークを語ろう

40年前からこれまでとこれからのネットワークを語る

raspberry piでライブ配信に挑戦したけど(ーー;)

2014-10-25 15:07:58 | Linux

さて、#kof2014 のネタ探しraspberry piにライブ配信できるのか実験してみたけど

まずは、firewallでportを開けることに

[root@remote-hand ~]# firewall-cmd --permanent --add-port=8090/tcp

[root@remote-hand ~]# firewall-cmd --reload

[root@remote-hand ]# firewall-cmd --list-all-zones

public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client http mdns ssh
ports: 8443/tcp 8090/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:

設定ファイル

# /etc/ffserver.conf
######################################
# This file specifies all the options for streaming
# an ffmpeg produced file as flash
###########################################################################

Port 8090 # this is the port you have set up for streaming
BindAddress 0.0.0.0
MaxClients 10
MaxBandwidth 1000

<Feed remote-hand.ffm>
File /www/remote-hand/tmp/remote-hand.ffm
FileMaxSize 5M
</Feed>

# swf output - good for streaming
<Stream remote-hand.swf>
# the source feed
Feed remote-hand.ffm
# the output stream format - FLV = FLash Video
Format swf
# this must match the ffmpeg -r argument
VideoFrameRate 1
# generally leave this is a large number
VideoBufferSize 10000
# another quality tweak
#VideoBitRate 500
VideoBitRate 500
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 320x240
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
NoAudio
</Stream>

<Stream stat.html>
Format status
</Stream>

<Redirect index.html>
# credits!
URL http://192.168.1.2:8090/stat.html
</Redirect>
################################################################################
#
#URL http://ffmpeg.sourceforge.net/

ffserverの起動

[root@remote-hand ~]# ffserver &

# ffmpeg -f video4linux2 -s 320x240 -i /dev/video1 -r 1 http://127.0.0.1:8090/remote-hand.ffm

設定を色々と思考錯誤するが

結果、CPU速度不足でやっぱり無理だった