Tweak: add ability to disable audio recording
All checks were successful
PostmarketOS Build / Prepare (push) Successful in 5s
PostmarketOS Build / Build for aarch64 (push) Successful in 1m29s
PostmarketOS Build / Build for x86_64 (push) Successful in 1m2s

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-06-18 17:11:56 +03:00
parent fac77631c0
commit b3decb8cc5
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 6 additions and 3 deletions

View file

@ -10,7 +10,8 @@ Mostly made for PostmarketOS phones
- `DOWNSCALE_VIDEO` = `640` - Int, maximum image dimension in video mode (0 to disable downscale)
- `DOWNSCALE_PHOTO` = `0` - Int, maximum image dimension in photo mode (0 to disable downscale)
- `VIDEO_ENCODE` = `x264enc tune=zerolatency speed-preset=ultrafast bitrate=8192` - String, video encode pipeline
- `AUDIO_ENABLED` = `true` - Bool, is audio record enabled (`false` to disable)
- `AUDIO_PROFILE` = `audio/x-ac3` - String - audio encoding
## Project TODO:
- [ ] Fix cam/mode switching? (I can't reproduce errors)
- [ ] Simplify customization

View file

@ -141,9 +141,11 @@ public class EyeNeko.Gstreamer : Object {
private void add_enc_profile () {
var cp = new Gst.PbUtils.EncodingContainerProfile (null, null, Gst.Caps.from_string ("video/quicktime"), null);
var vp = new Gst.PbUtils.EncodingVideoProfile (Gst.Caps.from_string ("video/x-h264"), null, null, 0);
var ap = new Gst.PbUtils.EncodingAudioProfile (Gst.Caps.from_string ("audio/x-ac3"), null, null, 0);
if (bool.parse (Env.get_variable_or ("AUDIO_ENABLED", "true"))) {
var ap = new Gst.PbUtils.EncodingAudioProfile (Gst.Caps.from_string (Env.get_variable_or ("AUDIO_PROFILE", "audio/x-ac3")), null, null, 0);
cp.add_profile (ap);
}
cp.add_profile (vp);
cp.add_profile (ap);
camerabin.set_property ("video-profile", cp);
}