package com.hust.hui.alarm.common.test.ffmpeg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/
  @program: mayun-quick_Netty
  @description:
  @author: Mr.Liu
  @create: 2019-04-01 15:12
 /
public class ffmpeg_test extends Thread{
    /*
      运行ffmpeg指令(会弹窗)多线程就不会 但是要删掉指令里面的start指令
     */
    public static void mainss(){
        //调用电脑摄像头测试(不太好)
        String testCam = "cmd /c  ffmpeg -f dshow -i video="USB2.0 VGA UVC WebCam" -f mpegts -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 "rtmp://localhost:1935/live/test"";
        //调用网络摄像头rtsp转为rtmp并推向Nginx服务器
        //为了不弹出cmd窗口 就使用多线程执行当前方法 并且要删掉 下面 all 里面的前面的 start 指令
        String all = "cmd /c start ffmpeg -re  -rtsp_transport tcp -i "rtsp://admin:6512xiaobinbin@162.158.0.64:554/h264/ch1/main/av_stream" " +
                "-f flv -vcodec libx264 -vprofile baseline -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 640x480 -q 10 "rtmp://localhost:1935/live/test" ";
        String line =null;
        StringBuilder sb = new StringBuilder();
        Runtime runtime = Runtime.getRuntime();
        try {
            System.out.println(all);
版权声明:
本文来源网络,所有图片文章版权属于原作者,如有侵权,联系删除。
本文网址:https://www.bianchenghao6.com/h6javajc/17496.html