FFMPEG 截取RTMP直播流图片命令
来源:互联网 发布:海外淘软件 编辑:程序博客网 时间:2024/05/18 02:40
CentOS 6.5 yum安装FFMPEG步骤
1. 手动添加yum源配置
vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository
for
Red Hat Enterprise Linux
baseurl=http:
//apt
.sw.be
/redhat/el
$releasever
/en/
$basearch
/dag
gpgcheck=0
enabled=1
2.安装
yum -y install ffmpeg
ffmpeg截图
ffmpeg -i "rtmp://10.1.1.31/live/test live=1" -f image2 -ss 0 -vframes 1 -s 220*220 /tmp/a.jpg
3.Java调用命令行执行截图操作
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;public class Main { public static void main(String[] args) { for (String arg : args) { System.out.println(arg); } ProcessBuilder builder = new ProcessBuilder(); builder.command("ffmpeg", "-i", "rtmp://10.1.1.31/live/test live=1", "-f", "image2", "-ss", "0", "-vframes", "1", "-s", args[0], "/tmp/fish/a.jpg"); builder.redirectErrorStream(false); try { Process process = builder.start(); InputStream in = process.getInputStream(); System.out.println("正在进行截图,请稍候======================="); convertStreamToString(in); System.out.println(""); InputStream errorStream = process.getErrorStream(); if (errorStream != null && errorStream.read() > 0) { System.out.println("错误:"); convertStreamToString(errorStream); } in.close(); } catch (IOException e) { System.out.println("错误:"); e.printStackTrace(); } } public static String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { System.out.println(line); sb.append(line + "/n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); }}
0 0
- FFMPEG 截取RTMP直播流图片命令
- ffmpeg rtmp直播命令
- FFmpeg+RTMP 直播 iOS推流
- ffmpeg推流RTMP命令
- 搭建rtmp直播流服务之3:java开发ffmpeg实现rtsp转rtmp并实现ffmpeg命令的接口化管理架构设计及代码实现
- ffmpeg处理rtmp直播流(截图、收录)
- nginx开发(四)调用ffmpeg,搭建rtmp直播流。
- FFMPEG接收RTMP直播流保存的问题
- 搭建nginx rtmp直播服务器,ffmpeg模拟推流
- 使用ffmpeg实现RTMP的直播推流功能
- 搭建nginx rtmp直播服务器,ffmpeg模拟推流
- 搭建rtmp直播流服务之2:使用java实现ffmpeg命令接口化调用(用java执行ffmpeg命令)
- 搭建rtmp直播流服务之2:使用java实现ffmpeg命令接口化调用(用java执行ffmpeg命令)
- ffmpeg 推送、保存rtmp 流命令
- 直播系统3-ffmpeg处理RTMP流媒体的命令和发送流媒体的命令(UDP,RTP,RTMP)
- FFMPEG 摄像头 命令行参数 录像 直播 rtmp
- FFMPEG 摄像头 命令行参数 录像 直播 rtmp
- FFMPEG 摄像头 命令行参数 录像 直播 rtmp
- Department Top Three Salaries
- 微信获取accesstoken以及openID
- UVa 327 - Evaluating Simple C Expressions
- NoNodeAvailableException[None of the configured nodes are available
- android L和android M的区别
- FFMPEG 截取RTMP直播流图片命令
- Android 避免Activity重复创建 一次finish()返回上个页面
- 自定义ViewGroup的使用
- makefile中的notdir,wildcard和patsubst
- 转IBM官网 利用 Java dump 进行 JVM 故障诊断
- HBASE安装配置
- Git Clone 远程分支
- Objective-C Runtime 运行时之四:Method Swizzling
- Android 学习笔记 Contacts (一)ContentResolver query 参数详解