RTSP (VLC) and ffmpeg syntax

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
YetAnotherDave
Posts: 11
Joined: Mon Oct 18, 2021 4:19 pm

RTSP (VLC) and ffmpeg syntax

Post by YetAnotherDave »

I just installed an IP5M-B1186EB camera. Everything works well so far, except I cannot get VLC or ffmpeg to work.

With ffmpeg I have tried:
  1. ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0 -vframes 1 testframe3.jpg
and other variants:
  • ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/cgi-bin/mjpg/video.cgi?channel=0&subtype=1 -vframes 1 testframe3.jpg
  • ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=00 -vframes 1 testframe3.jpg
  • ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/cam/realmonitor?channel=1 -vframes 1 testframe3.jpg
  • ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/h264Preview_01_main -vframes 1 testframe3.jpg
  • ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/h265Preview_01_main -vframes 1 testframe3.jpg

here's the "debug" output from ffmpeg using "option 1" above:

Code: Select all

Successfully parsed a group of options.
Opening an input file: rtsp://admin:[email protected]:554/cam/realmonitor?channel=1.
[tcp @ 0000016a5c13e080] No default whitelist set
[tcp @ 0000016a5c13e080] Original list of addresses:
[tcp @ 0000016a5c13e080] Address 192.168.210.120 port 554
[tcp @ 0000016a5c13e080] Interleaved list of addresses:
[tcp @ 0000016a5c13e080] Address 192.168.210.120 port 554
[tcp @ 0000016a5c13e080] Starting connection attempt to 192.168.210.120 port 554
[tcp @ 0000016a5c13e080] Successfully connected to 192.168.210.120 port 554
[rtsp @ 0000016a5c13cfc0] method DESCRIBE failed: 404 Not Found
[rtsp @ 0000016a5c13cfc0] CSeq: 3
WWW-Authenticate: Digest realm="Login to AMCxxxxxxx2", nonce="xxxxxxxxxx"

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1: Server returned 404 Not Found
'subtype' is not recognized as an internal or external command,
operable program or batch file.
Any correction to what I've specified is welcome. Thanks!
YetAnotherDave
Posts: 11
Joined: Mon Oct 18, 2021 4:19 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by YetAnotherDave »

I searched the User Manual at https://drive.google.com/u/0/uc?id=14Dt ... t=download for an alternate RTSP url. I didn't find any specification for an RTSP url in the manual.
User avatar
Revo2Maxx
Site Admin
Posts: 5820
Joined: Sat Jun 15, 2019 3:05 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by Revo2Maxx »

Hello and Welcome to the forum

please run this and let me know what version comes back
http://yourip/cgi-bin/IntervideoManager ... n&Name=CGI

I have some that come back to 1.40 and some that come back to 2.77
Here to help the best I can.
Be Safe
User avatar
Revo2Maxx
Site Admin
Posts: 5820
Joined: Sat Jun 15, 2019 3:05 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by Revo2Maxx »

If I had to guess your trying to run a command for a older camera format and I am guessing that your camera is JS and the format your trying is for non JS cameras.. Also not sure that your camera supports ffmpeg
Here to help the best I can.
Be Safe
jack7
Posts: 904
Joined: Tue May 29, 2018 7:46 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by jack7 »

This is the one that should work to display main stream video when placed in PC VLC Open Network Stream field.

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0

It's described in the Amcrest API pdf.
https://support.amcrest.com/hc/en-us/ar ... 080P-HD-CV

Amcrest does not use mjpeg streams in recent cameras.
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by GaryOkie »

Since the debug log says "subtype" is not recognized as a command what must be happening is that the shell you are executing the command in is interpreting the "&" to run the following text as a separate command asynchronously. This is normal behavior for a shell. Try just putting a backslash before the & to escape this.

Now, the & would not be an issue in VLC's UI and would not need escaping. The syntax in your first example looks good to me for creating a snapshot/jpeg from the first frame of the stream.

Do you have a VLC error log?
YetAnotherDave
Posts: 11
Joined: Mon Oct 18, 2021 4:19 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by YetAnotherDave »

GaryOkie wrote: Tue Oct 19, 2021 9:47 pm Since the debug log says "subtype" is not recognized as a command what must be happening is that the shell you are executing the command in is interpreting the "&" to run the following text as a separate command asynchronously. This is normal behavior for a shell. Try just putting a backslash before the & to escape this.

Now, the & would not be an issue in VLC's UI and would not need escaping. The syntax in your first example looks good to me for creating a snapshot/jpeg from the first frame of the stream.

Do you have a VLC error log?
The "\" fixed the ffmpeg issue. Original failure in Windows 10 command prompt, haven't actually gotten it to work there, but works fine on debian, vanilla "sh".

The VLC issue was an embarrassing typo/bad cut&paste that I didn't see until the light of a new day.

On to getting it to work in Home Assistant.

Thanks all!!!
YetAnotherDave
Posts: 11
Joined: Mon Oct 18, 2021 4:19 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by YetAnotherDave »

Revo2Maxx wrote: Tue Oct 19, 2021 12:25 pm Hello and Welcome to the forum

please run this and let me know what version comes back
http://yourip/cgi-bin/IntervideoManager ... n&Name=CGI

I have some that come back to 1.40 and some that come back to 2.77
returned value = 2.77

Do you know of a general "capabilities" query?

thanks!
YetAnotherDave
Posts: 11
Joined: Mon Oct 18, 2021 4:19 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by YetAnotherDave »

jack7 wrote: Tue Oct 19, 2021 4:56 pm This is the one that should work to display main stream video when placed in PC VLC Open Network Stream field.

rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0

It's described in the Amcrest API pdf.
https://support.amcrest.com/hc/en-us/ar ... 080P-HD-CV

Amcrest does not use mjpeg streams in recent cameras.
Yep. worked (note "\") as suggest by @GaryOkie

Code: Select all

#!/bin/sh
ffmpeg -loglevel debug -y -rtsp_transport tcp -i rtsp://admin:[email protected]:554/cam/realmonitor?channel=1\&subtype=0 -vframes 1 testframe3.jpg
thanks!!
User avatar
Revo2Maxx
Site Admin
Posts: 5820
Joined: Sat Jun 15, 2019 3:05 pm

Re: RTSP (VLC) and ffmpeg syntax

Post by Revo2Maxx »

I personally don't I am sure if there was a command @GaryOkie would be better suited to offer that query. He has more knowing in the CGI. In general for me I have my cameras connected to NVR's and DVR's and don't do much outside the normal FTP or Device Recordings.. Also jack7 might also know the command your looking for as well.
Here to help the best I can.
Be Safe
Post Reply