Giter Club home page Giter Club logo

Comments (15)

hotsparklab avatar hotsparklab commented on June 4, 2024 2

After a weekend and week evenings of banging my head against a wall, trying to get low-latency video from a Pi to OBS, this issue made my month! Here's a resulting quick project that attempts to break it down for more experience levels and alleviate the pain next time I do this (memory not the best). Thanks for this project and post @fzwoch, @Dregu and @crossan007!

https://github.com/hotsparklab/raspberry-pi-udp-camera

I put a note of special thanks in there referencing this "issue". Thanks for being awesome! :D

from obs-gstreamer.

fzwoch avatar fzwoch commented on June 4, 2024 1

I would say whatever works best for you. If matroska works - thats just fine. You are basically packaging H.264 into a MKV container. gdppay and gdpdepay are essentially wrappers for GstBuffers (they also transfer timestamps etc.). So you would package H.264 into this format. Not too much difference - there just seems no real need for MKV in this case - unless you would like to try to receive if with some other players as the Gst format is a GStreamer format typically not understood by other players.

See https://github.com/fzwoch/obs-gnome-screencast for use cases with gdppay and gdpdepay.

But if your question is whether you can send the raw bitstream instead of raw images to the OBS pipeline - I don't think so. But I haven't checked in detail. I can image there may be differences with what decoder can be used internally pf OBS..

from obs-gstreamer.

fzwoch avatar fzwoch commented on June 4, 2024 1

I guess I should. These examples are great so I left this issue open. I just never did before so I need to check what to do so people can contribute to. Hopefully I can check this in the next couple of days.

from obs-gstreamer.

fzwoch avatar fzwoch commented on June 4, 2024

Looks good to me :-)

One note: is there a reason to use Matroska muxing for streaming over IP? Maybe using gdppay and gdpdepay encapsulating the H.264 data is the weapon of choice for such use cases. But I guess as long as it works..

And another: videoscale on the GStreamer side is done in software and may be slow. Perhaps just consider receiving the unscaled image and scale the canvas on the OBS scene. Then it will be scaled at the GPU layer of OBS.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

So, before obs, I was hacking on "voctomix". They have a Python ui which manipulates gstreamer pipelines to provide a video mixer.

Their transport of choice was always matroska - something about how it preservers timestamps differently/better.

Looking at docs for gdppay, it may do the job just as well.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

Good catch with the video scale

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

Hey, do you think we could (or should) pass h264 directly into OBS?

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

interesting. I just tried both matroskamux / matroskademux and gdppay / gdpdepay, and gdp* doesn't seem to work at all, while matroska seems to work like a charm.

Now I'm curious.

from obs-gstreamer.

Dregu avatar Dregu commented on June 4, 2024

Been fiddling with raspi streaming quite a lot, and all the muxing and converting just seems useless if you have a good network. I also posted this on the forums, but

raspivid -n -t 0 -w 1280 -h 720 -g 60 -fps 30 -b 2500000 -mm average -ex fixedfps -ih -pf high -o udp://10.0.0.176:5000

udpsrc port=5000 ! h264parse ! avdec_h264 ! video.

works just fine over my wifi.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

@Dregu I think you bring up a valid point here - "good network"

I'm noticing that my PiZero reports a great wifi connection until I start streaming video - then it drops to 5.5 mbps.

Additionally, I'm noticing some weird sync issues (I believe unrelated to network, but rather ISO).

If I request above a certain ISO, then the resultant H264 frames are late (compared to frames being generated by a separate camera, on a separate pi on a separate network connection.)

below ISO 400, then the H264 frames from the zero are only about 100 ms behind frames from a Logitec C920; however if i request ISO600 from the Pi camera, then the frames are a few seconds late. Again - this could be a network issue (as higher ISO = more video data in a dim lit area = more network throughput).

sorry for the ramble - it's late and I'm wrapping up for the evening.

I think I've posted about this on a different GH issue: thaytan/gst-rpicamsrc#71

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

I'm planning on porting https://github.com/crossan007/PiCamFleetMapper into an OBS plugin with a UI for managing "remote cameras" within OBS.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

Another example:

Allen and Heath QU32 Mixing console USB out -> GStreamer/OBS. Select the first 2 of the 32 channels on the source, and trim to stereo

videotestsrc pattern=18 ! video. alsasrc name=audiosrc device=hw:1 ! audio/x-raw,channels=32,layout=interleaved,rate=48000 ! queue ! deinterleave name=d interleave name=i d.src_0 ! queue ! audioconvert  ! i.sink_0  d.src_1 ! queue ! audioconvert  ! i.sink_1 i. ! audio.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

Closing this, as it's not actually an issue.

from obs-gstreamer.

crossan007 avatar crossan007 commented on June 4, 2024

@fzwoch would you consider opening the wiki on this repo? I'd gladly contribute some documentation and examples.

from obs-gstreamer.

fzwoch avatar fzwoch commented on June 4, 2024

I have set the option for the wiki to be world writable I think. If it works you can start adding some stuff there as you like. I'm a bad documentation person myself..

from obs-gstreamer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.