How can I record video on a Pinephone?
#5
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:
  • The first media-ctl command disables the selfie camera (gc2145) and enables the main/back camera (ov5640). There are two connections there, from "camera name":0 to 1:0, the latter is the multiplexed output. (Instead of the camera name with quotes, you can also use a number, but I have found that to change more often than the name does, so I changed it back to a name when I wrote the script. If it is in a script, I do not have to type it all the time anyway, so using the long form does not hurt.) The first is set to [0] = disabled, the second to [1] = enabled.
  • The second media-ctl command sets the output format (fmt:…) of the camera to something FFmpeg can process. The camera supports a few formats, there is a list somewhere. In any case, UYVY8_2X8 matches what FFmpeg's yuv420p can process, 1280x720 is the resolution, 1/30 means 30 fps.
  • The first FFmpeg command sets the video and audio "file formats" (to video4linux2 and pulse, respectively, which are not really file formats) and devices (to a kernel device file for video4linux2 and to a PulseAudio device name for pulse), the input format and resolution to match the above, the thread queue sizes to something that works well with the inputs (I do not remember exactly where those numbers came from), and the output codecs to lossless codecs that can be encoded at real time (which is the main trick in the script, because encoding directly to VP9 is too slow to work in real time).
  • The second FFmpeg command reencodes the above lossless file to VP9 video and Opus audio in a WebM container, also applying the video filters for rotation ($VF) autodetected by the first part of the script.
  Reply


Messages In This Thread
How can I record video on a Pinephone? - by kk22 - 04-22-2022, 07:01 PM
RE: How can I record video on a Pinephone? - by Kevin Kofler - 01-20-2023, 11:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinephone won't boot. spha 13 3,638 05-15-2024, 10:31 PM
Last Post: Richy_T
  Pinephone boot. Richy_T 5 461 05-15-2024, 03:35 PM
Last Post: Richy_T
  eSIM on PinePhone just_a_q 4 2,998 05-14-2024, 01:35 PM
Last Post: Kevin Kofler
  PinePhone - boot from microSD laserpyramid 9 1,305 05-03-2024, 10:09 AM
Last Post: laserpyramid
  pinephone virtual keyboard aular 4 651 04-10-2024, 03:45 PM
Last Post: aular
  PinePhone Doesn't Boot LED Doesn't Show Any Signs When Charging dorkydev 1 451 04-02-2024, 11:50 AM
Last Post: Kevin Kofler
  Are you using the Pinephone as your daily driver? jro 157 115,457 02-18-2024, 11:33 PM
Last Post: aular
  2020 PinePhone Manjaro CE EU for sale, name your price astrojuanlu 7 2,266 02-14-2024, 04:51 PM
Last Post: astrojuanlu
  pinephone is not bootble for the box. ijij 1 844 01-19-2024, 01:29 PM
Last Post: fxc
  Multiple issues with the Pinephone MTXP 12 3,050 12-28-2023, 07:55 AM
Last Post: MTXP

Forum Jump:


Users browsing this thread: 2 Guest(s)