Stream from VLC to GRIP

I have a recorded MP4 from a camera mounted on a robot roaming around the field, and I want to run it into grip, so we can experiment at a desktop.

I have been able to extract frames from the MP4 and run them through GRIP, but I would like to run the video through.

I am trying to use VLC to stream it out so that I can pick it up as an “IP Camera” in GRIP:

"c:\Program Files\VideoLAN\VLC\vlc.exe" 20220124.mp4 --sout "#transcode{vcodec=MJPG,vb=800,scale=Auto,acodec=none,scodec=none}:duplicate{dst=http{mux=ts,dst=:8080/},dst=display}"

but I can’t get GRIP to connect to VLC:

edu.wpi.grip.core.sources.GrabberService$GrabberServiceException: [IP Camera localhost] Failed to start
	at edu.wpi.grip.core.sources.GrabberService.startUp(GrabberService.java:54)
	at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:60)
	at com.google.common.util.concurrent.Callables$4.run(Callables.java:122)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.bytedeco.javacv.FrameGrabber$Exception: Connection refused: connect
	at edu.wpi.grip.core.sources.IPCameraFrameGrabber.start(IPCameraFrameGrabber.java:102)
	at edu.wpi.grip.core.sources.GrabberService.startUp(GrabberService.java:52)
	... 3 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
	at sun.net.www.http.HttpClient.New(HttpClient.java:308)
	at sun.net.www.http.HttpClient.New(HttpClient.java:326)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at edu.wpi.grip.core.sources.IPCameraFrameGrabber.start(IPCameraFrameGrabber.java:99)
	... 4 more

This is puzzling, because I can connect to http://localhost:8080/ with a browser or VLC.

Has anyone else been able to stream an existing video file into GRIP?

Looked at the GRIP source code, saw that a lot of sources had been added since the 1.5.2 release.

Cloned it and built it from source (on Windows); now I can use the .MP4 I made as a source!

1 Like

…and somehow I had missed that WPI had released v1.6.0 Release Candidate 4

that version seems to be a little buggy. I am not having problems with the version I compiled from the current master.

GRIP 1.6.0 RC4 didn’t work for us at all. More than just buggy. The generated Java code from 1.5.2 was not API compatible with the current OpenCV API in WPILib. In particular the simple blob detector class got changed. You’ll want that for cargo detection.

GRIP and WPILibPi was a dead end for us. Our team switched to using PhotonVision.

1 Like

glad to hear it’s not just me. The current master branch runs just fine for me.

we run python on top of wpilibpi, and the GRIP generated code works just fine.

The only difference between master and 1.60 rc4 is changes to the Readme.

That, and the rc4 I used was the Windows x64 release package downloaded from github, and the version from master was one I built.

I will try to build from the rc4 commit and see what happens.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.