我(第一次下载的是1.2.3最新版本的)第二次下载的是上图的版本,建议用一个比较稳定的版本,解压到你找的到文件夹里,然后修改Red5相关参数
只需要配置HTTP 和RMTP节点的host和port即可 默认也行host配置成0.0.0.0 输入局域网IP或者127.0.0.1都可以正常访问
# Socket policy
policy.host=0.0.0.0
policy.port=843
# HTTP
http.host=192.168.xxx.xxx
http.port=5080
https.port=5443
http.URIEncoding=UTF-8
http.max_headers_size=8192
http.max_keep_alive_requests=-1
http.max_threads=20
http.acceptor_thread_count=10
http.processor_cache=20
# RTMP
rtmp.host=192.168.xxx.xxx
rtmp.port=1935
rtmp.io_threads=8
rtmp.send_buffer_size=65536
rtmp.receive_buffer_size=65536
rtmp.ping_interval=1000
rtmp.max_inactivity=60000
rtmp.max_handshake_time=5000
rtmp.tcp_nodelay=true
rtmp.tcp_keepalive=false
rtmp.default_server_bandwidth=10000000
rtmp.default_client_bandwidth=10000000
rtmp.client_bandwidth_limit_type=2
rtmp.bandwidth_detection=false
rtmp.encoder_base_tolerance=5000
rtmp.encoder_drop_live_future=false
# traffic optimization hinting. to disable set traffic class set to -1
# low delay + high throughput == 24 (0x18)
rtmp.traffic_class=-1
# requested maximum length of the queue of incoming connections
rtmp.backlog=32
# the interval (seconds) between each throughput calculation
rtmp.thoughput_calc_interval=15
# enable use of the default mina acceptor
rtmp.default_acceptor=true
# socket i/o pool sizes used when default acceptor is disabled
rtmp.initial_pool_size=0
rtmp.max_pool_size=2
rtmp.max_processor_pool_size=8
rtmp.executor_keepalive_time=60000
mina.logfilter.enable=false
# scheduler configs (per application)
rtmp.scheduler.pool_size=8
rtmp.deadlockguard.sheduler.pool_size=8
# message executor configs (per application) - adjust these as needed if you get tasks rejected
rtmp.executor.core_pool_size=4
rtmp.executor.max_pool_size=32
rtmp.executor.queue_capacity=64
# drop audio packets when queue is almost full, to disable this, set to 0
rtmp.executor.queue_size_to_drop_audio_packets=60
# maximum amount of time allotted to process a single rtmp message / packet in milliseconds, set it as 0 to disable timeout
rtmp.max_handling_time=2000
# connection tweaks - dont modify unless you know what you're doing
rtmp.channel.initial.capacity=3
rtmp.channel.concurrency.level=1
rtmp.stream.initial.capacity=1
rtmp.stream.concurrency.level=1
rtmp.pending.calls.initial.capacity=3
rtmp.pending.calls.concurrency.level=1
rtmp.reserved.streams.initial.capacity=1
rtmp.reserved.streams.concurrency.level=1
# maximum packet size allowed in bytes
rtmp.max_packet_size=3145728
Error: JNI error occurred, please check the installation and try again
Exception in thread "main" java.lang.unsupportiedclassversionerror: org / red5 / server / bootstrap has been compiled by a newer version of Java runtime (class file version 55.0), which only recognizes class file versions up to 52.0
//下面是翻译
错误:发生JNI错误,请检查安装并重试
线程“main”java.lang.UnsupportedClassVersionError中的异常:org/red5/server/Bootstrap已由较新版本的java运行时(类文件版本55.0)编译,此版本的java运行时仅识别高达52.0的类文件版本
最新版本的red5,用的Java版本比我之前安装的版本高,所以我会运行失败。我重新选择了合适的1.0.1版本red5进行了安装,可以运行起来了。
http://localhost:port(localhost、port为配置文件..\conf\red5.properties中设置的,参考2.2的图) ,如下图就说明启动成功了。
进入发布设置界面:http://localhost:port/demos/publisher.html(localhost:port替换成自己的ip和端口)
查看Settings区域。选择Video后在Device中选择摄像头,并点击Start,出现视频画面(有可能会提示是否允许。选择允许即可)
我用chrome浏览器访问会存在的问题,video 选择时候会出现下图情况No video
我换成IE浏览器访问就可以从video里找到可选择的播放设备。按照下面的步骤可以进行推流。
修改一下red5-server/webapps/oflaDemo/index.html的配置
jwplayer('mediaspace').setup({
'flashplayer': 'player.swf',
'file': '你的streamid', //你的streamid 很重要哦
'streamer': 'rtmp://你的ip/oflaDemo',
'controlbar': 'bottom',
'width': '720',
'height': '480'
});
测试可以访问http://localhost:port/oflaDemo/index.html(localhost:port替换成自己的ip和端口)
也可以下载VCL播放器播放 rtmp://你的ip/oflaDemo/你的streamid。
以上内容我补充了我遇到的问题,参考链接https://blog.csdn.net/u010651369/article/details/80886676