树莓派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 来判断
相关推荐
阿拉斯攀登14 分钟前
字符设备驱动:file_operations 与读写实现
linux·嵌入式·linux驱动·字符设备驱动
阿拉斯攀登34 分钟前
嵌入式 Linux 驱动概述:分类、内核模块、开发环境
linux·嵌入式硬件·linux内核·嵌入式·linux驱动
Raina测试2 小时前
Maestro实现IOSUI自动化
运维·自动化
不像程序员的程序媛9 小时前
系统cpu内存负载资源分析
运维·服务器·数据库
Uncertainty!!11 小时前
Ubuntu 22.04 安装超好用中文输入法rime-ice(雾凇拼音)过程记录
linux·ubuntu·中文输入法
ShineWinsu12 小时前
对于Linux:网络基础的解析
linux·网络·面试·udp·笔试·ip·tcp
Asuicao12 小时前
centos7.9版本升级ssh OpenSSH 9.8p1 源码 OpenSSL 1.1.1w 源码包以及安装升级回滚文档
运维·ssh
耍酷的魔镜12 小时前
谈谈如何使用Netty开发实现高性能的RPC服务器
服务器·网络协议·rpc
志栋智能13 小时前
超自动化安全中的威胁狩猎
运维·安全·自动化
↘"LYong13 小时前
旧版 CentOS 安装 Docker 完整指南(附国内镜像加速)
linux·运维·docker