![]() |
How can I record video on a Pinephone? - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120) +--- Forum: General Discussion on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=127) +--- Thread: How can I record video on a Pinephone? (/showthread.php?tid=16539) Pages:
1
2
|
How can I record video on a Pinephone? - kk22 - 04-22-2022 I'd like to be able to take a short maybe 10 second video using the Pinephone's camera. There seem to have been a few individuals who figured out how to do this, but they used very different methods and none of them seem to be currently functional: Reddit post by UJC_theguy, who was able to use ffmpeg to record a video. Trying his method (with /dev/video2 since that's what my camera shows up as), I get the following: Code: [video4linux2,v4l2 @ 0xffff9790b670] ioctl(VIDIOC_STREAMON): Broken pipe Reddit post by Atticus83, who used gstreamer instead of ffmpeg. Trying his method the _jprocess script fails with Code: WARNING: erroneous pipeline: no element "x264enc" Python script from Martijn Braam, which uses ffmpeg to do the recording. Modified to use /dev/video2, it gives the following: Code: libavutil 56. 70.100 / 56. 70.100 So how can I record video if these don't work? Edit: Atticus83's method actually does work, but the "ugly" gstreamer plugins are needed. When I wrote this post I thought I had already installed them, but upon trying to install all of the gst-plugins-* packages in pmOS, gst-plugins-ugly got installed and now it works. If anyone knows of a better method though, please post it here. RE: How can I record video on a Pinephone? - kks - 01-19-2023 Hey KK22, Did you manage to find a solution using ffmpeg? I'm stuck on the same issue when testing with Martijn Braam's python script. I also realized that I have to use /dev/video2, but always running into the broken pipe error. Kang Sheng RE: How can I record video on a Pinephone? - Kevin Kofler - 01-19-2023 Try my scripts maybe? At least they worked last time I tried them, with the limitations documented in this thread on the Manjaro forum. And it might be that something needs tweaking, e.g., if the input were renamed yet again or something. RE: How can I record video on a Pinephone? - kks - 01-20-2023 Thanks Kevin. I tweaked some of the numbers in your script and it worked perfectly! Thanks you for saving me so many potential hours of pulling at my hair. Looking at what you have and my non-working script, what I can tell is different is the options used when calling media-ctl and ffmpeg. I'll have to study those options more carefully. First time using media-ctl and ffmpeg! For anybody who wants a script that is working for the latest pinephone (at this time of writing), you can find it here: https://gist.github.com/TayKangSheng/a0f9a7edd2d298c3504392d7426f936a RE: How can I record video on a Pinephone? - Kevin Kofler - 01-20-2023 Thanks for sharing your edited version! So I see you changed 3 to 4 in two (apparently unrelated) places: the IIO device for the accelerometer, and the camera devices. I will check whether I also need these changes on my PinePhone now and update the script in my SVN in that case. As for the media-ctl and ffmpeg options, those are basically based on other scripts I found. I can explain what the commands do:
RE: How can I record video on a Pinephone? - Zebulon Walton - 01-21-2023 Interesting! Looks like it needs more tweaking to work on Mobian though. I did find that device references needed to be changed to from "device4" to "device1". (The devices 0, 1, and 2 exist. Only #1 had the required entries.) Code: CUR_X=$(cat /sys/bus/iio/devices/iio\:device4/in_accel_x_raw) However, when running the script after making those changes, the first invocation of media-ctl barfs up on an invalid arg. I'm not familiar enough with that program to know what it's complaining about. Here's the output including an echo of the command line that fails (I believe I got the single and double quotes to echo correctly): Code: [mobian@mobian bin]$ ./record.sh test RE: How can I record video on a Pinephone? - Kevin Kofler - 01-21-2023 (01-21-2023, 02:16 PM)Zebulon Walton Wrote: I did find that device references needed to be changed to from "device4" to "device1". (The devices 0, 1, and 2 exist. Only #1 had the required entries.)Looks like the device number depends from phone to phone, depending possible on the distro, the kernel version, and/or the hardware revision. My PinePhone now has the accelerometer on device2. Used to be device3, which does not even exist now. I guess we should just use a wildcard, as in: Code: CUR_X=$(cat /sys/bus/iio/devices/iio\:device*/in_accel_x_raw) Quote:I guess the camera names are wrong. Try using 3-003c and 3-004c instead of 4-003c and 4-004c. For me, the ones with 3- are the correct ones, both back when I wrote the script and now. It looks like those names also depend on the hardware or distro, which is a problem, because the numeric IDs (5 and 7 in my case) are not stable either (e.g., I had them swapped at some point). Or print the topology with Code: media-ctl -d1 -p RE: How can I record video on a Pinephone? - Zebulon Walton - 01-21-2023 Thanks, I'll play around with it a bit when I have time. Not that making videos is a partiularly high priority but it would be interesting to see it work. RE: How can I record video on a Pinephone? - linmob - 01-22-2023 Great to see this thread, I blogged about video recording on PinePhone a while ago, kept tinkering (I switched to VP8 encoding, as that's a lot faster), but then did not do any further experiments. Now (after upgrading to postmarketOS 22.12) my changes are no longer enough to get video recording working. This may motivate me to play with video recording again ![]() One avenue worth exploring is tinkering with Millipixels, Purism's Megapixels fork for the Librem 5. They have video recording working in the latest builds from CI (meaning, it's not in a release yet, but the code is merged). As libcamera support is up-and-coming for the PinePhone camera (see Adam Piggs work on a camera app for Sailfish OS), this might be the fastest route to proper PinePhone video recording with a GUI app. Also, I really look forward to this FOSDEM talk. RE: How can I record video on a Pinephone? - baptx - 07-04-2024 Is there any video recording solution still working for you on the PinePhone (except using screen recording)? I did not get any script working on an updated Mobian system with Phosh (Mobian edition convergence package): https://gitlab.com/Alaraajavamma/fastvideo/-/issues/7 |