# Pipe2jpeg - inject images separately?

**URL:** https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111
**Category:** General
**Created:** [13 July 2025 10:51 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111 "2025-07-13T10:51:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 July 2025 10:51 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/1 "2025-07-13T10:51:44Z")

</div>

Perhaps @kevinGodell could provide some guidance.

Is it possible to inject a buffer into pipe2jpeg and have that become an endpoint with a 'video' stream ?

ie. I have a single image sitting in flow context as a buffer, this image changes every x minutes.  
Can I inject this buffer (every second for example) directly into pipe2jpeg ? It does not seem to work, is there a way that i could 'emulate' this as a 'stream' ?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [13 July 2025 11:34 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/2 "2025-07-13T11:34:29Z")

</div>

Ok found the method (i think), save the image to a file and use ffmpeg to feed it into pipe2jpeg

```auto
ffmpeg -re -loop 1 -i /path/image.jpg -f image2pipe -c mjpeg -t 00:02:00 pipe:1

```

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [13 July 2025 13:17 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/3 "2025-07-13T13:17:51Z")

</div>

I'm intrigued as to your use case, can you elaborate on what you are doing please ?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [14 July 2025 05:28 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/4 "2025-07-14T05:28:05Z")

</div>

This is just some tomfoolery, bear with me :')

I create a webpage showing a chart, news headlines, or whatever I want.  
Then use puppeteer to capture a screenshot of that webpage.  
Feed the screenshot into pipe2jpeg to make it available as a stream.

This stream can be exposed to homekit (via homebridge) as a security camera:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc11391d84b9625cf031e2edc9480d88a5fd0e5e.jpeg)

:')

Now I could create my own 'live station' of data i want to show, i noticed that i can kill ffmpeg and restart with another file and the stream will get updated.

ie: charts in homekit 😆

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [14 July 2025 22:13 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/5 "2025-07-14T22:13:03Z")

</div>

Interesting idea, but this doesn't seem overly efficient for a static image, how about reducing the frame rate to 1 ?

```auto
ffmpeg -re -loop 1 -r 1 -i /path/image.jpg -f image2pipe -c mjpeg -t 00:02:00 pipe:1

```

Same effect but much less bandwidth 🤔

EDIT: Alternatively take a look at @BartButenaers node -

> **[node-red-contrib-multipart-stream-encoder](https://flows.nodered.org/node/node-red-contrib-multipart-stream-encoder)**
>
> Node Red node for encoding multipart streams over http

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [12 October 2025 22:13 UTC](https://discourse.nodered.org/t/pipe2jpeg-inject-images-separately/98111/6 "2025-10-12T22:13:37Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
