Skip to content

Instantly share code, notes, and snippets.

View Sean-Der's full-sized avatar
🙈
Lexi is the love of my life, I love her more then Daisy loves cheese

Sean DuBois Sean-Der

🙈
Lexi is the love of my life, I love her more then Daisy loves cheese
View GitHub Profile
@Sean-Der
Sean-Der / out.patch
Created April 9, 2024 18:32
OBS Patch for Pacing
diff --git a/plugins/obs-webrtc/whip-output.cpp b/plugins/obs-webrtc/whip-output.cpp
index e83cc03b8..0e3693992 100644
--- a/plugins/obs-webrtc/whip-output.cpp
+++ b/plugins/obs-webrtc/whip-output.cpp
@@ -60,6 +60,10 @@ bool WHIPOutput::Start()
return false;
}
+ obs_data_t *video_settings = obs_encoder_get_settings(encoder);
+ video_bitrate = (int)obs_data_get_int(video_settings, "bitrate");
@Sean-Der
Sean-Der / index.html
Created April 3, 2024 01:32
Minimal WHEP Player against Broadcast Box
<html>
<head>
<title>whep-static</title>
</head>
<body>
<h3> Video </h3>
<video id="videoPlayer" autoplay muted controls style="width: 500"> </video>
@Sean-Der
Sean-Der / Log.txt
Created February 19, 2024 22:38
Broadcast Box Deadlock
This file has been truncated, but you can view the full file.
2024/02/16 02:25:23 Loading `.env.production`
NETWORK_TEST_ON_START is enabled. If the test fails Broadcast Box will exit.
See the README for how to debug or disable NETWORK_TEST_ON_START
2024/02/16 02:25:23 Running HTTP Server at `:8080`
Network Test passed.
Have fun using Broadcast Box.
2024/02/16 05:24:25 Authorization was not set
2024/02/16 05:25:38 Authorization was not set
2024/02/16 14:22:00 Authorization was not set
@Sean-Der
Sean-Der / ffmpeg.rb
Created June 12, 2023 20:33
FFMpeg Homebrew Formula with Opus FLV Support
class Ffmpeg < Formula
desc "Play, record, convert, and stream audio and video"
homepage "https://ffmpeg.org/"
url "https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz"
sha256 "57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082"
# None of these parts are used by default, you have to explicitly pass `--enable-gpl`
# to configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
license "GPL-2.0-or-later"
head "https://github.com/FFmpeg/FFmpeg.git", branch: "master"
@Sean-Der
Sean-Der / README.txt
Created May 20, 2023 16:44
Get involved with Pion
Pion has lots of opportunities to get involved. We have lots of self contained projects that would be a lot of fun. Even if you don’t finish the project that is fine. The great thing about Open Source is someone can pick up where you left off.
It’s a great way to learn deep WebRTC knowledge. It is also a great pathway into a career in WebRTC. Multiple Pion contributors now work at companies that use the code they wrote.
—————————————
Network Simulator - Pion needs an easy to use network simulator. Something that developers can use in a few minutes and doesn’t require a Docker container or a long setup process. It can run in memory, but also provides virtual interfaces to test non-Go programs.
The simulator will model real world networks. Nog just setting a static packet loss or bandwidth cap. It can dynamically adjust all the attributes of the link.
@Sean-Der
Sean-Der / flags
Created April 4, 2023 17:39
flags
-DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -w -pipe -fno-semantic-interposition -static"
-DCMAKE_C_FLAGS="-static-libgcc -w -pipe -fno-semantic-interposition -static"
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++ -L${target_config[output_dir]}/lib -Wl,--exclude-libs,ALL -static"
@Sean-Der
Sean-Der / example.sdp
Created December 15, 2022 04:32
Example Offer
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:122 rtx/90000
a=fmtp:122 apt=102
a=rtpmap:127 H264/90000
@Sean-Der
Sean-Der / main.go
Created September 30, 2022 17:45
Pion rtpdump to disk
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{})
if err != nil {
panic(err)
}
// Allow us to receive 1 audio track, and 1 video track
if _, err = peerConnection.AddTransceiverFromKind(webrtc.RTPCodecTypeAudio, webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionRecvonly}); err != nil {
panic(err)
} else if _, err = peerConnection.AddTransceiverFromKind(webrtc.RTPCodecTypeVideo, webrtc.RTPTransceiverInit{Direction: webrtc.RTPTransceiverDirectionRecvonly}); err != nil {
panic(err)
@Sean-Der
Sean-Der / main.js
Created May 28, 2022 18:26
Example of Preferring H264 as a Receiver in JS
const H264Codecs = RTCRtpReceiver.getCapabilities('video').codecs.sort((a, b) => {
if (a.mimeType.includes('H264') && b.mimeType.includes('H264')) {
return 0
} else if (a.mimeType.includes('H264')) {
return -1
} else {
return 1
}
})
@Sean-Der
Sean-Der / go.mod
Created May 28, 2022 18:22
Only allow H264 as a receiver
module set-receiver-codec
go 1.18
require github.com/pion/webrtc/v3 v3.1.41
require (
github.com/google/uuid v1.3.0 // indirect
github.com/pion/datachannel v1.5.2 // indirect
github.com/pion/dtls/v2 v2.1.5 // indirect