树莓派4B安装ffmpeg

环境:

bash 复制代码
pi@raspberrypi:~/x264 $ lsb_release  -a
   No LSB modules are available.
   Distributor ID: Raspbian
   Description:    Raspbian GNU/Linux 10 (buster)
   Release:        10
   Codename:       buster

装H264

bash 复制代码
git clone --depth 1 https://code.videolan.org/videolan/x264
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
make -j4
sudo make install

装ffmpeg

bash 复制代码
git clone git://source.ffmpeg.org/ffmpeg --depth=1
cd ffmpeg
./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
make -j4
sudo make install

如果下载慢,可以手工下载源码https://ffmpeg.org/download.html

测试

bash 复制代码
ffmpeg -i 1.wmv -y -qscale 0 -vcodec libx264 11.mp4
 

实时视频推拉流:

bash 复制代码
流服务可自行使用nginx+rtmp模板部署,

拉流:
ffplay rtmp://{serverIP}/live/stream


推流
windows: ffmpeg -f dshow -i video="USB2.0_CAM1" -vcodec libx264 -f flv rtmp://{serverIP}/live/stream

windows使用命令ffmpeg.exe -list_devices true -f dshow -i dummy 来查看对应摄像头的名字


linux: ffmpeg -f v4l2 -i /dev/video0 -vcodec libx264 -f flv rtmp://{serverIP}/live/stream
linux则通过 /dev/videoN 来判断
相关推荐
Decay__15 小时前
附 - 02・SQLServer 分库分表与中间件 —— 原生分区表、横向分库实践与联邦查询
运维·数据库·sql·mysql·架构
15Moonlight15 小时前
Linux 网络(11):IO 多路转接(select /poll/epoll)
linux·网络
峥嵘life16 小时前
Android16 热点「网络共享」开关的设计与实现
服务器·网络·microsoft
wno70416 小时前
CentOS下FTP服务搭建
linux·运维·centos
mylove_北极甜虾16 小时前
jenkins-01Jenkins 架构与任务调度
运维·jenkins
15Moonlight17 小时前
Linux网络(12):Reactor 模式
linux·网络
张小姐的猫17 小时前
【基于 WebSocket 的多用户网页五子棋】—— 整合封装服务器模块设计实现1️⃣
服务器·websocket·网络协议
思想觉悟18 小时前
Android启动流程之点rc文件
android·linux·面试
kyle~1 天前
嵌入式 SoC 系统
linux·c++·嵌入式·计算系统
tianyuanwo1 天前
PostgreSQL 部署运维实战总结:从安装踩坑到生产可用
运维·数据库·postgresql