Skip to content

Commit

Permalink
vmpserverd: Add recordings key in profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Mar 10, 2024
1 parent e6a4670 commit e0d8430
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
36 changes: 36 additions & 0 deletions Daemons/vmpserverd/profiles/com.hugomelder.software.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
<key>mountpoints</key>
<dict>
<key>single</key>
<!--
intervideo{src,sink} is a mechanism to share buffers and events across independent
pipelines. We connect to the channel {VIDEOCHANNEL.0} and do the postprocessing
and h264 encoding on CPU (using libx264). The resulting h264 stream is then fed
into the rtp payloader.
-->
<string>intervideosrc channel={VIDEOCHANNEL.0} ! queue ! videoconvert ! x264enc bitrate=2500 !
rtph264pay name=pay0 pt=96</string>
<key>combined</key>
Expand All @@ -70,5 +76,35 @@
<key>audioTest</key>
<string>audiotestsrc ! voaacenc bitrate=96000 ! queue ! rtpmp4apay name=pay1 pt=97</string>
</dict>

<!--
Configuration for video and audio recording. Partial (pipelines)
are used to describe device-dependent encoding and are pieced
together in a VMPRecordingManager.
-->
<key>recordings</key>
<dict>
<!--
Convert, Scale, and Encode a video channel feed into h264.
Variables:
- {VIDEOCHANNEL}: The video channel
- {WIDTH}: Width after scaling
- {HEIGHT}: Height after scaling
- {BITRATE}: h264 encoding bitrate in kbps
-->
<key>video</key>
<string>intervideosrc channel={VIDEOCHANNEL} ! queue !
videoconvertscale add-borders=1 ! video/x-raw, width={WIDTH}, height={HEIGHT} ! x264enc bitrate={BITRATE}</string>
<!--
Open a pulseaudio source and encode it as AAC LC.
Variables:
- {PULSEDEV}: PulseAudio Device (See `audioProviders` for detailed information)
- {BITRATE}: AAC Audio Bitrate (bits per second)
-->
<key>pulseAudio</key>
<string>pulsesrc device={PULSEDEV} ! voaacenc bitrate={BITRATE}</string>
</dict>
</dict>
</plist>
30 changes: 30 additions & 0 deletions Daemons/vmpserverd/profiles/com.hugomelder.vaapi.plist
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,35 @@
<key>audioTest</key>
<string>audiotestsrc ! voaacenc bitrate=96000 ! queue ! rtpmp4apay name=pay1 pt=97</string>
</dict>

<!--
Configuration for video and audio recording. Partial (pipelines)
are used to describe device-dependent encoding and are pieced
together in a VMPRecordingManager.
-->
<key>recordings</key>
<dict>
<!--
Convert, Scale, and Encode a video channel feed into h264 utilising the GPU.
Variables:
- {VIDEOCHANNEL}: The video channel
- {WIDTH}: Width after scaling
- {HEIGHT}: Height after scaling
- {BITRATE}: h264 encoding bitrate in kbps
-->
<key>video</key>
<string>intervideosrc channel={VIDEOCHANNEL} ! queue !
vapostproc add-borders=1 ! video/x-raw(memory:VAMemory), width={WIDTH}, height={HEIGHT} ! vah264enc bitrate={BITRATE}</string>
<!--
Open a pulseaudio source and encode it as AAC LC.
Variables:
- {PULSEDEV}: PulseAudio Device (See `audioProviders` for detailed information)
- {BITRATE}: AAC Audio Bitrate (bits per second)
-->
<key>pulseAudio</key>
<string>pulsesrc device={PULSEDEV} ! voaacenc bitrate={BITRATE}</string>
</dict>
</dict>
</plist>
3 changes: 3 additions & 0 deletions Daemons/vmpserverd/src/models/VMPProfileModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ extern NSString *const VMPProfilePlatformVAAPI;
Currently, the following platforms are supported:
- "all" - Most generic profile. Matches with all platforms.
- "deepstream-6" - Platform supporting Nvidia Deepstream
- "vaapi" - Platform with vaapi support
Nvidia Deepstream is a multimedia framework that supplies
GStreamer elements making use of Nvidia technologies,
Expand All @@ -67,6 +68,8 @@ extern NSString *const VMPProfilePlatformVAAPI;

@property (nonatomic, strong) NSDictionary<NSString *, NSString *> *channels;

@property (nonatomic, strong) NSDictionary<NSString *, NSString *> *recordings;

/**
@brief Load a profile from a propertyList representation.
Expand Down
5 changes: 4 additions & 1 deletion Daemons/vmpserverd/src/models/VMPProfileModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ - (id)initWithPropertyList:(id)propertyList error:(NSError **)error {
SET_PROPERTY(_mountpoints, @"mountpoints");
SET_PROPERTY(_audioProviders, @"audioProviders");
SET_PROPERTY(_channels, @"channels");
SET_PROPERTY(_recordings, @"recordings");
}

return self;
Expand All @@ -44,6 +45,7 @@ - (id)propertyList {
VMP_ASSERT(_mountpoints, @"mountpoints is nil");
VMP_ASSERT(_audioProviders, @"audioProviders is nil");
VMP_ASSERT(_channels, @"channels is nil");
VMP_ASSERT(_recordings, @"recordings is nil");

return @{
@"name" : _name,
Expand All @@ -53,7 +55,8 @@ - (id)propertyList {
@"supportedPlatforms" : _supportedPlatforms,
@"mountpoints" : _mountpoints,
@"audioProviders" : _audioProviders,
@"channels" : _channels
@"channels" : _channels,
@"recordings" : _recordings
};
}

Expand Down

0 comments on commit e0d8430

Please sign in to comment.