bytedeco/javacv

Fail to play rtsp stream when the format is set

Open

#252 建立於 2015年10月13日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)Java (1,583 fork)batch import
help wantedquestion

倉庫指標

Star
 (6,985 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Hi,

I have e rtsp stream, that works fine when I don't set the format. for instance:

  streamGrabber = new FFmpegFrameGrabber("rtsp://admin:12345@192.168.64.96:554/live1");
  streamGrabber.setFrameRate(30);
  streamGrabber.setImageWidth(getWidth());

  try {
        streamGrabber.start();
  } catch (FrameGrabber.Exception e) {
        e.printStackTrace();
  }

but when I try to set the format to try to seed up the stream opening javaCV returns an error:

try {
       FFmpegFrameGrabber streamGrabber = new FFmpegFrameGrabber("rtsp://admin:12345@192.168.64.96:554/live1");
        streamGrabber.setFormat("h264");
        streamGrabber.setFrameRate(30);
        streamGrabber.setImageWidth(getWidth());
        streamGrabber.setImageHeight(getHeight());
        streamGrabber.start();
    }catch (Exception e){
        e.printStackTrace();
    }
org.bytedeco.javacv.FrameGrabber$Exception: avformat_open_input() error -1330794744: Could not open input "rtsp://admin:12345@192.168.64.96/ch1/main/av_stream". (Has setFormat() been called?)
error -1330794744 I think is protocol not found

Any idea?

貢獻者指南