树莓派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 来判断
相关推荐
木心月转码ing13 小时前
WSL+Cpp开发环境配置
linux
Rockbean1 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
蝎子莱莱爱打怪1 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
茶杯梦轩2 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
崔小汤呀2 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应2 天前
vi编辑器使用
linux·后端·操作系统
何中应2 天前
Linux进程无法被kill
linux·后端·操作系统
何中应2 天前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应2 天前
Linux常用命令
linux·操作系统
葛立国2 天前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux