Questions about filming video with the Pinephone
#1
Video 
Hello and greetings! I'm planning to order a Pinephone Beta soon (150$ version) ideally next month if money allows. I use Manjaro Linux on my desktop and having a phone with it too will be a dream come true. I'm looking to know a few things first however.

On this one I've been trying to find an answer for ages but no amount of online searching helped. One thing I wish to know first relates to the camera: I see in the specs that it's 5MP for back and 2MB for front, but can find absolutely no information on how it films video! More specifically I wish to know the following:


  1. First and foremost, what resolution and frame rate is video shot at? I need to be able to record in at least 1080p @ 30 FPS, the abilities of my current phone (an ancient Samsung Galaxy S3). I'm actually hoping filming at 60 FPS is going to become possible for me after this upgrade, but can take 30 as long as the resolution is 1920x1080 and not less.
  2. Is the video format mp4? Asking as I remember old phones had weird ones (such as 3gp) which some applications couldn't even play properly. That was very long ago however.
  3. This one's less important but still good to know: Can you use the flash while filming for shooting night time video? On that matter, is there a night setting to make video shot in darkness brighter at the cost of extra blur, so even if it's blurry you can at least see something?
  Reply
#2
I've seen a few things other people have done with the cameras. For videos, people use the v4l2 interface directly by say reading the video out with ffmpeg. You can find some information about how to do this from Martijn Braam's blog post from almost a year ago (https://blog.brixit.nl/camera-on-the-pinephone). Take a look at Martijn's other posts as well as Martijn's software for the PinePhone cameras Megapixels.

As for the hardware capabilities, you can find the datasheets for some of the main components at the bottom of https://wiki.pine64.org/wiki/PinePhone and information about the rest of the components on https://wiki.pine64.org/wiki/PinePhone_component_list

1.

The datasheet for the back camera (https://files.pine64.org/doc/datasheet/p...asheet.pdf), which is an OV5640, indicates that it can do 1080p @ 30 fps and 720p @ 60 fps.

The datasheet for the front camera (https://files.pine64.org/doc/datasheet/p...131201.pdf, which is a GC2145, is sadly less informative. The information is there to calculate it but it would be quite a bit of work to do.


2.

The hardware interface provides the images in a raw format. It is up to the reading software what to do with it, such as encoding. ffmpeg can read the camera, and ffmpeg can write the data in an MP4 file. Though MP4 is just the container. You would still need to pick a codec. One thing to keep in mind, the encoding will be in software as far as I know (I don't know if the CPU has any video encoders or not, or if the drivers work for them if they are there). That could easily limit your frame rate depending on the video codec and settings you use.

3.

The flash is controllable from software, so in principle yes. If you just want the flash to be on continuously, just use a torch program and turn it on in and leave it that way (I believe Manjaro is also configured such that you can turn it on and off from an easy to reach menu, but haven't checked (seems like I heard this somewhere)). Worst comes to worse, you might have to find out how such programs control the light and do it yourself.
  Reply
#3
(05-27-2021, 03:04 PM)vortex Wrote: I've seen a few things other people have done with the cameras. For videos, people use the v4l2 interface directly by say reading the video out with ffmpeg. You can find some information about how to do this from Martijn Braam's blog post from almost a year ago (https://blog.brixit.nl/camera-on-the-pinephone). Take a look at Martijn's other posts as well as Martijn's software for the PinePhone cameras Megapixels.

As for the hardware capabilities, you can find the datasheets for some of the main components at the bottom of https://wiki.pine64.org/wiki/PinePhone and information about the rest of the components on https://wiki.pine64.org/wiki/PinePhone_component_list

1.

The datasheet for the back camera (https://files.pine64.org/doc/datasheet/p...asheet.pdf), which is an OV5640, indicates that it can do 1080p @ 30 fps and 720p @ 60 fps.

The datasheet for the front camera (https://files.pine64.org/doc/datasheet/p...131201.pdf, which is a GC2145, is sadly less informative. The information is there to calculate it but it would be quite a bit of work to do.


2.

The hardware interface provides the images in a raw format. It is up to the reading software what to do with it, such as encoding. ffmpeg can read the camera, and ffmpeg can write the data in an MP4 file. Though MP4 is just the container. You would still need to pick a codec. One thing to keep in mind, the encoding will be in software as far as I know (I don't know if the CPU has any video encoders or not, or if the drivers work for them if they are there). That could easily limit your frame rate depending on the video codec and settings you use.

3.

The flash is controllable from software, so in principle yes. If you just want the flash to be on continuously, just use a torch program and turn it on in and leave it that way (I believe Manjaro is also configured such that you can turn it on and off from an easy to reach menu, but haven't checked (seems like I heard this somewhere)). Worst comes to worse, you might have to find out how such programs control the light and do it yourself.

Thank you, that answers the main question. So at least at hardware level, it's certain that filming at 1080p / 30 FPS is possible? What about 60 FPS?

I was curious about the default camera app otherwise, or those available if there isn't a default installed and I have to add it manually. I'm assuming there is a GUI based one like on the Android phones, where you click on an icon and get taken to a screen where you can film or take photos? The sort that looks like this:

[Image: camera-fv-5.png]
  Reply
#4
(05-27-2021, 05:26 PM)MirceaKitsune Wrote: Thank you, that answers the main question. So at least at hardware level, it's certain that filming at 1080p / 30 FPS is possible? What about 60 FPS?

Yes to 1080p @ 30 fps. The datasheet says so.

60 fps probably not. The datasheet showed the fps increasing steadily as the resolution decreased downward. You would need to dive deep into the data sheet to find what the maximum frame rate at 1080p is. It might be a bit higher than 30 fps, but it is almost certainly less than 45 fps.


(05-27-2021, 05:26 PM)MirceaKitsune Wrote: I was curious about the default camera app otherwise, or those available if there isn't a default installed and I have to add it manually. I'm assuming there is a GUI based one like on the Android phones, where you click on an icon and get taken to a screen where you can film or take photos? The sort that looks like this:

[Image: camera-fv-5.png]

Megapixels is installed by default on many distros for the PinePhone. It is a GUI app. It is still pretty minimal, and can't take video last I checked. It can take pictures with both cameras on the PinePhone, and does the post processing to do color correction and that sort of thing. Note that such post processing is not done for the preview.
  Reply
#5
(05-28-2021, 05:32 PM)vortex Wrote: Yes to 1080p @ 30 fps. The datasheet says so.

60 fps probably not. The datasheet showed the fps increasing steadily as the resolution decreased downward. You would need to dive deep into the data sheet to find what the maximum frame rate at 1080p is. It might be a bit higher than 30 fps, but it is almost certainly less than 45 fps.

Thanks, that clarifies what I wanted to know. So at least the same video quality as a Samsung Galaxy S3 should be assured, that's great! Just curious: Is there a hardcoded limit in the camera against trying to film at 60 FPS, or can you still try it but if the hardware can't handle the data flow you get laggy footage?

(05-28-2021, 05:32 PM)vortex Wrote: Megapixels is installed by default on many distros for the PinePhone. It is a GUI app. It is still pretty minimal, and can't take video last I checked. It can take pictures with both cameras on the PinePhone, and does the post processing to do color correction and that sort of thing. Note that such post processing is not done for the preview.

I see. So I need a separate app to film video then, other than the one used to take photos? What is a good one to install if so? GUI based obviously... even I'm not that nerdy to type a console command whenever I walk across something I want to take a film of Big Grin
  Reply
#6
(05-30-2021, 09:30 AM)MirceaKitsune Wrote:
(05-28-2021, 05:32 PM)vortex Wrote: Yes to 1080p @ 30 fps. The datasheet says so.

60 fps probably not. The datasheet showed the fps increasing steadily as the resolution decreased downward. You would need to dive deep into the data sheet to find what the maximum frame rate at 1080p is. It might be a bit higher than 30 fps, but it is almost certainly less than 45 fps.

Thanks, that clarifies what I wanted to know. So at least the same video quality as a Samsung Galaxy S3 should be assured, that's great! Just curious: Is there a hardcoded limit in the camera against trying to film at 60 FPS, or can you still try it but if the hardware can't handle the data flow you get laggy footage?

(05-28-2021, 05:32 PM)vortex Wrote: Megapixels is installed by default on many distros for the PinePhone. It is a GUI app. It is still pretty minimal, and can't take video last I checked. It can take pictures with both cameras on the PinePhone, and does the post processing to do color correction and that sort of thing. Note that such post processing is not done for the preview.

I see. So I need a separate app to film video then, other than the one used to take photos? What is a good one to install if so? GUI based obviously... even I'm not that nerdy to type a console command whenever I walk across something I want to take a film of Big Grin
As far as I know there is no app for taking videos on the Pinephone so far. The feature is on the to do list for Megapixels, but I have no idea how far away that is. I've read somewhere here of using a screen recorder (wf-recorder probably?) to capture the preview footage from Megapixels. It's an ugly workaround with bad image quality, but maybe the easiest way for now to record at least some kind of video if it actually works.
  Reply
#7
(05-31-2021, 02:09 AM)kqlnut Wrote: As far as I know there is no app for taking videos on the Pinephone so far. The feature is on the to do list for Megapixels, but I have no idea how far away that is. I've read somewhere here of using a screen recorder (wf-recorder probably?) to capture the preview footage from Megapixels. It's an ugly workaround with bad image quality, but maybe the easiest way for now to record at least some kind of video if it actually works.

That's scary to hear. Filming is a core component of every such device, if that doesn't work OOTB I literally can't use it as a main phone then. I'm still going to buy it given it's a software thing that can be patched up, but this is such a deal-breaker I may have to keep it in the closet and only play with it occasionally until it's fixed.

One option that seems viable in this scenario is creating a desktop shortcut with the film command, which starts capturing at my desired resolution once clicked. The problem then is how to tell the device to pause or stop filming, as without a GUI there's no way to do that in realtime! Unless there's an equivalent to sending the kill signal in bash (control + c on PC) which tells the recorder to stop the video without corrupting it? Or if the command allows for a timer, I could create a shortcut that says "film for 30 seconds then stop" and adjust my shooting to that length; This seems like the best I'm getting with the current limitations.

If anyone knows the answer, please explain the command I'd have to use in more detail so I can note it down. Thank you. I'm assuming it would be something in the following format: "ffmpeg -i /dev/back_camera -o /videos/${date}.mp4 -res 1920x1080 -fps 30 -time 45".
  Reply
#8
(05-31-2021, 07:53 AM)MirceaKitsune Wrote:
(05-31-2021, 02:09 AM)kqlnut Wrote: As far as I know there is no app for taking videos on the Pinephone so far. The feature is on the to do list for Megapixels, but I have no idea how far away that is. I've read somewhere here of using a screen recorder (wf-recorder probably?) to capture the preview footage from Megapixels. It's an ugly workaround with bad image quality, but maybe the easiest way for now to record at least some kind of video if it actually works.

That's scary to hear. Filming is a core component of every such device, if that doesn't work OOTB I literally can't use it as a main phone then. I'm still going to buy it given it's a software thing that can be patched up, but this is such a deal-breaker I may have to keep it in the closet and only play with it occasionally until it's fixed.

One option that seems viable in this scenario is creating a desktop shortcut with the film command, which starts capturing at my desired resolution once clicked. The problem then is how to tell the device to pause or stop filming, as without a GUI there's no way to do that in realtime! Unless there's an equivalent to sending the kill signal in bash (control + c on PC) which tells the recorder to stop the video without corrupting it? Or if the command allows for a timer, I could create a shortcut that says "film for 30 seconds then stop" and adjust my shooting to that length; This seems like the best I'm getting with the current limitations.

If anyone knows the answer, please explain the command I'd have to use in more detail so I can note it down. Thank you. I'm assuming it would be something in the following format: "ffmpeg -i /dev/back_camera -o /videos/${date}.mp4 -res 1920x1080 -fps 30 -time 45".
Nothing to be scared of : ) A lot of software for mobile Linux has yet to be developed and improved, but thanks to the community this is happening and everybody can be part of it.
You can script something together for sure, e. g. a simple bash script making use of wf-recorder (check out this page for more details that could be useful for you, maybe you could even have wf-recorder access the camera directly <- that doesn't seem to be possible) and tie this to a .desktop file to make it appear as an app. I would start by making the script start Megapixels, wait for some seconds for the preview to come up (since that takes a while), then start wf-recorder with the settings you want and the microphone as audio input (check the man page or documentation for specifics). In the beginning of the script have it check for a running process from wf-recorder (pgrep wf-recorder) and if that's the case, kill that process (and Megapixels if you want) and exit to stop the recording. That way the .desktop file/app entry will behave like a toggle to start and stop video recording. I haven't actually tried any of this, so you probably would have to do a little experimenting.

Edit: I just tried recording the Megapixels preview with wf-recorder ("alsa_input.platform-sound.HiFi__hw_PinePhone_0__source" as audio to have the mic input) and it worked. Of course you will have the rather bad raw preview image quality (no post processing applied as when taking pictures) and you have to choose between recording the full picture with GUI elements visible or cropping the picture to have a clean recording space. And the video was choppy, but that could also have to do with playback (I used mpv) or with the recording settings (I didn't set any parameters except mp4 as the video format).
  Reply
#9
Just noticed there's a Manjaro package for plasma-camera with the description "simple camera application for mobile devices". Any info on the features it supports? I'm assuming this is an image of it, from an article on the KDE website:

[Image: pp_camera.png]
  Reply
#10
(06-02-2021, 09:43 AM)MirceaKitsune Wrote: Just noticed there's a Manjaro package for plasma-camera with the description "simple camera application for mobile devices". Any info on the features it supports? I'm assuming this is an image of it, from an article on the KDE website:
I don't know that app and also I can't find it (just "Plasma Camera", but that doesn't look like the one you write about), but the image looks like an older version of the Megapixels app. I don't think this topic is a problem of no nice camera apps existing for Linux, but rather of making good use of the PinePhone's camera sensors and for that I believe Megapixels is where the most effort and progress is made. More specifics on how that works on the PinePhone can be found in the repo. Also check out this post for some basic video recording (no GUI though).
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  various tricks to open the pinephone shengchieh 2 517 03-23-2024, 09:27 AM
Last Post: Ferriah
  pinephone can provide more than 500mA to a usb-c displayport device? unrznbl 2 156 03-21-2024, 08:52 AM
Last Post: unrznbl
  my pinephone melted norayr 2 409 02-26-2024, 04:53 PM
Last Post: tllim
  pinephone keyboard + dock question tuxcall 7 2,420 02-05-2024, 03:17 PM
Last Post: wigan
  Unsatisfactory GPS reception on PinePhone? LinAdmin2 53 53,718 12-17-2023, 11:42 AM
Last Post: robin.com.au
  PinePhone Pro not booting (Cap error!, pctl timeout) jealda 2 1,198 11-16-2023, 05:03 AM
Last Post: DrYak
  Pinephone frame damages Uturn 2 780 10-23-2023, 02:49 AM
Last Post: Uturn
  PinePhone Keyboard KJ6OHG 11 7,596 08-23-2023, 03:25 AM
Last Post: Kali
  PinePhone constantly vibrating and won't take charge ImmyChan 5 5,194 07-23-2023, 03:49 PM
Last Post: kb-zealot
  Using optical drives with Pinephone cdforever 2 1,046 07-18-2023, 01:28 PM
Last Post: cdforever

Forum Jump:


Users browsing this thread: 1 Guest(s)