@sigmaott/base-next 1.4.41 → 1.4.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,7 +94,12 @@ function filterProgramsById(_programs) {
94
94
  }
95
95
  function getStream(type: string) {
96
96
  if (isTranscode.value || isEvent.value) {
97
- const newOptions = transcodeInput.value?.programs?.filter(program => program.type === type)?.length > 0 ? transcodeInput.value?.programs?.filter(program => program.type === type) : transcodeInput.value?.programs?.[0]?.filter(program => program.type === type)
97
+ const programs = Array.isArray(transcodeInput.value?.programs?.[0])
98
+ ? transcodeInput.value.programs[0]
99
+ : transcodeInput.value?.programs ?? []
100
+
101
+ const newOptions = programs.filter(program => program.type === type)
102
+
98
103
  return filterProgramsById(newOptions)
99
104
  }
100
105
  else if (isPackage.value) {
@@ -125,21 +130,17 @@ function handleChangeOutputPID(value: string) {
125
130
  </DevOnly>
126
131
  <div class="flex flex-wrap gap-2">
127
132
  <el-form-item label="Input PID" v-bind="inputPIdAttrs" class="w-586px">
128
- <el-select
129
- v-model="inputPIdValue" clearable :placeholder="t('SSConfig.enter_the_pid_placeholder')" filterable
130
- allow-create
131
- @change="handleChangeInputPID"
132
- >
133
- <el-option
134
- v-for="(preset, index) in getStream(mediaType)" :key="`${preset.id} + ${index}`"
135
- class="w-700px !h-auto" :value="preset.id" :label="preset.id"
136
- >
133
+ <el-select v-model="inputPIdValue" clearable :placeholder="t('SSConfig.enter_the_pid_placeholder')" filterable
134
+ allow-create @change="handleChangeInputPID">
135
+ <el-option v-for="(preset, index) in getStream(mediaType)" :key="`${preset.id} + ${index}`"
136
+ class="w-700px !h-auto" :value="preset.id" :label="preset.id">
137
137
  <SharedMediaInfoViewer :media="preset" />
138
138
  </el-option>
139
139
  </el-select>
140
140
  </el-form-item>
141
141
  <el-form-item label="Output PID" v-bind="outputPIdAttrs" class="w-586px">
142
- <el-input v-model="outputPIdValue" maxlength="50" :placeholder="t('SSConfig.enter_the_pid_placeholder')" @change="handleChangeOutputPID" />
142
+ <el-input v-model="outputPIdValue" maxlength="50" :placeholder="t('SSConfig.enter_the_pid_placeholder')"
143
+ @change="handleChangeOutputPID" />
143
144
  </el-form-item>
144
145
  </div>
145
146
  </template>
@@ -148,129 +148,130 @@ function activeTabChange(type: string) {
148
148
  activeMedia.value = `media-${dataData.value.length - 1}`
149
149
  }
150
150
 
151
- const encoderIdValue = ref(inject('encoderIdValue'))
151
+ // const encoderIdValue = ref(inject('encoderIdValue'))
152
+ const encoderTypeValue = ref(inject('encoderTypeValue'))
152
153
  function addEmptyPreset(type: 'video' | 'audio' | 'data') {
153
154
  const defaultPreset = {
154
155
  video: isPackage.value
155
156
  ? {
156
- name: 'video',
157
- type: 'video',
158
- videoCodec: 'copy',
159
- }
157
+ name: 'video',
158
+ type: 'video',
159
+ videoCodec: 'copy',
160
+ }
160
161
  : isConfigEncoder.value
161
162
  ? {
162
- type: 'video',
163
- name: '',
164
- videoCodec: 'h264',
165
- audioCodec: undefined,
166
- dataCodec: undefined,
167
- encoderType: defaultEncoderType.value ? defaultEncoderType.value : (encoderIdValue.value !== -1 && encoderIdValue.value !== null && encoderIdValue.value !== undefined && encoderIdValue.value !== '') ? 'nvenc' : 'open_h264',
168
- videoPreset: (encoderIdValue.value !== -1 && encoderIdValue.value !== 'cpu' && encoderIdValue.value !== null && encoderIdValue.value !== undefined && encoderIdValue.value !== '') ? 'llhp' : 'veryfast',
169
- option: undefined,
170
- description: undefined,
171
- videoBitrate: 4000000,
172
- minrate: undefined,
173
- maxrate: undefined,
174
- sampleRate: undefined,
175
- fps: 25,
176
- width: 1920,
177
- height: 1080,
178
- pixelFormat: undefined,
179
- bframe: undefined,
180
- scaleType: undefined,
181
- scanType: 'progressive',
182
- rateControlMode: 'vbr',
183
- rc: undefined,
184
- bufsize: undefined,
185
- cq: undefined,
186
- hdr: undefined,
187
- gopMode: 'auto',
188
- gopValue: undefined,
189
- fixedGOP: true,
190
- cbr: false,
191
- channel: undefined,
192
- videoProfile: undefined,
193
- videoLevel: undefined,
194
- volume: undefined,
195
- streamId: undefined,
196
- streamIndex: undefined,
197
- aspectRatioMode: 'auto',
198
- aspectRatioWidth: 16,
199
- aspectRatioHeight: 9,
200
- }
201
- : {
202
- type: 'video',
203
- name: '',
204
- videoCodec: 'h264',
205
- audioCodec: undefined,
206
- dataCodec: undefined,
207
- encoderType: undefined,
208
- videoPreset: undefined,
209
- option: undefined,
210
- description: undefined,
211
- videoBitrate: 4000000,
212
- minrate: undefined,
213
- maxrate: undefined,
214
- sampleRate: undefined,
215
- fps: 25,
216
- width: 1920,
217
- height: 1080,
218
- pixelFormat: undefined,
219
- bframe: undefined,
220
- scaleType: undefined,
221
- scanType: 'progressive',
222
- rateControlMode: 'vbr',
223
- rc: undefined,
224
- bufsize: undefined,
225
- cq: undefined,
226
- hdr: undefined,
227
- gopMode: 'auto',
228
- gopValue: undefined,
229
- fixedGOP: true,
230
- cbr: false,
231
- channel: undefined,
232
- videoProfile: undefined,
233
- videoLevel: undefined,
234
- volume: undefined,
235
- streamId: undefined,
236
- streamIndex: undefined,
237
- aspectRatioMode: 'auto',
238
- aspectRatioWidth: 16,
239
- aspectRatioHeight: 9,
240
- },
241
- audio: isPackage.value
242
- ? {
243
- name: 'audio',
244
- type: 'audio',
245
- audioCodec: 'copy',
163
+ type: 'video',
164
+ name: '',
165
+ videoCodec: 'h264',
166
+ audioCodec: undefined,
167
+ dataCodec: undefined,
168
+ encoderType: defaultEncoderType.value ? defaultEncoderType.value : (encoderTypeValue.value === 'SOFTWARE' ? 'open_h264' : encoderTypeValue.value === 'NETINT' ? 'netint' : 'nvenc'),
169
+ videoPreset: encoderTypeValue.value === 'SOFTWARE' ? 'veryfast' : encoderTypeValue.value === 'NETINT' ? 'medium' : 'llhp',
170
+ option: undefined,
171
+ description: undefined,
172
+ videoBitrate: 4000000,
173
+ minrate: undefined,
174
+ maxrate: undefined,
175
+ sampleRate: undefined,
176
+ fps: 25,
177
+ width: 1920,
178
+ height: 1080,
179
+ pixelFormat: undefined,
180
+ bframe: undefined,
181
+ scaleType: undefined,
182
+ scanType: 'progressive',
183
+ rateControlMode: 'vbr',
184
+ rc: undefined,
185
+ bufsize: undefined,
186
+ cq: undefined,
187
+ hdr: undefined,
188
+ gopMode: 'auto',
189
+ gopValue: undefined,
190
+ fixedGOP: true,
191
+ cbr: false,
192
+ channel: undefined,
193
+ videoProfile: undefined,
194
+ videoLevel: undefined,
195
+ volume: undefined,
196
+ streamId: undefined,
197
+ streamIndex: undefined,
198
+ aspectRatioMode: 'auto',
199
+ aspectRatioWidth: 16,
200
+ aspectRatioHeight: 9,
246
201
  }
247
- : {
248
- type: 'audio',
249
- name: undefined,
250
- videoCodec: undefined,
251
- audioCodec: 'aac',
202
+ : {
203
+ type: 'video',
204
+ name: '',
205
+ videoCodec: 'h264',
206
+ audioCodec: undefined,
252
207
  dataCodec: undefined,
253
- audioGroupId: undefined,
254
- audioDefault: undefined,
208
+ encoderType: undefined,
209
+ videoPreset: undefined,
255
210
  option: undefined,
256
211
  description: undefined,
257
- audioBitrate: 32000,
258
- sampleRate: 44100,
259
- fps: undefined,
260
- width: undefined,
261
- height: undefined,
212
+ videoBitrate: 4000000,
213
+ minrate: undefined,
214
+ maxrate: undefined,
215
+ sampleRate: undefined,
216
+ fps: 25,
217
+ width: 1920,
218
+ height: 1080,
262
219
  pixelFormat: undefined,
263
220
  bframe: undefined,
264
221
  scaleType: undefined,
222
+ scanType: 'progressive',
223
+ rateControlMode: 'vbr',
224
+ rc: undefined,
225
+ bufsize: undefined,
265
226
  cq: undefined,
266
- interlaced: false,
227
+ hdr: undefined,
228
+ gopMode: 'auto',
229
+ gopValue: undefined,
230
+ fixedGOP: true,
267
231
  cbr: false,
268
- channel: 2,
269
- audioProfile: undefined,
232
+ channel: undefined,
233
+ videoProfile: undefined,
234
+ videoLevel: undefined,
270
235
  volume: undefined,
271
236
  streamId: undefined,
272
237
  streamIndex: undefined,
238
+ aspectRatioMode: 'auto',
239
+ aspectRatioWidth: 16,
240
+ aspectRatioHeight: 9,
273
241
  },
242
+ audio: isPackage.value
243
+ ? {
244
+ name: 'audio',
245
+ type: 'audio',
246
+ audioCodec: 'copy',
247
+ }
248
+ : {
249
+ type: 'audio',
250
+ name: undefined,
251
+ videoCodec: undefined,
252
+ audioCodec: 'aac',
253
+ dataCodec: undefined,
254
+ audioGroupId: undefined,
255
+ audioDefault: undefined,
256
+ option: undefined,
257
+ description: undefined,
258
+ audioBitrate: 32000,
259
+ sampleRate: 44100,
260
+ fps: undefined,
261
+ width: undefined,
262
+ height: undefined,
263
+ pixelFormat: undefined,
264
+ bframe: undefined,
265
+ scaleType: undefined,
266
+ cq: undefined,
267
+ interlaced: false,
268
+ cbr: false,
269
+ channel: 2,
270
+ audioProfile: undefined,
271
+ volume: undefined,
272
+ streamId: undefined,
273
+ streamIndex: undefined,
274
+ },
274
275
  data: {
275
276
  type: 'data',
276
277
  name: '',
@@ -572,16 +573,8 @@ const isDataError = computed(() => {
572
573
  <template #label>
573
574
  <SSInformationLabel :label="$t('profile.name')" :info="schemaObj.name" />
574
575
  </template>
575
- <el-input
576
- v-model.trim="nameValue"
577
- autocomplete="off"
578
- :minlength="1"
579
- :maxlength="50"
580
- show-word-limit
581
- clearable
582
- :placeholder="$t('base_library.enter_profile_name')"
583
- @change="handleChangeName"
584
- />
576
+ <el-input v-model.trim="nameValue" autocomplete="off" :minlength="1" :maxlength="50" show-word-limit clearable
577
+ :placeholder="$t('base_library.enter_profile_name')" @change="handleChangeName" />
585
578
  </el-form-item>
586
579
  <slot name="information" />
587
580
  </slot>
@@ -660,58 +653,38 @@ const isDataError = computed(() => {
660
653
  </slot>
661
654
 
662
655
  <el-divider content-position="left" class="my-10px flex items-center [&_.el-divider\_\_text.is-left]:translate-y-0">
663
- <el-form-item v-bind="{ ...presetsAttrs, error: showErrorArray(presetsAttrs.error) }" class="w-200px !m-0 [&_.el-form-item\_\_content]:block">
656
+ <el-form-item v-bind="{ ...presetsAttrs, error: showErrorArray(presetsAttrs.error) }"
657
+ class="w-200px !m-0 [&_.el-form-item\_\_content]:block">
664
658
  <!-- {{ $t('library_profile.list_of_media') }} -->
665
659
  </el-form-item>
666
660
  </el-divider>
667
- <el-tabs
668
- v-model="activeTab"
669
- tab-position="left"
670
- class="demo-tabs [&_.el-tabs\_\_content]:p-10px"
671
- @tab-change="tabChange"
672
- >
661
+ <el-tabs v-model="activeTab" tab-position="left" class="demo-tabs [&_.el-tabs\_\_content]:p-10px"
662
+ @tab-change="tabChange">
673
663
  <el-tab-pane label="Video">
674
664
  <template #label>
675
665
  <div :class="isVideoError ? 'text-error' : ''">
676
666
  Video ({{ videoData.length }})
677
667
  </div>
678
668
  </template>
679
- <el-tabs
680
- v-show="videoData.length > 0"
681
- v-model="activeMedia"
682
- tab-position="top"
683
- type="border-card"
684
- closable
685
- @tab-remove="(name) => handleDestroyMedia(name, 'video')"
686
- >
687
- <el-tab-pane
688
- v-for="(media, _idx) in videoData"
689
- :key="`media-${_idx}`"
690
- :label="media.name"
691
- :name="`media-${_idx}`"
692
- lazy
693
- class=""
694
- >
669
+ <el-tabs v-show="videoData.length > 0" v-model="activeMedia" tab-position="top" type="border-card" closable
670
+ @tab-remove="(name) => handleDestroyMedia(name, 'video')">
671
+ <el-tab-pane v-for="(media, _idx) in videoData" :key="`media-${_idx}`" :label="media.name"
672
+ :name="`media-${_idx}`" lazy class="">
695
673
  <template #label>
696
- <span
697
- class="inline-flex items-center text-primary"
698
- :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${_idx}`]) || hasError(formErrors?.presets, [`${_idx}`]) ? '!text-error' : ''"
699
- >
674
+ <span class="inline-flex items-center text-primary"
675
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${_idx}`]) || hasError(formErrors?.presets, [`${_idx}`]) ? '!text-error' : ''">
700
676
  <el-icon>
701
677
  <div class="i-ep:video-camera-filled" />
702
678
  </el-icon>&nbsp;
703
- <span :title="media.name" class="block max-w-75px truncate" :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${_idx}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{ media.name }}</span>
679
+ <span :title="media.name" class="block max-w-75px truncate"
680
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${_idx}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{
681
+ media.name }}</span>
704
682
  </span>
705
683
  </template>
706
684
  <slot name="preset" :prop="getProp(`presets.[${findIndexById(media.id)}]`)()" :media-type="media.type" />
707
- <SSChannelPresetConfigItem
708
- :is-config-encoder="isConfigEncoder"
709
- :encoder-options="encoderOptions"
710
- :video-codecs="videoCodecs"
711
- :prop="getProp(`presets.[${findIndexById(media.id)}]`)()"
712
- :is-package="isPackage"
713
- :default-media-type="media.type"
714
- />
685
+ <SSChannelPresetConfigItem :is-config-encoder="isConfigEncoder" :encoder-options="encoderOptions"
686
+ :video-codecs="videoCodecs" :prop="getProp(`presets.[${findIndexById(media.id)}]`)()"
687
+ :is-package="isPackage" :default-media-type="media.type" />
715
688
  </el-tab-pane>
716
689
  </el-tabs>
717
690
  </el-tab-pane>
@@ -721,41 +694,25 @@ const isDataError = computed(() => {
721
694
  Audio ({{ audioData.length }})
722
695
  </div>
723
696
  </template>
724
- <el-tabs
725
- v-show="audioData.length > 0"
726
- v-model="activeMedia"
727
- tab-position="top"
728
- type="border-card"
729
- closable
730
- @tab-remove="(name) => handleDestroyMedia(name, 'audio')"
731
- >
732
- <el-tab-pane
733
- v-for="(media, _idx) in audioData"
734
- :key="`media-${_idx}`"
735
- :label="media.name"
736
- :name="`media-${_idx}`"
737
- lazy
738
- class=""
739
- >
697
+ <el-tabs v-show="audioData.length > 0" v-model="activeMedia" tab-position="top" type="border-card" closable
698
+ @tab-remove="(name) => handleDestroyMedia(name, 'audio')">
699
+ <el-tab-pane v-for="(media, _idx) in audioData" :key="`media-${_idx}`" :label="media.name"
700
+ :name="`media-${_idx}`" lazy class="">
740
701
  <template #label>
741
- <span
742
- class="inline-flex items-center text-warning"
743
- :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''"
744
- >
702
+ <span class="inline-flex items-center text-warning"
703
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">
745
704
  <el-icon>
746
705
  <div class="i-ep:headset" />
747
706
  </el-icon>&nbsp;
748
- <span :title="media.name" class="block max-w-75px truncate" :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{ media.name }}</span>
707
+ <span :title="media.name" class="block max-w-75px truncate"
708
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{
709
+ media.name }}</span>
749
710
  </span>
750
711
  </template>
751
712
  <slot name="preset" :prop="getProp(`presets.[${findIndexById(media.id)}]`)()" :media-type="media.type" />
752
- <SSChannelPresetConfigItem
753
- :is-config-encoder="isConfigEncoder"
754
- :video-codecs="videoCodecs"
755
- :prop="getProp(`presets.[${findIndexById(media.id)}]`)()"
756
- :is-package="isPackage"
757
- :default-media-type="media.type"
758
- />
713
+ <SSChannelPresetConfigItem :is-config-encoder="isConfigEncoder" :video-codecs="videoCodecs"
714
+ :prop="getProp(`presets.[${findIndexById(media.id)}]`)()" :is-package="isPackage"
715
+ :default-media-type="media.type" />
759
716
  </el-tab-pane>
760
717
  </el-tabs>
761
718
  </el-tab-pane>
@@ -765,65 +722,33 @@ const isDataError = computed(() => {
765
722
  Data ({{ dataData.length }})
766
723
  </div>
767
724
  </template>
768
- <el-tabs
769
- v-show="dataData.length > 0"
770
- v-model="activeMedia"
771
- tab-position="top"
772
- type="border-card"
773
- closable
774
- @tab-remove="(name) => handleDestroyMedia(name, 'data')"
775
- >
776
- <el-tab-pane
777
- v-for="(media, _idx) in dataData"
778
- :key="`media-${_idx}`"
779
- :label="media.name"
780
- :name="`media-${_idx}`"
781
- lazy
782
- class=""
783
- >
725
+ <el-tabs v-show="dataData.length > 0" v-model="activeMedia" tab-position="top" type="border-card" closable
726
+ @tab-remove="(name) => handleDestroyMedia(name, 'data')">
727
+ <el-tab-pane v-for="(media, _idx) in dataData" :key="`media-${_idx}`" :label="media.name"
728
+ :name="`media-${_idx}`" lazy class="">
784
729
  <template #label>
785
- <span
786
- class="inline-flex items-center"
787
- :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''"
788
- >
730
+ <span class="inline-flex items-center"
731
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">
789
732
  <el-icon class="data-icon border">
790
733
  <div class="i-ep:menu" />
791
734
  </el-icon>&nbsp;
792
- <span :title="media.name" class="block max-w-75px truncate" :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{ media.name }}</span>
735
+ <span :title="media.name" class="block max-w-75px truncate"
736
+ :class="hasError(formErrors?.profiles?.[idx]?.presets, [`${findIndexById(media.id)}`]) || hasError(formErrors?.presets, [`${findIndexById(media.id)}`]) ? '!text-error' : ''">{{
737
+ media.name }}</span>
793
738
  </span>
794
739
  </template>
795
740
  <slot name="preset" :prop="getProp(`presets.[${findIndexById(media.id)}]`)()" :media-type="media.type" />
796
- <SSChannelPresetConfigItem
797
- :is-config-encoder="isConfigEncoder"
798
- :video-codecs="videoCodecs"
799
- :prop="getProp(`presets.[${findIndexById(media.id)}]`)()"
800
- :is-package="isPackage"
801
- :default-media-type="media.type"
802
- :scte35
803
- />
741
+ <SSChannelPresetConfigItem :is-config-encoder="isConfigEncoder" :video-codecs="videoCodecs"
742
+ :prop="getProp(`presets.[${findIndexById(media.id)}]`)()" :is-package="isPackage"
743
+ :default-media-type="media.type" :scte35 />
804
744
  </el-tab-pane>
805
745
  </el-tabs>
806
746
  </el-tab-pane>
807
747
  </el-tabs>
808
748
 
809
- <el-dialog
810
- v-model="isShowMediaSelection"
811
- append-to-body
812
- width="85%"
813
- :title="mediaSelectionTitle"
814
- >
815
- <slot
816
- v-if="isMediaLive"
817
- name="mediaselection"
818
- :media-type="creatingMedia"
819
- :exclusion="['profiles']"
820
- :select-item="addMedia"
821
- />
822
- <MediaSelection
823
- v-else
824
- :media-type="creatingMedia"
825
- :exclusion="['profiles']"
826
- @select-item="addMedia"
827
- />
749
+ <el-dialog v-model="isShowMediaSelection" append-to-body width="85%" :title="mediaSelectionTitle">
750
+ <slot v-if="isMediaLive" name="mediaselection" :media-type="creatingMedia" :exclusion="['profiles']"
751
+ :select-item="addMedia" />
752
+ <MediaSelection v-else :media-type="creatingMedia" :exclusion="['profiles']" @select-item="addMedia" />
828
753
  </el-dialog>
829
754
  </template>