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

Stream missing from Available Producers #464

Open
Meekohi opened this issue Feb 28, 2025 · 2 comments
Open

Stream missing from Available Producers #464

Meekohi opened this issue Feb 28, 2025 · 2 comments

Comments

@Meekohi
Copy link

Meekohi commented Feb 28, 2025

The only options I see for my video source Encode are MJPG and YUVV. In contrast for the fake source I see h264, h265, MJPG, and YUVV.

  • h264 works as expected 👍🏼
  • h265 says it is incompatible with UDP
  • The others allow me to create a stream, but nothing appears in "Available Producers" on the WebRTC Development UI.

Is there a way to either make h264 available for my video stream, or advice on how to figure out what is wrong with the mjpg/yuvv options?

@joaoantoniocardoso
Copy link
Collaborator

Hi @Meekohi, as it is right now, web-browsers only need to support H264, VP8 and VP9. While some browsers have been trying to adopt H265 for WebRTC (Safari, for example), no browser showed interest in allowing raw formats like MJPG and YUYV.

For your use, you'll have to either encode your video to H264, or change your device to some device that offers a H264-encoded video stream out of the box.

To encode your video, you'll have to write a script to get the video from your camera, process it, and let it available via an RTSP server. Then, in mavlink camera manager, you can add it as a redirect stream.

I believe the easiest way to accomplish that is to start from this. If you build this project and run the test-launch application (the source is at examples/test-launch.c), you can pass your gstreamer pipeline to do just what you need.

Your command would be something like:

test-launch "\
  v4l2src device=/dev/video0 do-timestamp=true \
    ! video/x-raw,width=1920,height=1080,framerate=30/1 \
    ! x264enc \
    ! h264parse \
    ! rtph264pay name=pay0 \
"

thanks

@joaoantoniocardoso
Copy link
Collaborator

Oh, also, be aware that stream encoding requires some CPU or GPU process power. Feel free to try different encoders than the x264enc that I used in the example there.

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

2 participants