# Ipcamera binding ffmpeg problems

**URL:** <https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663>\
**Category:** Beginners\
**Tags:** ipcamera\
**Created:** [September 19, 2021, 12:58pm UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663 "2021-09-19T12:58:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 19, 2021, 12:58pm UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/1 "2021-09-19T12:58:31Z")

</div>

Hi,

my openhab is running in a docker container and I already installed the ffmpeg. I have a VIVOTEK IP8364C camera which support HTTP and RTSP streaming. The jpeg link from ip camera binding is working, but the video stream does not…  
Maybe someone can help me to find the error. Here are some screenshots from my camera, binding conf and log:

**Camera:**

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/e/6e5a00acdd81c33fa53ad7f835635b6fdcd57348.png)

**Binding:**

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/2/c/2c02a25dfdaf247b7d48e0a116ed09752cddaa77.png)

The stream URL (rtsp://root:\*\*\*\*\*@192.168.178.126/live.sdp) is working (tested in VLC).

The generated image URL ([http://192.168.178.10:8090/ipcamera.jpg](http://192.168.178.10:8090/ipcamera.jpg)) is working in the browser.  
The video URL ([http://192.168.178.10:8090/ipcamera.mjpeg](http://192.168.178.10:8090/ipcamera.mjpeg)) not!

**log:**

```auto

13:54:04.140 [INFO] [hab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:generic:Kamera_1' changed from UNINITIALIZED (DISABLED) to INITIALIZING
13:54:04.165 [INFO] [hab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:generic:Kamera_1' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): A non valid URL has been given to the b inding, check they work in a browser.
13:54:07.181 [DEBUG] [mera.internal.handler.IpCameraHandler] - File server for camera at 192.168.178.126 has started on port 8003 for all NIC's.
13:54:11.205 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:11.207 [INFO] [hab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:generic:Kamera_1' changed from OFFLINE (CONFIGURATION_ERROR): A non valid URL has been given to the binding, check th ey work in a browser. to ONLINE
13:54:11.220 [DEBUG] [.ipcamera.internal.MyNettyAuthHandler] - Setting up the camera to use Basic Auth and resending last request with correct auth.
13:54:11.271 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:11.838 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:12.215 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:19.843 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:20.218 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:26.729 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.mjpeg
13:54:27.246 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80rtsp://root: ***** @192.168.178.126:554/live.sdp
13:54:27.848 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:28.220 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:35.845 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:36.222 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:38.000 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.jpg
13:54:38.013 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:38.248 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/favicon.ico
13:54:43.847 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:44.227 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:51.848 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:52.225 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:54:59.850 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:00.225 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:07.852 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:08.226 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:15.853 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:16.227 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:23.852 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:24.229 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:26.727 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream server is going to close an idle channel.
13:55:26.734 [DEBUG] [mera.internal.handler.IpCameraHandler] - All ipcamera.mjpeg streams have stopped.
13:55:26.743 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream Server recieved request GET:/ipcamera.mjpeg
13:55:27.259 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80rtsp://root: ***** @192.168.178.126:554/live.sdp
13:55:27.723 [WARN] [knx.internal.client.AbstractKNXClient] - Giving up reading datapoint 1/2/38, the number of maximum retries (3) is reached.
13:55:31.856 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:32.230 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:38.264 [DEBUG] [ipcamera.internal.StreamServerHandler] - Stream server is going to close an idle channel.
13:55:39.857 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
13:55:40.232 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0

```

---

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 20, 2021, 7:40pm UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/2 "2021-09-20T19:40:19Z")

</div>

solved… I had to change something in the config of the camera.

---

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 21, 2021, 6:43pm UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/3 "2021-09-21T18:43:08Z")

</div>

Now I wanted to test the recording possibility of the ipcamera binding…  
I created a rule with this script:

```auto
if (AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER.state == 0 || AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER.state == NULL ) {
  var TimeStamp = new DateTimeType().format("%1$ty-%1$tm-%1$td_%1$tH-%1$tM-%1$tS").toString				 			
  getActions("ipcamera", "ipcamera:generic:Kamera_1").recordMP4("Manuelle_Aufnahme_"+TimeStamp,10)
}

```

The file is created in the userdata but it is empty and in the log I see this message:

```auto
19:40:16.438 [INFO] [openhab.event.RuleUpdatedEvent] - Rule 'Kamera_Einfahrt_Video_Record_Manuell' has been updated.
19:40:20.947 [DEBUG] [ing.ipcamera.internal.IpCameraActions] - Recording Manuelle_Aufnahme_21-09-21_19-40-20.mp4 for 10 seconds.
19:40:20.955 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-y -t 10 -hide_banner -loglevel warning -i http://root: ******** @192.168.178.126/video.mjpg -c:v copy -c:a copy /openhab/userdata/ipcamera/Kamera_1/Manuelle_Aufnahme_21-09-21_19-40-20.mp4
19:40:20.975 [INFO] [openhab.event.ItemStateChangedEvent] - Item 'AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER' changed from 0 to 10
19:40:21.312 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
19:40:22.136 [INFO] [openhab.event.ItemStateChangedEvent] - Item 'AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER' changed from 10 to 0

```

any ideas what the problem here is?

---

<div class="post-metadata">

**Author:** ![matt1](https://community.openhab.org/user_avatar/community.openhab.org/matt1/32/19930_2.png) [@matt1](https://community.openhab.org/u/matt1)\
**Post date:** [September 22, 2021, 4:08am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/4 "2021-09-22T04:08:11Z")

</div>

> [@dimes](#):
>
> ` -i http://root: ******** @192.168.178.126/video.mjpg -c:v copy -c:a copy`

Your using a mjpeg source for the input which you can do but it requires an argument added which the docs has an example for the esp32 camera on how to do it with that camera. However doing that will mean a lot of cpu to be used to apply h264 compression before it can be stored.

Does the camera have a RTSP URL that is already in h264 format? If so use that instead. The other alternative is to use the gif feature

---

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 22, 2021, 6:00am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/5 "2021-09-22T06:00:22Z")

</div>

Hi,

yes I have a RTSP URL in h264 (rtsp://root:\*\*\*\*\*@192.168.178.126/live2.sdp). I pasted it into the binding field “FFmpeg Input” and now the recording is working. In the log I see still two warnings:

```auto
06:57:32.584 [DEBUG] [ing.ipcamera.internal.IpCameraActions] - Recording Manuelle_Aufnahme_21-09-22_06-57-32.mp4 for 10 seconds.
06:57:32.605 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-y -t 10 -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://root: ******** @192.168.178.126/live2.sdp -c:v copy -c:a copy /openhab/userdata/ipcamera/Kamera_1/Manuelle_Aufnahme_21-09-22_06-57-32.mp4
06:57:32.628 [INFO] [openhab.event.ItemStateChangedEvent] - Item 'AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER' changed from 0 to 10
06:57:34.483 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - [mp4 @ 0x795a40] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
06:57:34.491 [DEBUG] [nhab.binding.ipcamera.internal.Ffmpeg] - [mp4 @ 0x795a40] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.
06:57:38.939 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.178.126:80/cgi-bin/viewer/video.jpg?channel=0
06:57:44.472 [INFO] [openhab.event.ItemStateChangedEvent] - Item 'AB_KAMERA_EINFAHRT_VIDEO_AUFNAHMEN_ZAEHLER' changed from 10 to 0

```

Do I have to react somehow?

---

<div class="post-metadata">

**Author:** ![matt1](https://community.openhab.org/user_avatar/community.openhab.org/matt1/32/19930_2.png) [@matt1](https://community.openhab.org/u/matt1)\
**Post date:** [September 22, 2021, 7:13am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/6 "2021-09-22T07:13:56Z")

</div>

No idea as they come from FFmpeg not the binding. A quick google on parts of the text should turn up some info on what they mean and what to change if action is needed. If it is working, then I would not be too concerned.

---

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 22, 2021, 7:24am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/7 "2021-09-22T07:24:06Z")

</div>

@matt1 thank you!

---

<div class="post-metadata">

**Author:** ![matt1](https://community.openhab.org/user_avatar/community.openhab.org/matt1/32/19930_2.png) [@matt1](https://community.openhab.org/u/matt1)\
**Post date:** [September 22, 2021, 7:31am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/8 "2021-09-22T07:31:50Z")

</div>

no problem, if you work out something just post it here in your thread so if others search the forum they get the full answer…

BTW, if you have a mjpeg url make sure you give it to the binding in the config field labelled “MJPEG URL”, this way when you call for the ipcamera.mjpeg stream it will proxy that url. The reason to do this would be if your camera only allows 1-2 streams at the same time and you want to have 4+ tablets and phones looking at the stream. If the camera supports enough, then it is always better to stream direct from the camera to the end devices and not go through the binding, but it hurts nothing to set it up in case you want it.

---

<div class="post-metadata">

**Author:** ![dimes](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/6bbea6/32.png) [@dimes](https://community.openhab.org/u/dimes)\
**Post date:** [September 22, 2021, 8:18am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/9 "2021-09-22T08:18:18Z")

</div>

Yes I a have both MJPG and RTSP and I customized it that way:

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/1/7/17595383fc25c1c2096a52ff71fcf306ae2080c4.png)

---

<div class="post-metadata">

**Author:** ![system](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/6/6a52f2ac5d00e4c7b50471a354b3a9221188be90.png) [@system](https://community.openhab.org/u/system)\
**Post date:** [November 3, 2021, 12:18am UTC](https://community.openhab.org/t/ipcamera-binding-ffmpeg-problems/126663/10 "2021-11-03T00:18:52Z")

</div>

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