Skip to content

Add demo to open Bambu X1 Carbon live stream #128

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jamwaffles
Copy link
Contributor

This needs more work to integrate it into the server (e.g. providing a WebRTC endpoint, dynamic IP and access code), but as it stands it's now possible to get video frames from the printer.

This has been a huge pain in the arse because there isn't a good RTSP auth crate that I could find, so that was written from scratch. Additionally, the network data that comes out of the printer starts with this weird 0x2400(len low)(len high) 4 byte preamble that I couldn't find in any specs anywhere, so that confused me for days as it meant none of the H.264 decoders I tried would pick up a frame.

I'm sick of reading hex off the command line so I'll present this code as-is for someone else (maybe me later lol) to integrate into machine-api proper.

I've left my NOTES.md in as it might prove helpful in the future, but be aware the file is pretty much a live stream (hah)/dumping ground of things I found in my travels.

Makes steps towards closing #52

@paultag
Copy link
Collaborator

paultag commented Oct 24, 2024

i'd love to land this; @jamwaffles any big blockers on landing this beyond the merge conflict? its ok if its kinda broken since we don't have anything in main today, we just ought to document where it's busted before landing :)

@jamwaffles
Copy link
Contributor Author

No blockers! I tried to retest this at KittyCamp but didn't get very far, so either something in newer firmwares broke this code, or something has bitrotted. I didn't have time or energy to look into it last week but hopefully it's just a case of some simple debugging to make the stream work again.

@paultag
Copy link
Collaborator

paultag commented Oct 24, 2024

Understood! I'll give doing some CPR on it a shot as soon as I can


let mut stream = Rtsps::new(
// User is hard coded to `bblp`. Password is printer access code.
"rtsps://bblp:[email protected]:322/streaming/live/1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

omg wait its "just" a rtp stream? ok this is cool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! IIRC I was using ffplay to test it and capture packets. If you need an example command, let me know and I'll look through my shell history and post it here.

I had A Time(tm) getting all the Rust stuff to actually parse and decode frames though, so I'm not unsurprised that fragile code no longer worked when I tested it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

17297847942098067271988267663117

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

Successfully merging this pull request may close these issues.

2 participants