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

[rtp-to-webrtc v4 example] - use H264 instead of VP8 #3027

Open
Ryan-ZL-Lin opened this issue Jan 31, 2025 · 0 comments
Open

[rtp-to-webrtc v4 example] - use H264 instead of VP8 #3027

Ryan-ZL-Lin opened this issue Jan 31, 2025 · 0 comments

Comments

@Ryan-ZL-Lin
Copy link

Hi, I'm following this doc to test out the example, and I could use gstreamer with VP8 to see the video on fiddle web page successfully.

Now, I want to switch to H264 instead of VP8.
I'm using
ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -pix_fmt yuv420p -c:v libx264 -g 10 -preset ultrafast -tune zerolatency -f rtp 'rtp://127.0.0.1:5004?pkt_size=1200'as the test video source.

I changed this line since it's the only occurrence that I can find in https://github.com/pion/webrtc/blob/master/examples/rtp-to-webrtc/main.go

// Create a video track
	videoTrack, err := webrtc.NewTrackLocalStaticRTP(
		webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeVP8}, "video", "pion",
	)

to

// Create a video track
	videoTrack, err := webrtc.NewTrackLocalStaticRTP(
		webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypeH264}, "video", "pion",
	)

However, I cannot see the video stream on fiddle web site anymore and the vide player keeps loading, although I can see log Connection State has changed connected printed out.

Is there anything I missed out here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant