flutter-pi
flutter-pi copied to clipboard
Camera & Video Support?
Does the rpi camera module or a usb camera work with this? Can it record and playback videos at 4k? thanks!
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.
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 :)
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
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
cool! any chance of sharing it? photo is fine foe now. thx
I will publish this port on pub.dev in the next time.
Does anyone have an example on how to use omx player ?
@pezi Did you make any progress?