Page 1 of 1

Framerate limit for asf streaming (urgent)

Posted: Sun Mar 06, 2005 9:13 am
by loop
How can be mpeg or mjpeg video streaming from ZM limited to, for example 1 fps, where this camera is being recorded at 20 fps?

Thank you,
Darko

Posted: Sun Mar 06, 2005 6:04 pm
by fernando
if is on modect yes. have to ZM_NO_MAX_FPS_ON_ALARM on.

Posted: Sun Mar 06, 2005 6:33 pm
by loop
Thank you Fernando, but we don't have this option checked. The problem is that we want to capture at fixed 5fps (he have Maximum fps set to 5), but we want to stream only at 1 fps.

Posted: Mon Mar 07, 2005 12:30 am
by zoneminder
Have you tried modifying the ZM_WEB_x_VIDEO_MAXFPS settings on Options->High B/W (plus Medium, Low etc).

It's not a per monitor settings but should limit the rate at which you see all streams.

Phil

Posted: Mon Mar 07, 2005 8:58 am
by loop
Have tried, but no change. If camera's MAX_FPS is set to 10 then it's also streamed at 10fps, even when we set ZM_WEB_x_VIDEO_MAXFPS to 1 fps.

Posted: Mon Mar 07, 2005 9:14 am
by zoneminder
I will look into this and see if I can find where there might be a problem.

Phil

Posted: Tue Mar 08, 2005 6:50 pm
by loop
Thank you Phil. I'm working on some special low bandwidth streaming where the fps streaming limitation would be great.

Posted: Tue Mar 08, 2005 9:05 pm
by zoneminder
I've found the problem with this. I have fixed it for the next version but I can post the changes you would need to make here if you would prefer. It's only a couple of lines really.

Phil

Posted: Tue Mar 08, 2005 11:47 pm
by victor_diago
Hi phil.

is there a way to limit the java streaming aswell ?
i would like also to capture at 7 fps but record at 2 fps, i know that there is a way with record mode, but not modect, and is another way setting two cameras for the same video source, but as i use multiplexed bt878 cards this makes capture even slower.

is there a way ?

thanks you

victor diago

Posted: Wed Mar 09, 2005 7:19 am
by loop
Yes Phil, I'd appreciate if you would post the changes here already.
Thank you.

Posted: Thu Mar 10, 2005 11:51 am
by zoneminder
Assuming you have the latest version, edit zm_monitor.cp and go to line 1411. Change the line

Code: Select all

VideoStream vid_stream( "pipe:", format, bitrate, fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE );
to

Code: Select all

VideoStream vid_stream( "pipe:", format, bitrate, effective_fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE );
ie. change fps to effective_fps. Then go down a few lines until you see

Code: Select all

            if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) )
            {
                last_read_index = shared_data->last_write_index;
and move the last_read index line above the 'if' leaving you with

Code: Select all

            last_read_index = shared_data->last_write_index;
            if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) )
            {
I think that should do it. I'm still researching this as I can't exactly work out why the second chage should make a positive difference but it seems to. So the real fix may be slightly different however this should get you going.

Phil

Posted: Fri Mar 11, 2005 9:55 pm
by victor_diago
Hi phil,

This is a urgent problem for me, could you please take a look ? i will learn about encoding mpeg and try too look at code too, this is casing me headaches !!!!

sometimes, when using mplayer (or ffplay directly) i cant connect to the mpeg stream, it gives me this error :

Code: Select all

Playing http://localhost/cgi-bin/zms?mode=mpeg&monitor=1&scale=100&bitrate=150000&maxfps=15&format=asf. 
Resolving localhost for AF_INET... 
Connecting to server localhost[127.0.0.1]:80 ... 
Resolving localhost for AF_INET... 
Connecting to server localhost[127.0.0.1]:80 ... 
size_confirm mismatch!: 30130 43520 
Error while parsing chunk header 
Trying default streaming for http protocol 
 Resolving localhost for AF_INET... 
Connecting to server localhost[127.0.0.1]:80 ... 
Cache size set to 0 KBytes 
Connected to server: localhost 
Stream not seekable! 


Exiting... (End of file) 
If i try sometimes, i can connect and watch stream, but it gives me another errors as output. Then, the delay from captured image to showed one, tha was usually 2 seconds, gradually grow and in four hours i have about 8 seconds delay.

Code: Select all

error while decoding block: 19 x 14 (5) 
[msmpeg4 @ 0x85bc7a0]Error at MB: 313 
[msmpeg4 @ 0x85bc7a0]concealing 2147483647 errors 
[msmpeg4 @ 0x85bc7a0]overreading 4 bits                                          
[msmpeg4 @ 0x85bc7a0]concealing 900 errors 
[msmpeg4 @ 0x85bc7a0]ac-tex damaged at 19 14                                    
[msmpeg4 @ 0x85bc7a0] 
error while decoding block: 19 x 14 (5) 
[msmpeg4 @ 0x85bc7a0]Error at MB: 313 
[msmpeg4 @ 0x85bc7a0]concealing 2147483647 errors 
[msmpeg4 @ 0x85bc7a0]ac-tex damaged at 19 14                                    
[msmpeg4 @ 0x85bc7a0] 
error while decoding block: 19 x 14 (5) 
[msmpeg4 @ 0x85bc7a0]Error at MB: 313 
[msmpeg4 @ 0x85bc7a0]concealing 2147483647 errors 
[msmpeg4 @ 0x85bc7a0]ac-tex damaged at 19 14                                    
[msmpeg4 @ 0x85bc7a0] 
error while decoding block: 19 x 14 (5) 
[msmpeg4 @ 0x85bc7a0]Error at MB: 313 
[msmpeg4 @ 0x85bc7a0]concealing 2147483647 errors