Live Camera View
#1
Up for a crude, barely functional method for taking photos with your PinePhone?
Of course you are. You wouldn't have one otherwise.

It's not too hard either. Credit to the postmarketOS wiki as it had the hard part.
You will need to install the mpv and v4l-utils packages.

Code:
media-ctl -d /dev/media1 --set-v4l2 '"ov5640 3-004c":0[fmt:UYVY8_2X8/1280x720]'
mpv av://v4l2:/dev/video1

Press 's' at any time to take a photo. Press 'q' to exit.

I recommend making this into a script and copying it to your SD card so you can avoid typing it in by hand.

Troubleshooting

The pmOS wiki states that the entity name is "ov5640 2-003c". I found that not to work.

If you get a message stating "Invalid argument (22)" then you may have the wrong entity name. Fortunately, you can get it like this:

Code:
media-ctl -d /dev/media1 -p

There should be two entities listed, one a source and the other a sink. You want the entity name for the sink. It will look like the ones mentioned above.
#2
(02-23-2020, 09:47 PM)mpnordland Wrote: ...
You will need to install the mpv and v4l2-utils packages.

typo - should be v4l-utils

Actually gives a reasonable pic if I allow auto-focus or whatever to work (probably hold the thing still - back to camera basics :-) )
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#3
For some reason I had a disabled link into the back camera in V4L2 and mpv wouldn't run, saying:
Code:
[ffmpeg/demuxer] video4linux2,v4l2: ioctl(VIDIOC_STREAMON): Link has been severed
Looking at the output from `media-ctl -d /dev/media1 -p` it had a link enabled to the front camera instead.

After deciphering the media-ctl help I was able to enable the correct link via this:

Code:
media-ctl -d /dev/media1 -l '"ov5640 3-004c":0->"sun6i-csi":0[1]'
Then mpv finally showed the camera feed! ... and crashed immediately on failed memory allocation.

Anyway, using mplayer is also possible and the video was nice and fluent:

Code:
mplayer tv:// -tv driver=v4l2:width=1280:height=720:device=/dev/video2 -fps 30


Possibly Related Threads…
Thread Author Replies Views Last Post
  What Is This World We Live In? _radv_ 5 2,378 02-22-2024, 06:52 AM
Last Post: aular
  reset button under back cover, below the camera mruser1 2 1,554 01-02-2023, 08:07 AM
Last Post: wibble
  To live and die on LTE (with a Pinephone) robthebold 2 2,213 07-08-2022, 11:57 AM
Last Post: robthebold
  PinephonePro camera calibration conundrum orbital 0 1,058 07-06-2022, 09:09 AM
Last Post: orbital
  Camera on manjaro arm transfer76 7 6,286 03-18-2022, 10:11 PM
Last Post: Ant
  Problems with Pinephone camera ov5640 wfk 0 1,624 06-29-2021, 01:53 AM
Last Post: wfk
  fix camera, mobian rvh 3 3,757 03-20-2021, 03:51 PM
Last Post: rvh
Bug Camera doesn't work. SD-Card isn't mounted automatically pavel-hh 1 2,782 07-22-2020, 04:34 PM
Last Post: pavel-hh
  CAMERA WORKS!!! BlueDeer 7 9,613 07-22-2020, 11:27 AM
Last Post: wibble

Forum Jump:


Users browsing this thread: 1 Guest(s)