bytes_as_timedelta
Converts a byte string representing a duration into a Python timedelta object.
def bytes_as_timedelta(
byte_count: int,
bitrate_kbps: int = 128
) - > timedelta
Converts a byte count into a timedelta object representing the estimated transfer duration at a fixed bitrate.
Parameters
| Name | Type | Description |
|---|---|---|
| byte_count | int | The total number of bytes to be processed or transferred. |
| bitrate_kbps | int = 128 | The transfer speed in kilobits per second used to calculate the duration. |
Returns
| Type | Description |
|---|---|
timedelta | A timedelta object representing the calculated duration based on the input size and bitrate. |