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

Camera & Video Support? #176

Open
jtkeyva opened this issue May 25, 2021 · 7 comments
Open

Camera & Video Support? #176

jtkeyva opened this issue May 25, 2021 · 7 comments

Comments

@jtkeyva
Copy link

jtkeyva commented May 25, 2021

Does the rpi camera module or a usb camera work with this? Can it record and playback videos at 4k?
thanks!

@pezi
Copy link

pezi commented May 25, 2021

I started a private project to port
https://github.com/caprica/picam
https://github.com/caprica/picam-native
to dart using FFI. But this port will only support still images.

@ardera
Copy link
Owner

ardera commented May 25, 2021

Video playback works via omxplayer_video_player, but there's no plugin for camera playback right now.

But I think it's possible to get working with a workaround. On newer raspbian, the pi cam or any other camera should be present as a /dev/video0 file. Some other people tried to get omxplayer to playback that file: https://www.raspberrypi.org/forums/viewtopic.php?t=69322

So if we take the first one as an example:

mkfifo /tmp/out.raw
mplayer tv:///dev/video0 -dumpstream -dumpfile /tmp/out.raw

And then, instead of invoking omxplayer with omxplayer <some path or URL>, you initialize your VideoPlayerController with:

VideoPlayerController.file("/tmp/out.raw")

This is not particularly optimal though, maybe there's delay or high CPU usage because so much memory will be copied, so it'd still be cool to have a real camera plugin

Btw, omxplayer_video_player is just a backend of video_player. So for docs on how to use it to play video you actually need to look at the video_player package, or you use some higher level video player like Chewie :)

@jtkeyva
Copy link
Author

jtkeyva commented May 26, 2021

thanks @pezi for now a photo will be fine so i will check it out

@ardera got it thanks. i am familiar with omxplayer so i may tinker a bit. all sounds hopeful and look forward to the progress

@jtkeyva
Copy link
Author

jtkeyva commented May 26, 2021

I started a private project to port
https://github.com/caprica/picam
https://github.com/caprica/picam-native
to dart using FFI. But this port will only support still images.

cool! any chance of sharing it? photo is fine foe now. thx

@pezi
Copy link

pezi commented May 26, 2021

cool! any chance of sharing it? photo is fine foe now. thx

I will publish this port on pub.dev in the next time.

@Tek-hp
Copy link

Tek-hp commented Feb 22, 2022

Does anyone have an example on how to use omx player ?

@madc
Copy link

madc commented Jan 20, 2023

@pezi Did you make any progress?

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

No branches or pull requests

5 participants