-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YUYV from V4L panics with "img does not implement SubImage()" error #15
Comments
Can you send me one of your video files, in your exact pixel format? Then I can try to reproduce. What ffmpeg version do you have? In general, as you might have noticed by looking at the code, the video input situation for Go is pretty bad. There are some v4l libraries, but they are pretty limited in features, and for both ffmpeg and raspicam, the "best" solution turned out to run them as binaries and read from their stdout.. |
I did paste attach some sample at #16 (comment) although that one is heavily modified from the original, and my
but I don't think that's the problem because in this report I am not using it directly with your golang code. Because ffmpeg was being used only to feed into the loopback
I actually wonder if all could be done with Because what I've been doing as a workaround for now since my camera situation is still somewhat changing and testing is just recording a few samples as I am able and then playing those from files which does work — and that's been working (so long as I pre-crop to avoid #19) as far as not getting input/format/ |
Yes. This is exactly what I am doing with the libcamera implementation (for the Raspberry Pi Cam 3): Line 86 in 03bcf15
When I started the project, I was using a v4l webcam via github.com/vladimirvivien/go4vl (pkg/vid/cam.go), so I had to do all the copping etc myself in Go. It would not be too hard to change the ffmpeg source to 1. be used for v4l etc as well and 2. dirctly implement cropping. In that case, I'd perhaps change the ffmpeg src to also accept the same struct as the Pi cam for config ( Line 35 in 03bcf15
|
So yes, I'd love if basically I could pass basically any source (and options) to Was hoping to take a swing at routing more input options into ffmpeg myself, but it's been awhile since I did much golang development and with this repo even if I try download the modules first attempting:
within a checkout of this repo I still get a bunch of errors from
using |
This would be pretty easy, and 90% of the work for that would already be done, in https://github.com/jo-m/trainbot/blob/master/pkg/vid/vid.go. As for your building problems, my guess would be that you need a newer go version. I am using go 1.21 from a PPA: https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports |
I'm hoping to get this working with a V4L (loopback) device fed by ffmpeg. If not for testing (since only a few trains a day at my location) but also so that I can eventually feed it from a networked camera via a go2rtc RTSP feed. But for now just with a sample recording of a train going past to see it work.
So in one terminal I do:
And then in another terminal I do:
This combination gets me the farthest without general opening/format errors but then I am left with an error:
Any advice?
The text was updated successfully, but these errors were encountered: