bytedeco/javacv

Fail to play rtsp stream when the format is set

Open

#252 opened on Oct 13, 2015

View on GitHub
 (8 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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?

Contributor guide