Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
withsalt committed Oct 11, 2024
1 parent 18370b2 commit 2ef49c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 42 deletions.
2 changes: 2 additions & 0 deletions src/BilibiliAutoLiver/Models/Dtos/VideoDeviceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ public class Characteristics
public int Height { get; set; }

public PixelFormats Format { get; set; }

public int Frame { get; set; }
}
}
15 changes: 9 additions & 6 deletions src/BilibiliAutoLiver/Services/FFMpeg/Services/FFMpegService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,15 @@ public Task<List<VideoDeviceInfo>> GetVideoDevices()
Name = item.Name,
Identity = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? item.Name : (item.Identity != null ? item.Identity.ToString() : item.Name),
DeviceType = item.DeviceType,
Characteristics = item.Characteristics.Select(p => new Characteristics()
{
Width = p.Width,
Height = p.Height,
Format = p.PixelFormat,
}).ToList()
Characteristics = item.Characteristics
.Where(p => p.FramesPerSecond.Denominator != 0)
.Select(p => new Characteristics()
{
Width = p.Width,
Height = p.Height,
Format = p.PixelFormat,
Frame = p.FramesPerSecond.Denominator == 0 ? 0 : p.FramesPerSecond.Numerator / p.FramesPerSecond.Denominator,
}).ToList()
};
result.Add(deviceInfo);
}
Expand Down
36 changes: 0 additions & 36 deletions src/BilibiliAutoLiver/Views/Push/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,6 @@
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">输入帧速<label style="color:red">*</label></label>
<div class="layui-input-inline">
<select id="inputFramerateType3" name="inputFramerateType3" lay-verify="required">
<option value="">请选择</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="120">120</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">推流音频(来自设备)</label>
<div class="layui-input-inline">
Expand Down Expand Up @@ -278,21 +263,6 @@
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">输入帧速<label style="color:red">*</label></label>
<div class="layui-input-inline">
<select id="inputFramerateType4" name="inputFramerateType4" lay-verify="required">
<option value="">请选择</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="120">120</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">推流音频(来自设备)</label>
<div class="layui-input-inline">
Expand Down Expand Up @@ -533,10 +503,8 @@
let audioDevice = "@Html.Raw(Model.PushSetting.AudioDevice)";
let audioId = "@Html.Raw(Model.PushSetting.AudioId)";
let inputResolution = "@Model.PushSetting.InputResolution";
let inputFramerate = "@Model.PushSetting.InputFramerate";
$("#videoDeviceNameType3").val(deviceName);
$("#inputResolutionType3").val(inputResolution);
$("#inputFramerateType3").val(inputFramerate);
let isFromFile = "@((Model.PushSetting.InputAudioSource == InputAudioSource.File).ToString().ToLower())";
if (isFromFile == "true") {
Expand All @@ -557,11 +525,9 @@
let audioDevice = "@Html.Raw(Model.PushSetting.AudioDevice)";
let audioId = "@Html.Raw(Model.PushSetting.AudioId)";
let inputResolution = "@Model.PushSetting.InputResolution";
let inputFramerate = "@Model.PushSetting.InputFramerate";
let plugins = "@Html.Raw(Model.PushSetting.Plugins)";
$("#videoDeviceNameType4").val(deviceName);
$("#inputResolutionType4").val(inputResolution);
$("#inputFramerateType4").val(inputFramerate);
let isFromFile = "@((Model.PushSetting.InputAudioSource == InputAudioSource.File).ToString().ToLower())";
if (isFromFile == "true") {
Expand Down Expand Up @@ -806,7 +772,6 @@
obj = Object.assign({}, inputTypeParams, baseOutputParams, advanceOutputParams, inputType3Params);
obj.inputDeviceName = obj.videoDeviceNameType3;
obj.inputDeviceResolution = obj.inputResolutionType3;
obj.inputDeviceFramerate = obj.inputFramerateType3;
obj.inputDeviceAudioDeviceName = obj.audioDeviceNameType3;
obj.inputDeviceAudioFrom = obj.audioDeviceNameType3From == "on" ? true : false;
obj.inputDeviceAudioId = safeParseInt(obj.audioDeviceIdType3);
Expand All @@ -816,7 +781,6 @@
obj = Object.assign({}, inputTypeParams, baseOutputParams, advanceOutputParams, inputType4Params);
obj.inputDeviceName = obj.videoDeviceNameType4;
obj.inputDeviceResolution = obj.inputResolutionType4;
obj.inputDeviceFramerate = obj.inputFramerateType4;
obj.inputDeviceAudioDeviceName = obj.audioDeviceNameType4;
obj.inputDevicePlugins = obj.pluginType4;
obj.inputDeviceAudioFrom = obj.audioDeviceNameType4From == "on" ? true : false;
Expand Down

0 comments on commit 2ef49c0

Please sign in to comment.