Login
You're viewing the techdon.dev public feed.
  • Jul 4, 2025, 1:45 PM

    @pavel Yes, of course.

    BTW. Turns out that streaming to YouTube instead of a local file is just a matter of using rtmpsink instead of filesink 😁

    A live stream on YouTube, showing a sitting cat looking into the camera.
    💬 1🔄 0⭐ 0

Replies

  • Jul 4, 2025, 4:04 PM

    @pavel I'm playing with GStreamer now (which is new for me) and it seems like most of this code could be replaced with GStreamer elements, and the rest should neatly plug in as custom elements 😂

    💬 2🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Jul 5, 2025, 12:22 PM

    @pavel You've got a dma-buf handle, already mapped buffer and even GStreamer with all its sinks available, so... however you want? Pretty much anything will be able to consume it easily.

    💬 1🔄 0⭐ 0
  • Jul 5, 2025, 1:30 PM
    @dos I don't have much experiences with GUI programming, so I was looking for suggestions. I've got dma-buf handle but would not know what to do with it in gtk, and maybe SDL is better match. Or perhaps stick to original plan and do user interface ("take picture" button etc) in another process.
    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Jul 5, 2025, 12:28 PM

    @pavel Not sure what you mean. GStreamer is internally multi-threaded, but its API is thread-safe and there's only one thread in this code. Of course any kind of production-quality code will use some mainloop and enqueue buffers based on callbacks rather than while(!processed){} loop, but it's not exactly rocket science.

    💬 1🔄 0⭐ 0
  • Jul 5, 2025, 1:20 PM
    @dos There are at least two threads in this code: main one, and whatever runs "on_buffer_released". I don't yet know what causes the segfaults, but I suspect gstreamer.
    💬 0🔄 0⭐ 0
  • Jul 5, 2025, 1:33 PM

    @pavel That one line is the only thing that runs from another thread and it's neither scary nor requires any locking 😁

    But there are several other smelly things in this code and lots of missing error handling, so I'd rather start with that when looking for suspects.

    💬 1🔄 0⭐ 0
  • Jul 5, 2025, 8:17 PM

    @pavel Passing the right buffer size to gst_dmabuf_allocator_alloc helps it to not crash and not have garbage at the end of the frame 😂

    💬 0🔄 0⭐ 0