View unanswered posts | View active topics It is currently Thu Jul 24, 2014 6:55 am



Reply to topic  [ 10 posts ] 
[FIX] ZM 1.24.2: Broken DVR controls and progress for events 
Author Message

Joined: Wed Dec 16, 2009 5:32 pm
Posts: 665
Location: Israel
Post [FIX] ZM 1.24.2: Broken DVR controls and progress for events
EDIT: I just did a test and changed the streaming mode from mpeg to jpeg. jpeg streaming (mjpeg) works fine. So if your mpeg mode is broken, you can use this fix or switch to jpeg mode which is probably the better solution because zoom works there.

If your ZM's DVR controls and progress isn't broken when watching an event in mpeg streaming mode, don't use this fix. I made this thread to help people suffering from the same problem i had, as described in this thread.

When viewing an event, the DVR controls (play, pause, slow rev, etc) were broken for me, they did nothing. And the progress indicator was far off, 2 seconds into the event, it already showed progress at like 47 seconds, and within about 30 seconds to the event, the progress showed 10 min (end of video).
After some debugging, i realized that the streaming type ZM uses is buffered, it plays at your FPS setting, but ZM wasn't sending frames to it at your FPS rate, but rather at over 50+ frames/second, which is why the controls weren't working for me and the progress was far off.
I'm not sure if others are suffering from this aswell, but i got it to work properly by changing some of the code.
I told it to sleep always when not paused, and at a calculated rate (line borrowed from zm_monitor.cpp) based on the replay rate. 5 fps at normal replay rate means 200 milliseconds between frames, giving us 5 fps/second.

In file src/zm_event.cpp, change the following which starts at around line 1360 (May vary from installation to installation):
Code:
        if ( !paused )
        {
            curr_frame_id += replay_rate>0?1:-1;
            if ( send_frame && type != STREAM_MPEG )
            {
                Debug( 3, "dUs: %d", delta_us );
                usleep( delta_us );
            }
        }

To:
Code:
        if ( !paused )
        {
            curr_frame_id += replay_rate>0?1:-1;
            usleep((unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate))));
        }


Now recompile ZM and copy the compiled src/zms to your cgi-bin folder overwriting nph-zms and zms.

NOTE: When playing the video at high replay rate, the video may lag a little e.g. progress shows 5:30 min but actual video shows 4:50 min, video barely catching up with high replay rate.
I fixed that by going into Options and setting the maxfps for streaming for High,Medium and Low to my capture fps (5 in my case) and now its working perfectly.

mastertheknife.


Sat Feb 27, 2010 11:48 am
Profile

Joined: Wed Feb 17, 2010 2:57 am
Posts: 12
Post 
Hi, one question , qhen you say recompile is to make configure and then make???


Tue Mar 09, 2010 5:31 pm
Profile

Joined: Wed Dec 16, 2009 5:32 pm
Posts: 665
Location: Israel
Post 
make should be enough.

mastertheknife


Sun Mar 14, 2010 9:53 pm
Profile

Joined: Wed Mar 05, 2008 11:33 pm
Posts: 42
Location: Stanford-Le-Hope, Thurrock, Essex
Post Did not work for me
Hello

Using Zoneminder 1.24.2 with STREAM_METHOD jpeg.

This fix has not worked for me, my playback controls are not functioning at all and I see no movement in the progress bar. The recorded events do playback but I am just unable to control them (pause/play/rewind/forward).

The old method of playback in previous versions of Zoneminder worked flawlessly for me. Is there any way to revert to that method within this version?

Jason

_________________
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com


Sat Jun 19, 2010 1:11 pm
Profile WWW

Joined: Wed Dec 16, 2009 5:32 pm
Posts: 665
Location: Israel
Post 
The fix above is for MPEG mode.

For the controls to work you need some php extensions enabled such as sockets, try searching the forum.


Fri Sep 17, 2010 10:44 am
Profile

Joined: Wed Mar 05, 2008 11:33 pm
Posts: 42
Location: Stanford-Le-Hope, Thurrock, Essex
Post Recompiled PHP with sockets support
Thankyou, it worked a treat.

Added 'sockets' to the USE flags and recompiled PHP. Restarted Apache and now I am able to pause/start/rewind recorded events. The fps are also showing up now too.

Jason

_________________
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com


Sun Sep 19, 2010 5:54 pm
Profile WWW

Joined: Wed Dec 16, 2009 5:32 pm
Posts: 665
Location: Israel
Post 
Hi,

Thats good to hear!
Is the progress bar showing up? if not, please look into this bugfix:
http://www.zoneminder.com/forums/viewtopic.php?t=15387

mastertheknife.


Sun Sep 19, 2010 9:57 pm
Profile

Joined: Wed Mar 05, 2008 11:33 pm
Posts: 42
Location: Stanford-Le-Hope, Thurrock, Essex
Post Progress bar...
Yes its appearing fine.

It is also allowing me to zoom into the image when I click on it. But I am unsure how to zoom out again!

Jason

_________________
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com


Sun Sep 19, 2010 10:56 pm
Profile WWW

Joined: Wed Dec 16, 2009 5:32 pm
Posts: 665
Location: Israel
Post Re: Progress bar...
Jason_Bassett wrote:
Yes its appearing fine.

It is also allowing me to zoom into the image when I click on it. But I am unsure how to zoom out again!

Jason


You can un-zoom by using the minus button which is located in the controls :)


Sun Sep 19, 2010 11:00 pm
Profile

Joined: Wed Mar 05, 2008 11:33 pm
Posts: 42
Location: Stanford-Le-Hope, Thurrock, Essex
Post Suggestion
Ah I see, thanks.

It would be nice in future releases to be able to scroll around the zoomed in image instead of having to zoom out and then back in again. Or use a scroll mouse.

Jason

_________________
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com


Sun Sep 19, 2010 11:47 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group