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

The customized HEVC track failed #518

Open
shiqifeng2000 opened this issue Dec 12, 2023 · 2 comments
Open

The customized HEVC track failed #518

shiqifeng2000 opened this issue Dec 12, 2023 · 2 comments

Comments

@shiqifeng2000
Copy link
Contributor

shiqifeng2000 commented Dec 12, 2023

hi

After RTP h265 codec is added, I try to add hevc track to this repo, but not successful, this is how I did.

claim a mime type
pub const MIME_TYPE_HEVC: &str = "video/hevc";

register codec to MediaEngine
m.register_codec(
RTCRtpCodecParameters {
capability: RTCRtpCodecCapability {
mime_type: MIME_TYPE_HEVC.to_owned(),
clock_rate: 90000,
channels: 0,
sdp_fmtp_line: "".to_owned(),
rtcp_feedback: vec![],
},
payload_type: 167,
..Default::default()
},
RTPCodecType::Video,
)?;

add a hevc payloader to RTP submodule
-->webrtc-0.9/rtp/src/codecs/h265/mod.rs
#[derive(Default, Debug, Clone)]
pub struct HevcPayloader {
vps_nalu: Option,
sps_nalu: Option,
pps_nalu: Option,
}

and of course, with impl Payloader for HevcPayloader, it's a lot of code

add some code to get pass the constrain in the function <payloader_for_codec>
-->webrtc-0.9/webrtc/src/rtp_transceiver/rtp_codec.rs

then I open a bi-direction program, exchanging sdp, and send rtp, got connected, seems working, but failed to have the receiver working

I saw the callback
peer_connection.on_track wont work anyway

then I check the code in
-->webrtc-0.9/webrtc/src/peer_connection/peer_connection_internal.rs
it seems there's not any rtp received, so i guess either it's sender failed or receiver failed, maybe more work need to be done

could you check the work above and show me any inspiration? thank you

@shiqifeng2000
Copy link
Contributor Author

Update:

After installing wireshark, I found all the RTP pkt sent got the payload type as 38, but I actually set that to 167, it seems after I invoke the fn write_rtp from a TrackLocalWriter , it actually change my payload type into 38, thats pretty weird.

Then I try change my payload type to 38, it finally works, maybe it's a fallback reservation, I dont know. Please take a look to see if its a bug.

@shiqifeng2000
Copy link
Contributor Author

Update:

I have figured it out that the max rtp payload is 127, sorry for this miss, I am closing the issue

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

1 participant