Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range #6

Open
3052 opened this issue Oct 1, 2024 · 2 comments
Open

range #6

3052 opened this issue Oct 1, 2024 · 2 comments

Comments

@3052
Copy link

3052 commented Oct 1, 2024

where is the range set in this process? I checked here:

const body = VideoPlaybackAbrRequest.encode({
mediaInfo: mediaInfo,
audioFormats: audioFormatIds,
videoFormats: videoFormatIds,
selectedFormats: this.initializedFormats.map((fmt) => fmt.formatId),
videoPlaybackUstreamerConfig: base64ToU8(this.videoPlaybackUstreamerConfig),
streamerContext: {
field5: [],
field6: [],
poToken: this.poToken ? base64ToU8(this.poToken) : undefined,
playbackCookie: this.playbackCookie ? PlaybackCookie.encode(this.playbackCookie).finish() : undefined,
clientInfo: {
clientName: 1,
clientVersion: '2.2040620.05.00',
osName: 'Windows',
osVersion: '10.0'
}
},
bufferedRange: this.initializedFormats.map((fmt) => fmt._state),
field1000: []
}).finish();

then here:

message VideoPlaybackAbrRequest {
optional MediaInfo media_info = 1;
repeated .misc.FormatId selected_formats = 2;
repeated BufferedRange buffered_range = 3;
optional bytes video_playback_ustreamer_config = 5;
optional Lo lo = 6;
repeated .misc.FormatId audio_formats = 16;
repeated .misc.FormatId video_formats = 17;
optional StreamerContext streamer_context = 19;
optional OQa field21 = 21;
optional int32 field22 = 22;
optional int32 field23 = 23;
repeated Pqa field1000 = 1000;
}

but if I check an example request from the official YouTube client, I only see these fields

1: {protobuf.Unknown{
2: {
5: {protobuf.Unknown{
6: {protobuf.Unknown{
16: {
17: {
19: {protobuf.Unknown{
@LuanRT
Copy link
Owner

LuanRT commented Oct 1, 2024

Technically, there's no range.
You have to adjust the startTimeMs field in the MediaInfo object (and bufferedRanges to some extent) to get the desired media segments.

@luthfipun
Copy link

Hi @LuanRT do you know how to get the specific startTimeMs duration from the currentLength? Because for streaming, most players only pass the current length position to get a new segment or when seeking forward/backward. I’ve tried calculating it from the total duration, total content length, and current length, but the duration is inaccurate, or maybe I’ve made a mistake in my calculations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants