phone: Add script to record video

Note that we're using libopus and libx264 instead of flac and ffvhuff to
significantly reduce the file size and make it easier to play back the
recorded video on the PinePhone.

Note that there will be no preview while recording the video. The video
recording is also delayed a bit, so it's necessary to wait a few seconds
after you finish recording a video before pressing q to stop it.
This commit is contained in:
Donovan Glover 2024-08-16 15:06:00 -04:00
parent d38ef7b296
commit 6249d230ab
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -49,7 +49,30 @@ in
; ;
config = { config = {
programs.man.generateCaches = mkForce false; programs = {
fish.functions.video = # fish
''
${pkgs.v4l-utils}/bin/media-ctl -d1 --links '"gc2145 3-003c":0->1:0[0],"ov5640 3-004c":0->1:0[1]'
${pkgs.v4l-utils}/bin/media-ctl -d1 --set-v4l2 '"ov5640 3-004c":0[fmt:UYVY8_2X8/1280x720@1/30]'
ffmpeg \
-input_format yuv420p \
-s 1280x720 \
-f video4linux2 \
-thread_queue_size 4096 \
-i /dev/video1 \
-f pulse \
-thread_queue_size 256 \
-i alsa_input.platform-sound.Voice_Call__DigitalMic__source \
-c:a libopus \
-c:v libx264 \
-preset ultrafast \
-qp 23 \
"$(date -I)-$(uuidgen).mp4"
'';
man.generateCaches = mkForce false;
};
xdg = { xdg = {
desktopEntries = { desktopEntries = {