Skip to content
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

Live camera feed #37

Closed
AndersonReyes opened this issue May 2, 2017 · 9 comments
Closed

Live camera feed #37

AndersonReyes opened this issue May 2, 2017 · 9 comments

Comments

@AndersonReyes
Copy link
Contributor

having camera capture feed would be cool

@beyondmetis
Copy link
Member

Do you mean from a webcam, over a network, or both?

@AndersonReyes
Copy link
Contributor Author

Webcam. I haven't looked up how to implement it myself but I can give it a try. Right now we have to use opecv on top of scikit video just for live webcam feed.

@beyondmetis
Copy link
Member

This is interesting. There's nothing stopping us from implementing this, since the ffmpeg backend can support this by itself. It's just a matter of wrapping a function around ffmpeg/libav.

According to https://trac.ffmpeg.org/wiki/Capture/Webcam, the live feed can be dumped using:
ffmpeg -i /dev/video0 output.mp4

On windows:
ffmpeg -y -f vfwcap -i 0 output.mp4

@AndersonReyes
Copy link
Contributor Author

word I'll start there

@AndersonReyes
Copy link
Contributor Author

Hmmm from what I see the feed is always dumped to output file so then we'd be dumping and reading concurrently and using a generator to get the frame

@beyondmetis
Copy link
Member

Have you considered pipes? That's what scikit-video currently uses. FFmpeg actually gets called like:

ffmpeg -i inputfile.mp4 -

The '-' means pipe to stdout. I'm not sure how this will be handled internally when providing a webcam as input. It might just work :)

@AndersonReyes
Copy link
Contributor Author

That or should be able to read the raw video data coming in anf convert it to numpy arrays. Hmm I think I got a solution give me a few weeks (it's finals for me lol..undergrad problems lol) I'll hack at it.

@beyondmetis
Copy link
Member

Actually, you can pipe std out right into numpy arrays. This is exactly what scikit-video does under the hood :)

@beyondmetis
Copy link
Member

I believe skvideo supports this in Linux now. Not sure about Windows or Mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants