您的位置:首页 > 运维架构 > Linux

How to Push the Video streams to DouYu/XiongMao/Bilibili using PI

2017-08-19 20:27 288 查看

Setup the decoder

sudo git clone git://git.videolan.org/x264
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
make
sudo make install
cd ..
rm -rf x264


Setup the ffmpeg

sudo git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
make
sudo make install
cd ..
rm -rf ffmpeg


Using this command to push the Video

ffmpeg -re -i "xxx.mp4" -vcodec copy -acodec aac -b:a 192k -f flv "your rtmp address/your live code"


you can also do it with circulation:

##live.sh
#!/bin/bash
while true
do
ffmpeg -re -i "1.mp4" -vcodec copy -acodec aac -b:a 192k -f flv "你的rtmp地址/你的直播码"
done


then:

screen nohup sh live.sh &


Tips

Here is my script,Ignore the magic number or other things~:

#!/bin/bash
max=47
laterName=".mp4"
fileName=""
while true
do
for((i=1;i<=${max};i++))
do
fileName=${i}${laterName}
##ffmpeg -re -i 文件名 -vcodec copy -acodec aac -b:a 192k -f flv "你的rtmp地址/你的直播码"
ffmpeg -re -i ${fileName} -vcodec copy -acodec aac -b:a 192k -f flv "rtmp://txy.live-send.acg.tv/live-txy/?streamname=live_188341289_7509563&key=eeb4dec14753b6c55d84a33411140644"
done

done
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  PI linux video
相关文章推荐