Skip to content

Commit

Permalink
add codec presets
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyoshiaki committed Jan 6, 2025
1 parent 4e82be1 commit a4870b3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/webrtc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ export * from "./transport/ice";
export * from "./transport/sctp";
export * from "./types/domain";
export * from "./utils";
export * from "./media/codec";
25 changes: 25 additions & 0 deletions packages/webrtc/src/media/codec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { RTCRtpCodecParameters } from "..";

export const useH264 = () =>
new RTCRtpCodecParameters({
mimeType: "video/h264",
clockRate: 90000,
rtcpFeedback: [
{ type: "nack" },
{ type: "nack", parameter: "pli" },
{ type: "goog-remb" },
],
parameters:
"profile-level-id=42e01f;packetization-mode=1;level-asymmetry-allowed=1",
});

export const useVP8 = () =>
new RTCRtpCodecParameters({
mimeType: "video/VP8",
clockRate: 90000,
rtcpFeedback: [
{ type: "nack" },
{ type: "nack", parameter: "pli" },
{ type: "goog-remb" },
],
});

0 comments on commit a4870b3

Please sign in to comment.