No pictures when viewing via rtsp

Forum for questions and support relating to the 1.24.x releases only.
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

No pictures when viewing via rtsp

Post by richw »

I've got a ACM1231 IP camera and i'm now trying to get the monitor pop up working but all I get is a black block where the image is suppose to be. I've set the res to 640x480 (and lower) with fps @ 30 for testing.

I'm using RTSP as the protocol, with RTP/RTSP as the method. I've had a little fiddle and any other settings and the monitor popup give a "image not found" icon. I believe everything else is set correctly.

Looking though the logs I found this in the zmdc.log :
09/29/2008 11:53:16.015275 zmdc[3348].INF [Starting pending process, zmc -m 1]
09/29/2008 11:53:16.020666 zmdc[3348].INF ['zmc -m 1' starting at 08/09/29 11:53:16, pid = 4021]
09/29/2008 11:53:17.141785 zmdc[3348].ERR ['zmc -m 1' exited abnormally, exit status 6]
09/29/2008 11:53:27.057247 zmdc[3348].INF [Starting pending process, zmc -m 1]
09/29/2008 11:53:27.068662 zmdc[3348].INF ['zmc -m 1' starting at 08/09/29 11:53:27, pid = 4024]
09/29/2008 11:53:28.163137 zmdc[3348].ERR ['zmc -m 1' exited abnormally, exit status 6]
Its just full of these, so I'm guessing the camera is throwing out something the capture daemon isn't liking? What does the 'exit status 6' mean?

I've also got some "PHP Notice: Undefined index:" messages in the apache error_log file but I don't think these are relevant? I might just pop them in another thread.

Rich
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What's in /var/log/messages etc?

Also please post any 'undefined' messages from your web logs as (with one or two exceptions) these should have been eliminated.
Phil
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

Hi,

In my error_log:
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MaxBandwidth in /var/www/html/zm/skins/classic/views/console.php on line 229
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MonitorIds in /var/www/html/zm/skins/classic/views/console.php on line 262
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MonitorIds in /var/www/html/zm/skins/classic/views/console.php on line 334
in my /var/log/messages:
Sep 29 12:33:55 bbcamtest zmc_m1[4178]: INF [Debug Level = 0, Debug Log = <none>]
Sep 29 12:33:55 bbcamtest zmc_m1[4178]: INF [Starting Capture]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Unexpected response code 404, text is 'Stream Not Found']
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: FAT [Unable to get session identifier from response 'RTSP/1.0 404 Stream Not Found
CSeq: 2
Date: Mon, Sep 29 2008 11:33:55 GMT

']
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: INF [Got signal 6 (Aborted), crashing]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Signal address is (nil), from 0x3b8402 ]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: [0x3b8402]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: [0x3b8402]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(gsignal+0x50) [0x5bed20]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(abort+0x101) [0x5c0631]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x80550aa]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x8083dcf]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x8087ff1]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libpthread.so.0 [0x72e46b]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(clone+0x5e) [0x666dbe]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: INF [Backtrace complete]
Sep 29 12:33:56 bbcamtest zmdc[3348]: ERR ['zmc -m 1' exited abnormally, exit status 6]
Sep 29 12:36:21 bbcamtest ntpd[1857]: time reset -1.174829 s
Sep 29 12:39:52 bbcamtest ntpd[1857]: synchronized to LOCAL(0), stratum 10
Sep 29 12:41:38 bbcamtest ntpd[1857]: synchronized to 10.0.0.25, stratum 4
:oops:

I've just had a go with openRTSP and the last part of its output included:
Received PLAY response: RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Sep 29 2008 11:44:41 GMT
Range: npt=0.000-
Session: 48
RTP-Info: url=rtsp://10.0.0.230:7070/track1;seq=32098
so I'm guessing the stream is in track1? Should I be adding track1 anywhere or should zm be finding this by itsself?

openRTSP and ffmpeg doesn't require anything more than the ip address and port number!
curtishall
Posts: 440
Joined: Sat Sep 25, 2004 12:45 am
Location: Fulton, MO

Post by curtishall »

What's the streaming method? TCP or RTP over UDP?
richw wrote:Hi,

In my error_log:
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MaxBandwidth in /var/www/html/zm/skins/classic/views/console.php on line 229
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MonitorIds in /var/www/html/zm/skins/classic/views/console.php on line 262
[Mon Sep 29 12:28:16 2008] [error] [client 10.0.0.104] PHP Notice: Undefined index: MonitorIds in /var/www/html/zm/skins/classic/views/console.php on line 334
in my /var/log/messages:
Sep 29 12:33:55 bbcamtest zmc_m1[4178]: INF [Debug Level = 0, Debug Log = <none>]
Sep 29 12:33:55 bbcamtest zmc_m1[4178]: INF [Starting Capture]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Unexpected response code 404, text is 'Stream Not Found']
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: FAT [Unable to get session identifier from response 'RTSP/1.0 404 Stream Not Found
CSeq: 2
Date: Mon, Sep 29 2008 11:33:55 GMT

']
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: INF [Got signal 6 (Aborted), crashing]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Signal address is (nil), from 0x3b8402 ]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: [0x3b8402]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: [0x3b8402]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(gsignal+0x50) [0x5bed20]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(abort+0x101) [0x5c0631]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x80550aa]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x8083dcf]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /usr/local/bin/zmc [0x8087ff1]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libpthread.so.0 [0x72e46b]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: ERR [Backtrace: /lib/libc.so.6(clone+0x5e) [0x666dbe]]
Sep 29 12:33:56 bbcamtest zmc_m1[4178]: INF [Backtrace complete]
Sep 29 12:33:56 bbcamtest zmdc[3348]: ERR ['zmc -m 1' exited abnormally, exit status 6]
Sep 29 12:36:21 bbcamtest ntpd[1857]: time reset -1.174829 s
Sep 29 12:39:52 bbcamtest ntpd[1857]: synchronized to LOCAL(0), stratum 10
Sep 29 12:41:38 bbcamtest ntpd[1857]: synchronized to 10.0.0.25, stratum 4
:oops:

I've just had a go with openRTSP and the last part of its output included:
Received PLAY response: RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Sep 29 2008 11:44:41 GMT
Range: npt=0.000-
Session: 48
RTP-Info: url=rtsp://10.0.0.230:7070/track1;seq=32098
so I'm guessing the stream is in track1? Should I be adding track1 anywhere or should zm be finding this by itsself?

openRTSP and ffmpeg doesn't require anything more than the ip address and port number!
--
Curtis Hall
Bluecherry
www.bluecherrydvr.com
store.bluecherry.net
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

RTP over UDP
curtishall
Posts: 440
Joined: Sat Sep 25, 2004 12:45 am
Location: Fulton, MO

Post by curtishall »

richw wrote:RTP over UDP
Did you use the ACTi preset when adding the monitor or did you set it up manually?

My configuration is:

Source tab:

Remote Procotol: RTSP
Remote Method: RTP/Unicast
Hostname: Login:Password@hostname
Host port: 7070
Host path: <blank>
Host subpath: /track
Colour: 24bit

Resolution is 640x480
--
Curtis Hall
Bluecherry
www.bluecherrydvr.com
store.bluecherry.net
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

I did set it up manually but I've just tired a preset to see if that would make any difference.

The good news is now I get another error message!

from /var/log/messages:
Sep 29 14:31:31 bbcamtest zmdc[5892]: INF ['zmc -m 1' started at 08/09/29 14:31:31]
Sep 29 14:31:31 bbcamtest zmdc[3348]: INF ['zmc -m 1' starting at 08/09/29 14:31:31, pid = 5892]
Sep 29 14:31:31 bbcamtest zmc_m1[5892]: INF [Debug Level = 0, Debug Log = <none>]
Sep 29 14:31:31 bbcamtest zmwatch[3389]: INF ['zmc -m 1' starting at 08/09/29 14:31:31, pid = 5892]
Sep 29 14:31:31 bbcamtest zmc_m1[5892]: INF [Starting Capture]
Sep 29 14:31:35 bbcamtest zmc_m1[5892]: ERR [RTP timed out]
Sep 29 14:31:35 bbcamtest zmc_m1[5892]: ERR [Unexpected response code 461, text is 'Unsupported Transport']
Sep 29 14:31:35 bbcamtest zmc_m1[5892]: ERR [Response parse failure in '']
Sep 29 14:31:42 bbcamtest zmc_m1[5892]: ERR [RTCP timed out]
Sep 29 14:31:44 bbcamtest zmc_m1[5892]: ERR [Cannot precapture, no RTP sources]
Sep 29 14:31:44 bbcamtest zmc_m1[5892]: ERR [Failed to pre-capture monitor 0]
Sep 29 14:31:44 bbcamtest zmdc[3348]: INF ['zmc -m 1' exited normally]
Sep 29 14:31:51 bbcamtest zmwatch[3389]: ERR [Can't get shared memory id '7a6d0001', 1: No such file or directory]
Sep 29 14:31:51 bbcamtest zmwatch[3389]: INF [Restarting capture daemon for bbcam, shared data not valid]
It's been left on the preset and I wan't using auth to log into the camera before and I've just given it a go and it makes no difference.

Camera wise I've got:

Streaming Method: RTP Over UDP
RTSP Authen Enable: unticked (have tired ticked with username and password in ZM)
RTP B2 Frame Enable: ticked (this has been unticked too)
Resolution: N640x480
Frame Rate Mode: Constant
Frame Rate: 30
Encoder Type: MPEG4
Video Bitrate Mode: Variable Bit Rate
Video Quality: HIGH
<serial>
RTSP Port: 7070
Video Control Port: 6001

I've had problems with ffmpeg under linux picking up the steam, could this be the problem now?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

The unsupported transport errors are red herrings and are generated when it's trying to close the stream. The important one is the RTP timed out one. What often catches me out is firewall settings as the camera will try and fire UDP packets back to the zmc process on your server and if you haven't allowed the port ranges through then it will time out.

If you can, try it with no firewall and see if that makes a difference. If so then you can be more selective about what you let through. The RTP over RTSP or HTTP methods don't have this issue as they are tunnelled.
Phil
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

Good news: It works! I did have to turn off the firewall to get the camera working (not experimented which ports need to be open yet)

Bad news: I've had to turn the FPS down from the camera, I keep getting the picture stuck with a multicoloured outline of the moving object - it doesn't happen so much when I turn down the FPS (only a little).

The other problem being that ZM doesn't like it one bit when I try for a megapixel resolution.

I'm also getting my /var/log/message file filing up with "Packet in sequence, gap X" and "Discarding partial frame" or "Discarding frame" errors. I assume using the "--logfile=" (pointing to a new file) would dump these messages into another file or is it related to the other logs?

edit: I couldn't get the camera working with any other settings.
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

Graphics glitches fixed by using a constant bit rate.

Still no luck with 1280x1024 or 1280x720
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What do you get if you try megapixel?
Phil
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

It seem's to be working, I did notice an error about shared memory and thread I read mentioned about a reboot, 1 reboot later and it was working.

The first time I open the window there seems a big delay (10+ seconds) the 2nd time it seems to be quicker.

I'm still having problems with 'corrupt' images on the monitoring window - I know on VLC the picture is perfect. I do sometimes see a high load (like over 1, normally 1.8 ish). Do you have a simple diagram of how the RTSP works? Does it use ffmpeg?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Yes and no and a bit.

Ffmpeg does not seem to have a proper RTP implementation as a client anyway. It has a redimentary server one I think. So the RTP and RTSP stuff is all written from scratch, and as such may need some changes or fixes.

When the RTP threads get a picture they pass it to the ffmpeg library in order to extract a jpeg frame from the mpeg feed. At this stage ffmpeg complains (a lot) about most frames. Currently I have silenced it as it fills up logs but if you want to re-enable it set the zmc debug level to 1 or more or edit zm_remote_camera_rtsp.cpp and find

Code: Select all

    if ( zm_dbg_level > ZM_DBG_INF )
        av_log_set_level( AV_LOG_DEBUG );
    else
        av_log_set_level( AV_LOG_QUIET );
then comment out all but the second line, rebuild and reinstall edit.

Despite the complaints the images appear to be extracted ok mostly (except where obviously broken by missing packets) so I don't know what the errors relate to. MPEG decoding etc is outside of my comfort zone but I haven't found any obvious issues.

The other place where ffmpeg is used (a bit) is in SDP processing. The ffmpeg libraries contain some useful code for this. Unfortunately most of it is not exported so zm_sdp.{h,cpp} are bits of ffmpeg that have been pulled out to be used. Hopefully ffmpeg will export the sdp_parser at some point and I can then remove it.

By the way Axis cameras appear to be more resilient than ACTi ones which seem to have more flaky streams and I don't think are 100% standards compliant.
Phil
richw
Posts: 20
Joined: Wed Sep 24, 2008 9:57 am

Post by richw »

Thanks for taking time to explain it.

It's annoying to know that VLC can pull a near prefect (apart from the slightly poor picture quality) stream from the camera and ffmpeg can't. I think I need to have a play with ffmpeg versions.

When I return to getting ZM working with this camera I'll post some of the logs and I will also give it a go on Fedora 9 incase that makes any difference for me.

Hopefully ACTI will keep to there word and release a new firmware in December...hopefully they would have done some work on the streams...
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Although RTP is not hugely complicated it not beyonds the bounds of possibility that it may the ZM code that is buggering things. The more hands get to play with it with more cameras the better idea we will get whether that is the case or not.

Ffmpeg is very complicated and a constantly moving target so it is always difficult to compare implementations.
Phil
Locked