调整录播实时速度的单位

This commit is contained in:
Genteure 2019-11-24 09:08:29 +08:00
parent f0c10f89e0
commit 724d87c4ac
4 changed files with 14 additions and 11 deletions

View File

@ -17,7 +17,7 @@ namespace BililiveRecorder.Core
bool IsRecording { get; }
double DownloadSpeedPersentage { get; }
double DownloadSpeedKiBps { get; }
double DownloadSpeedMegaBitps { get; }
DateTime LastUpdateDateTime { get; }
void Clip();

View File

@ -82,7 +82,7 @@ namespace BililiveRecorder.Core
public CancellationTokenSource cancellationTokenSource = null;
private double _DownloadSpeedPersentage = 0;
private double _DownloadSpeedKiBps = 0;
private double _DownloadSpeedMegaBitps = 0;
private long _lastUpdateSize = 0;
private int _lastUpdateTimestamp = 0;
public DateTime LastUpdateDateTime { get; private set; } = DateTime.Now;
@ -91,10 +91,10 @@ namespace BililiveRecorder.Core
get { return _DownloadSpeedPersentage; }
private set { if (value != _DownloadSpeedPersentage) { _DownloadSpeedPersentage = value; TriggerPropertyChanged(nameof(DownloadSpeedPersentage)); } }
}
public double DownloadSpeedKiBps
public double DownloadSpeedMegaBitps
{
get { return _DownloadSpeedKiBps; }
private set { if (value != _DownloadSpeedKiBps) { _DownloadSpeedKiBps = value; TriggerPropertyChanged(nameof(DownloadSpeedKiBps)); } }
get { return _DownloadSpeedMegaBitps; }
private set { if (value != _DownloadSpeedMegaBitps) { _DownloadSpeedMegaBitps = value; TriggerPropertyChanged(nameof(DownloadSpeedMegaBitps)); } }
}
public RecordedRoom(ConfigV1 config,
@ -383,7 +383,7 @@ namespace BililiveRecorder.Core
_response = null;
_lastUpdateTimestamp = 0;
DownloadSpeedKiBps = 0d;
DownloadSpeedMegaBitps = 0d;
DownloadSpeedPersentage = 0d;
TriggerPropertyChanged(nameof(IsRecording));
}
@ -394,7 +394,7 @@ namespace BililiveRecorder.Core
_lastUpdateSize += bytesRead;
if (passedSeconds > 1.5)
{
DownloadSpeedKiBps = _lastUpdateSize / passedSeconds / 1024; // KiB per sec
DownloadSpeedMegaBitps = _lastUpdateSize / passedSeconds * 8d / 1_000_000d; // mega bit per second
DownloadSpeedPersentage = (DownloadSpeedPersentage / 2) + ((Processor.TotalMaxTimestamp - _lastUpdateTimestamp) / passedSeconds / 1000 / 2); // ((RecordedTime/1000) / RealTime)%
_lastUpdateTimestamp = Processor.TotalMaxTimestamp;
_lastUpdateSize = 0;

View File

@ -95,7 +95,7 @@
<DataGridTextColumn Binding="{Binding StreamerName,Mode=OneWay}" Header="主播名字"/>
<DataGridTextColumn Binding="{Binding IsRecording,Converter={StaticResource RecordStatusConverter},Mode=OneWay}" Header="录制状态"/>
<DataGridTextColumn Binding="{Binding IsMonitoring,Converter={StaticResource MonitorStatusConverter},Mode=OneWay}" Header="是否自动录制"/>
<DataGridTextColumn Binding="{Binding DownloadSpeedKiBps,StringFormat=0.## KiB/s,Mode=OneWay}" Header="录制下载速度"/>
<DataGridTextColumn Binding="{Binding DownloadSpeedMegaBitps,StringFormat=0.## Mbps,Mode=OneWay}" Header="实时下载速度"/>
<DataGridTextColumn Binding="{Binding DownloadSpeedPersentage,StringFormat=0.## %,Mode=OneWay}" Header="录制速度比"/>
<DataGridTextColumn Binding="{Binding Processor.Clips.Count,Mode=OneWay}" Header="剪辑数量"/>
</DataGrid.Columns>
@ -156,8 +156,8 @@
<TextBlock Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">处理中剪辑数量:</TextBlock>
<TextBlock Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding Processor.Clips.Count,Mode=OneWay}"/>
<TextBlock Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">录制下载速度:</TextBlock>
<TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding DownloadSpeedKiBps,StringFormat=0.## KiB/s,Mode=OneWay}"/>
<TextBlock Grid.Row="6" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">实时下载速度:</TextBlock>
<TextBlock Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding DownloadSpeedMegaBitps,StringFormat=0.## Mbps,Mode=OneWay}"/>
<TextBlock Grid.Row="7" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">录制速度比:</TextBlock>
<TextBlock Grid.Row="7" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding DownloadSpeedPersentage,StringFormat=0.## %,Mode=OneWay}"/>

View File

@ -39,7 +39,10 @@ namespace BililiveRecorder.WPF
"问题反馈邮箱: rec@danmuji.org",
"QQ群 689636812",
"",
"功能调整:删除直播间按钮调整了位置,从软件界面右侧移动到了列表右键菜单"
"删除直播间按钮在列表右键菜单里",
"",
"录制速度比 在 100% 左右说明跟上了主播直播的速度",
"小于 100% 说明录播电脑的下载带宽不够,跟不上录制直播"
};
public static void AddLog(string message) => _AddLog?.Invoke(message);