Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stream.dash: improve segment logging#5235

Merged
gravyboat merged 2 commits into
streamlink:masterfrom
bastimeyer:stream/dash/improve-segment-logging
Mar 11, 2023
Merged

stream.dash: improve segment logging#5235
gravyboat merged 2 commits into
streamlink:masterfrom
bastimeyer:stream/dash/improve-segment-logging

Conversation

@bastimeyer

Copy link
Copy Markdown
Member

Description/motivation in each commit message...

Example debug log:

[stream.dash][debug] Opening DASH reader for: ('1', 'video', '1') - video/mp4
[stream.dash][debug] Opening DASH reader for: ('1', 'audio', '1') - audio/mp4
[stream.dash][debug] video/mp4 segment initialization: downloading (2023-03-10T22:36:52.000000Z / 2023-03-10T23:40:42.016551Z)
[stream.dash_manifest][debug] Generating segment numbers for dynamic playlist: ('1', 'video', '1')
[stream.dash_manifest][debug] Stream start: 2023-03-10 22:36:52+00:00
[stream.dash_manifest][debug] Current time: 2023-03-10 23:40:42.016825+00:00
[stream.dash_manifest][debug] Availability: 2023-03-10 23:40:36+00:00
[stream.dash_manifest][debug] presentationTimeOffset: 0:00:00; suggestedPresentationDelay: 0:00:03; minBufferTime: 0:00:03
[stream.dash_manifest][debug] segmentDuration: 2.0; segmentStart: 1; segmentOffset: 1912 (3824.016825s)
[stream.dash][debug] audio/mp4 segment initialization: downloading (2023-03-10T22:36:52.000000Z / 2023-03-10T23:40:42.018970Z)
[stream.dash_manifest][debug] Generating segment numbers for dynamic playlist: ('1', 'audio', '1')
[stream.dash_manifest][debug] Stream start: 2023-03-10 22:36:52+00:00
[stream.dash_manifest][debug] Current time: 2023-03-10 23:40:42.019963+00:00
[stream.dash_manifest][debug] Availability: 2023-03-10 23:40:36+00:00
[stream.dash_manifest][debug] presentationTimeOffset: 0:00:00; suggestedPresentationDelay: 0:00:03; minBufferTime: 0:00:03
[stream.dash_manifest][debug] segmentDuration: 2.0; segmentStart: 1; segmentOffset: 1912 (3824.019963s)
[utils.named_pipe][info] Creating pipe streamlinkpipe-1733433-1-9218
[utils.named_pipe][info] Creating pipe streamlinkpipe-1733433-2-1030
[stream.ffmpegmux][debug] ffmpeg command: /usr/bin/ffmpeg -nostats -y -i /tmp/streamlinkpipe-1733433-1-9218 -i /tmp/streamlinkpipe-1733433-2-1030 -c:v copy -c:a copy -copyts -f matroska pipe:1
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-1733433-1-9218
[stream.ffmpegmux][debug] Starting copy to pipe: /tmp/streamlinkpipe-1733433-2-1030
[cli][debug] Pre-buffering 8192 bytes
[stream.dash][debug] video/mp4 segment 1913: downloading (2023-03-10T23:40:36.000000Z / 2023-03-10T23:40:42.063858Z)
[stream.dash][debug] video/mp4 segment initialization: completed
[stream.dash][debug] audio/mp4 segment 1913: downloading (2023-03-10T23:40:36.000000Z / 2023-03-10T23:40:42.158615Z)
[stream.dash][debug] audio/mp4 segment initialization: completed
[stream.dash][debug] audio/mp4 segment 1914: downloading (2023-03-10T23:40:38.000000Z / 2023-03-10T23:40:42.203492Z)
[stream.dash][debug] audio/mp4 segment 1913: completed
[stream.dash][debug] video/mp4 segment 1914: downloading (2023-03-10T23:40:38.000000Z / 2023-03-10T23:40:42.218814Z)
[stream.dash][debug] video/mp4 segment 1913: completed
[stream.dash][debug] audio/mp4 segment 1915: downloading (2023-03-10T23:40:40.000000Z / 2023-03-10T23:40:42.226725Z)
[stream.dash][debug] audio/mp4 segment 1914: completed
[stream.dash][debug] audio/mp4 segment 1916: downloading (2023-03-10T23:40:42.000000Z / 2023-03-10T23:40:42.249759Z)
[stream.dash][debug] audio/mp4 segment 1915: completed
[stream.dash][debug] video/mp4 segment 1915: downloading (2023-03-10T23:40:40.000000Z / 2023-03-10T23:40:42.269656Z)
[stream.dash][debug] video/mp4 segment 1914: completed
[stream.dash][debug] audio/mp4 segment 1917: waiting 1.7s (2023-03-10T23:40:44.000000Z / 2023-03-10T23:40:42.290647Z)
[stream.dash][debug] audio/mp4 segment 1916: completed
[cli.output][debug] Opening subprocess: mpv ...
[stream.dash][debug] video/mp4 segment 1916: downloading (2023-03-10T23:40:42.000000Z / 2023-03-10T23:40:42.304590Z)
[stream.dash][debug] video/mp4 segment 1915: completed
[stream.dash][debug] video/mp4 segment 1917: waiting 1.6s (2023-03-10T23:40:44.000000Z / 2023-03-10T23:40:42.403012Z)
[stream.dash][debug] video/mp4 segment 1916: completed
[cli][debug] Writing stream to output
[stream.dash][debug] video/mp4 segment 1917: downloading (2023-03-10T23:40:44.000000Z / 2023-03-10T23:40:44.000202Z)
[stream.dash][debug] audio/mp4 segment 1917: downloading (2023-03-10T23:40:44.000000Z / 2023-03-10T23:40:44.000376Z)
[stream.dash][debug] video/mp4 segment 1918: waiting 2.0s (2023-03-10T23:40:46.000000Z / 2023-03-10T23:40:44.033539Z)
[stream.dash][debug] video/mp4 segment 1917: completed
[stream.dash][debug] audio/mp4 segment 1918: waiting 1.9s (2023-03-10T23:40:46.000000Z / 2023-03-10T23:40:44.060079Z)
[stream.dash][debug] audio/mp4 segment 1917: completed
[stream.dash][debug] video/mp4 segment 1918: downloading (2023-03-10T23:40:46.000000Z / 2023-03-10T23:40:46.000264Z)
[stream.dash][debug] audio/mp4 segment 1918: downloading (2023-03-10T23:40:46.000000Z / 2023-03-10T23:40:46.000438Z)
[stream.dash][debug] audio/mp4 segment 1919: waiting 2.0s (2023-03-10T23:40:48.000000Z / 2023-03-10T23:40:46.023467Z)
[stream.dash][debug] audio/mp4 segment 1918: completed
[stream.dash][debug] video/mp4 segment 1919: waiting 1.9s (2023-03-10T23:40:48.000000Z / 2023-03-10T23:40:46.104864Z)
[stream.dash][debug] video/mp4 segment 1918: completed
[stream.dash][debug] video/mp4 segment 1919: downloading (2023-03-10T23:40:48.000000Z / 2023-03-10T23:40:48.000254Z)
[stream.dash][debug] audio/mp4 segment 1919: downloading (2023-03-10T23:40:48.000000Z / 2023-03-10T23:40:48.000389Z)
[stream.dash][debug] audio/mp4 segment 1920: waiting 1.9s (2023-03-10T23:40:50.000000Z / 2023-03-10T23:40:48.087022Z)
[stream.dash][debug] audio/mp4 segment 1919: completed
[cli][info] Player closed
[stream.ffmpegmux][debug] Closing ffmpeg thread
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread

- Import `datetime` and `timedelta` from `datetime` in order to
  improve readability and avoid wrapping of long lines
- Use `streamlink.utils.times` utilities and constants
- Add `number` attribute to `Segment` and move `available_at` further up
- Pass all attributes on each `Segment` initialization
- Return "initialization", the segment number or the URL's path name
  as the segment's `name`
- Log the segment `availability` time in addition to the current time
- Use better debug log messages while fetching segments
@gravyboat gravyboat merged commit bd7d15c into streamlink:master Mar 11, 2023
@bastimeyer bastimeyer deleted the stream/dash/improve-segment-logging branch March 11, 2023 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants