Skip to content
Draft
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/livekit/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ import {
type RoomOptions,
ScreenSharePresets,
type TrackPublishDefaults,
type VideoPreset,
VideoPreset,
VideoPresets,
} from "livekit-client";

const VideoPresetsH264 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what makes this specific H264 presets? Aren't those just regular presets that could also be used with other encordings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is in draft -- this is part of debugging why h264 with simulcast is not working on iOS devices.

using h264 specific presets help finding out if the h264 macro-block constraint is the problem here.

h144: new VideoPreset(256, 144, 155_000, 20),
h240: new VideoPreset(480, 234, 160_000, 20),
h176: new VideoPreset(320, 176, 160_000, 20),
h288: new VideoPreset(382, 288, 180_000, 20),
// h360: VideoPresets.h360,
h360: new VideoPreset(640, 360, 450_000, 20),
h540: new VideoPreset(960, 540, 800_000, 20),
} as const;

const defaultLiveKitPublishOptions: TrackPublishDefaults = {
audioPreset: AudioPresets.music,
dtx: true,
Expand All @@ -23,10 +33,13 @@ const defaultLiveKitPublishOptions: TrackPublishDefaults = {
red: false,
forceStereo: false,
simulcast: true,
videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360] as VideoPreset[],
videoSimulcastLayers: [
VideoPresetsH264.h144,
VideoPresets.h360,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the mixture of VideoPresetsH264 and VideoPresets?

] as VideoPreset[],
screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,
stopMicTrackOnMute: false,
videoCodec: "vp8",
videoCodec: "h264",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
videoCodec: "h264",
videoCodec: platform === "ios" || !useH264Setting ? "vp8" : "h264",

Adding a dev setting for using h264 would allow merging this and would provide us more data on how this behaves in real live.

Let me know if I should update this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fkwp any thoughts on this? This would also be nice to have in the 15 release ?

videoEncoding: VideoPresets.h720.encoding,
backupCodec: { codec: "vp8", encoding: VideoPresets.h720.encoding },
} as const;
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ window.setLKLogLevel = setLKLogLevel;
initRageshake().catch((e) => {
logger.error("Failed to initialize rageshake", e);
});
setLKLogLevel("info");
setLKLogLevel("debug");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on purpose? or a left over of a dev setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is part of debugging why h264 with simulcast is not working on iOS devices.

setLKLogExtension((level, msg, context) => {
// we pass a synthetic logger name of "livekit" to the rageshake to make it easier to read
global.mx_rage_logger.log(level, "livekit", msg, context);
Expand Down
Loading