How to determine url to use for ffmpeg

I’ve been poking around the forum for info on using ffmpeg to stream/capture from a rtsp enabled IP camera. Each post that I find uses a different url for testing (excluding IP obviously). How does one determine the correct url.

For example, I am attempting to test using the following format

ffmpeg -i rtsp://admin:[email protected]:554 -an -f null -

and

ffmpeg -i rtsp://admin:[email protected]:554/unicast -an -f null -

and

ffmpeg -i rtsp://admin:[email protected]:554/tcp/av0_0 -an -f null -

But these are just guesses.

How does one determine the correct url for testing, and later for configuration?

My camera is a SimpleHome XCS7-1003-WHT

Thanks.

I’m going to reply to my own thread. I was able to guess the url by looking at other examples. Still have no idea how others figure this out.

This is how I testing the url on my linux desktop

ffmpeg -v verbose -i rtsp://admin:[email protected]:554/11 -vcodec mpeg4 -acodec aac output.mp4

Note that running the same command on Hasbian results in the following output. Not sure if I should take this as a bad sign

Illegal instruction

One of the first places I go to is here:

https://www.ispyconnect.com/sources.aspx

Ooh - thanks

That’s where I usually send people trying to set up cams in HA because it has all the direct URLs for the different cameras and protocols, sorted by make and model.

I was unable to find anything for a Simple Home camera, however I started poking at it with wireshark and telnet and found the actual IP cam type like so

$ telnet 10.1.0.158 554
Trying 10.1.0.158…
Connected to 10.1.0.158.
Escape character is ‘^]’.
get
RTSP/1.0 400 Bad Request
Cache-Control: no-cache
Server: Hisilicon Ipcam

Apparently I guessed the url pretty well

Thanks

1 Like

A bit more info for those who might need it in the future.

This URL seems to be for the HD stream, stream 0

rtsp://home:[email protected]:554/11

Note output below:

Stream #0:0: Video: h264 (Main), 1 reference frame, yuv420p, 1280x720, 29.97 tbr, 90k tbn, 180k tbc

This URL seems to be for the SD stream, stream 1.

rtsp://home:[email protected]:554/12

Note output below:

Stream #0:0: Video: h264 (Main), 1 reference frame, yuv420p, 640x360 (640x368), 29.97 tbr, 90k tbn, 180k tbc

Note that the commands above were run on my Fedora 24 desktop.

When I try any commands using ffmpeg on my Homeassistant server running Hassbian. I get the error below.

root@ha:/var/log# ffmpeg -v verbose -i rtsp://home:[email protected]:554/12 -vcodec mpeg4 -acodec aac output.mp4
Illegal instruction
root@ha:/var/log# ffmpeg -v
Illegal instruction
root@ha:/var/log# ffmpeg
Illegal instruction

Any ideas?

Note this is how I installed ffmpeg

added

deb Index of /debian jessie-backports main

to /etc/apt/sources.list

then installed as shown below.

apt-get --allow-unauthenticated install ffmpeg

Replying to myself again as I was able to get my camera working and I wanted to document how.

Note I was never able to get ffmpeg working, rather i went with avconv which I installed as shown below.

apt-get install --allow-unauthenticated libav-tools

I then symbolically linked avconv to ffmpeg

sudo ln -s /usr/bin/avconv /usr/bin/ffmpeg

This is what I added to configuration.yaml

camera 1:

  • platform: ffmpeg
    name: Outcam
    input: -rtsp_transport tcp -i rtsp://home:[email protected]:554/11

Camera seems to be functioning ok now - albeit very slow capture. So need to play around with it a bit.

1 Like

I have the same thing with ffmpeg. A bit slower than mjpeg on my two VStarcam cameras, but now I get full resolution where as with mjpeg, I got better motion but the images were tiny when you clicked on them.

I’m sticking with a slower capture rate that I can actually see…

Thanks good to know I am not alone. My living room camera, and the camera arriving today are both amcrest. These cameras work great. This cheapo SimpleHome Camera, well it’s ok.

I’m sure there is some setting I might be missing or have incorrect in ffmpeg, but I am not going to mess with it for now; as long as it’s working I’m good. It’s certainly an improvement over the tiny images I was getting from these HD cams.

I’ll report back if I can figure anything out. I have a new camera arriving today, so I will be busy with that one as well. Luckily, as I said in another post, its amcrest - so very easy.

This SimpleHome camera will not even register in its own app. I had to check dhcp logs to see what ip it received when I cabled it up and log into and configure it that way.

At least the video stream displays in their webUI natively. The amcrest webUI needs uses a google chrome app (at least on my fedora laptop) to view the stream.

1 Like

That would be awesome. Due to work on the HA Dash beta, I haven’t had any time for anything else lately.

Whenever I buy a cam the first thing I look at is that they have a webserver built in that I can access via a URL. That usually means that eventually I can figure out a way to get it into HA.