Closed hexianbin1994 closed 1 month ago
when I use FFmpegFrameGrabber to get frame from rtsp url, because some url is wrong, the grabber.start() is blocked . set grabber.setOption("stimoout", "2000000"); but it doesn't work. so how to set connect timeout?
# pom.xml <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv-platform</artifactId> <version>1.5.8</version> </dependency>
import org.bytedeco.javacv.FFmpegFrameGrabber; grabber = new FFmpegFrameGrabber("rtsp://128.8.84.224:18554/stream"); # wrong url grabber.setOption("rtsp_transport", "tcp"); grabber.setOption("stimeout", "2000000"); grabber.setOption("analyzeduration", "10000"); grabber.setVideoOption("skip_frame", "nokey"); grabber.setVideoOption("fflags", "nobuffer"); grabber.start()
Please refer to this sample code: https://github.com/bytedeco/javacv/blob/master/samples/FFmpegStreamingTimeout.java
ok,i fix it by use grabber.setOption("timeout", "2000000"); version 1.5.8
when I use FFmpegFrameGrabber to get frame from rtsp url, because some url is wrong, the grabber.start() is blocked . set grabber.setOption("stimoout", "2000000"); but it doesn't work. so how to set connect timeout?