StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

FFMPEG 2x2 - when camera input is offline => avoid freeze, show black screen

28 April 2026 @ 1:14 pm

OS: Ubuntu 22 The below script works well to show 2x2 mosaic view. However when one of 4 cameras goes offline, the whole script terminates and rtmp://localhost/live_shp_cam ends. Goal: when 1 camera goes down => need to still show other 3 cameras + 1 black screen (2x2 mosaic view). How to achieve that? Tried these options, but none works: overlay=eof_action=pass, -f lavfi -i nullsrc=s=1920x1080:r=15 \ Script for 2x2 mosaic: ffmpeg \ -thread_queue_size 1024 -rtsp_transport tcp -probesize 64 -analyzeduration 0 -re -i rtsp://url_cam_1 \ -thread_queue_size 1024 -rtsp_transport tcp -probesize 64 -analyzeduration 0 -re -i rtsp://url_cam_2 \ -thread_queue_size 1024 -rtsp_transport tcp -probesize 64 -analyzeduration 0 -re -i rtsp://url_cam_3 \ -thread_queue_size 1024 -rtsp_transport tcp -probesize 64 -analyzeduration 0 -re -i rtsp://url_cam_4 \ -c:v libx264 -g 15 -b:v 1200k -profile:

How we stabilized a system that depended on 5 unreliable third-party APIs

28 April 2026 @ 1:03 pm

This week I worked on a system that wasn’t down, but wasn’t correct either. It depended on 5 external APIs: Payments Shipping ERP Email A client-owned API Each one worked “most of the time.” Together, they created constant edge case failures. The problem Not outages. Small failures: timeouts duplicate webhooks partial responses fake 200 OKs Result: duplicate orders missing syncs inconsistent data Nothing crashed. Things just got messy. What didn’t work retries → caused duplicates logs → helped too late alerts → too noisy What fixed it We started treating external APIs as untrusted.

How I install windows [closed]

28 April 2026 @ 1:03 pm

Dear recently I buy loptop used condition dell xps 13 9310 I use loptop but just 2 or 3 mint after one notification coming (your device ran into a problem and needs to restart 0% complate) and my loptop is restarting I was install windows 11 10 also updated drivers but not solve my problem 5 and 6 time continues restart after coming notification is (could not connect to the network Log file:C:\windows\system32\logfiles\srt\srtTrail.txt Please guide

Ideal contrast for background and text outline/stroke colors

28 April 2026 @ 12:56 pm

There are multiple answers on how to achieve the minimum recommended color contrast for a11y purposes on Web pages (one can learn more, for example, here). However, all of them seem to discuss only the contrast between background-color and color. I couldn't find answers regarding the required minimum contrast between text outline (or text stroke, the "border" of a letter, so to say) and background-color. Below is an example of bad contrast between background-color and text color: enter image description here And here is an example of possibly good contrast achieved with text outli

Does a masked region have to be in an explicit parallel region?

28 April 2026 @ 12:54 pm

This is an odd OpenMP question triggered by a possible compiler bug (?) we are chasing down. For a long time, we've had code that had: !$omp masked ... !$omp end masked that didn't have an explicit parallel region around it. (Well, technically this code is still has master but that's just its age showing). And it's worked for us for a long time and compilers (GNU, Intel) didn't complain. But now we found for one compiler (NAG) that it needs: !$omp parallel !$omp masked ... !$omp end masked !$omp end parallel Now, looking at the Standard I see: The binding thread set for a masked region is the current team. A masked region binds to the innermost enclosing parallel region. which seems to reply we were just "lucky" before then. But then in the standard I also see refere

React Three Fiber SkinnedMesh (6.4MB) fails to render on mobile browsers but works perfectly on desktop

28 April 2026 @ 12:39 pm

I am building a web-based 3D interactive project using React Three Fiber. The model is a character with skeletal animations (SkinnedMesh) generated by an AI tool. The project works perfectly on Desktop browsers, but it completely fails to load on mobile devices (iOS Safari and Android WeChat WebView). On mobile, it just shows my fallback <Sphere /> component with no clear console errors, or sometimes silently crashes the tab. My Setup React 18 + Vite @react-three/fiber + @react-three/drei + three.js Model: GLB format with SkinnedMesh Deployed on: Tencent Cloud Static Hosting The Problem (Visualized) As you can see below, the desktop renders the 3D model fine, while the mobile browser gets stuck on the fallback sphere. Desktop v

GStreamer RTP (L16) stream works with GStreamer receiver but not with custom C RTP receiver (audio distorted) [closed]

28 April 2026 @ 12:25 pm

I am trying to stream raw PCM audio over RTP using GStreamer on the sender side and receive it using a custom C program on the receiver side. Using local newtork connection using Ethernet Sender (GStreamer) I am using the following GStreamer pipeline: gst-launch-1.0 -v \ filesrc location=audio.wav ! decodebin ! audioconvert ! audioresample ! \ audio/x-raw,format=S16BE,rate=48000,channels=2 ! \ rtpL16pay mtu=1036 ! \ udpsink host=10.42.0.10 port=5001 sync=true Receiver (Custom Coder): On receiver I am just dumping raw samples: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <stdint.h> #define PORT 5001 #define BUFFER_SIZE 4096 typedef struct { uint8_t vpxcc; uint8_t mpt; uint16_t seq; uint32_t timestamp; uint32_t ssrc; } __attribute__((packed)) RTPHeader; int main(

Compare JSON Object with random List in Object

28 April 2026 @ 12:13 pm

Is there an easy and general way to compare two Objects with lists in it? I have two Objects, both are the same type, the first one is the old one and the second one has maybe updates, now I want to know if there are changes. The Object look something like this: { id: "A524", name: "test", data: [ { id: 0, name: "test1", data: [1,2,3] }, { id: 1, name: "test2", data: [1,2] }, { id: 2, name: "test3", data: [2,3] }, ] }

Hibernate is not using custom implementation of PhysicalNamingStrategy

28 April 2026 @ 12:03 pm

In my unit test I want to use my custom implementation of PhysicalNamingStrategy: public class CustomPhysicalNamingStrategyStandardImpl implements PhysicalNamingStrategy { @Override public Identifier toPhysicalCatalogName(Identifier identifier, JdbcEnvironment jdbcEnvironment) { return null; ... } This is my configuration: <jdbc:embedded-database id="dataSource" type="H2"/> <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop> <prop key="hibernate.

Getting a progressive web app (PWA) to work offline on iOS

28 April 2026 @ 1:28 am

I'm trying to get a simple web app to work offline on iOS. I set up a bare bones manifest linked from the html file. Then, in iOS, I create a home screen shortcut to the web app in Safari. The web app loads when the device has network access, but when I try it in Airplane Mode, I find that the app is not cached, and nothing loads. Am I missing a step? Did iOS stop supporting cached offline web apps?