Login
You're viewing the techdon.dev public feed.
  • Jul 17, 2025, 5:21 PM

    @pavel @datenwolf @dcz @martijnbraam @NekoCWD I played with it over the last days and I already have 526x390 30 FPS encoding with live viewfinder, perfectly synced audio, color correction, lens shading correction, tone mapping, AWB and AE - consuming about 40% CPU. Still needs chromatic shading correction and AF, and I started experimenting with enabling PDAF.

    I can also make the sensor output 60 FPS and RAW10. Patches incoming ;) Still only 2 MIPI lanes though, so no 13MP 30FPS yet.

    💬 2🔄 0⭐ 0

Replies

  • Jul 17, 2025, 5:42 PM

    BTW. Recording 30 minutes with screen off ate about 15% of battery, so 3 hours of recording should be possible.

    Image attached toot
    💬 2🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Jul 17, 2025, 5:58 PM

    Note that the picture is shifted down-left a bit because the driver was misconfiguring the output parameters to include dummy pixels - fixed that too, along with several out-of-range clocks 👻

    💬 0🔄 0⭐ 0
  • Jul 17, 2025, 7:44 PM
    @dos @datenwolf @dcz @martijnbraam @NekoCWD I hope you played with it in your day job for about 8 hours a day, because otherwise I'll feel kind of bad :-). Thanks!

    Do you also get constant clicking from the AF system? I thought it was gone on Mobian, but then it came back.

    526x390 is easy, can you do 1052x..? Is it possible to peek at sources somewhere?

    Thanks again.
    💬 0🔄 0⭐ 0
  • Jul 17, 2025, 8:24 PM

    @pavel @datenwolf @dcz @martijnbraam @NekoCWD It's 526x390, but properly binned (each channel's sample consists of 4 raw pixels averaged), which reduces noise. The shader got heavy though, does only ~35 FPS at this res - but there should be room for optimization. I've been more concerned with its correctness than performance so far.

    Stats counting on the CPU with NEON is fast enough for full frame with some subsampling.

    I'm giving it some finishing touches and will then publish it of course 😁

    💬 3🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Jul 18, 2025, 6:01 AM
    @dos @datenwolf @dcz @martijnbraam @NekoCWD If you have something where you can draw / handle controls on top of the viewfinder, or at least around it. I did some hacks in the past with capturing gstreamer window, but they were a) probably X11 specific and b) not really great code. If you have nice solution, I'd like to see one.
    💬 0🔄 0⭐ 0
  • Jul 18, 2025, 6:16 AM

    @pavel There's plenty of apps that embed GStreamer's output to look at, and you can even skip it completely and simply import the V4L buffer into SDL's GL context and don't create your own one at all. This is just gluing things together at this point.

    💬 1🔄 0⭐ 0
  • Jul 18, 2025, 7:14 AM
    @dos I'm not really looking for doing anything with gstreamer output. But if you have example of doing debayering and output via SDL, or know where to find it, I'd love to see it.
    💬 0🔄 0⭐ 0
  • Jul 18, 2025, 7:18 AM

    @pavel Doing it via GStreamer makes buffer queue management easier, but of course it can be done either way. With SDL you get GL context already, so you just do it the way I showed you some time ago. You skip the context creation part and you're done.

    💬 1🔄 0⭐ 0
  • Jul 19, 2025, 7:51 PM

    @pavel So I was just adding autofocus to my toy code and I wanted to be able to trigger it by tapping on the viewfinder. Just replaced waylandsink with gtkwaylandsink, grabbed its GtkWidget and added it to my GtkWindow and it works 😛

    💬 1🔄 0⭐ 0
  • Jul 19, 2025, 9:40 PM
    @dos I have feeling that you'll post few more advancements and then you'll disappear, with that code being gone forever. Probably abducted by aliens as that's clearly alien code :-).

    Please publish it somewhere.... we don't want another "Fermat's last theorem" situation.

    Also, yes, at 512x.. resolution, things are likely easier. I had a lot of fun trying to get gtk/gstreamer working, and while I got it to work _somehow_, I was not really able to understand/debug performance issues.
    💬 0🔄 0⭐ 0
  • Jul 19, 2025, 11:00 PM

    @pavel Displaying the viewfinder is free with (gl)waylandsink, as the dmabuf gets passed directly to the compositor in a subsurface, so the resolution is not important - it goes straight to the GPU for compositing. It's important for encoding and that's where uncached buffers can bite you, but since my shader is currently too heavy to handle higher res anyway it's not a thing I concern myself with right now.

    And the code is basic, it just takes time to get familiar with the problem space 😜

    💬 1🔄 0⭐ 0
  • Jul 21, 2025, 3:57 PM
    @dos I want to see how you do that magic... to see if it looks reasonable or if I should keep playing with sdl. Note that first thing gstreamer will do is downscale color information. If you do that in shader -- YUY2 -- gstreamer will be faster. But having 512x.. image with perfect color in each pixel is a waste with h264 compression
    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Jul 23, 2025, 8:54 PM
    @dos @datenwolf @dcz @martijnbraam @NekoCWD So, this is what I was targetting with my "gstreamer will downscale UV components" comment: GPU is doing heavy computation to make sure you have great color values for each pixel, only for gstreamer to discard it in the next step.

    Anyway, I'd love to see the code :-).
    💬 0🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Jul 26, 2025, 6:00 AM

    @pavel @datenwolf @dcz @martijnbraam @NekoCWD Both, including chromatic shading. They're not that bad in still photos, but I find them very distracting when in movement.

    I've got a song for you, but you'll have to translate it yourself 😁 youtube.com/watch?v=FdIid5IJEd

    I'm relying on kernel changes, so I need to put everything in place first. It also took some time for me to get reasonably confident that what I'm doing is correct. I'm pretty much done though, just some cleanups left to do.

    💬 0🔄 1⭐ 0