Timeline shows just 1 frame / event

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Timeline shows just 1 frame / event

Post by Henri »

My configuration is ZM 1.34.11 running on Ubuntu 18.04
If i start timeline view for several (recording) events on one Monitor the Mouseover on the timeline shows just one frame per event.
That means if my event section lengt is 3 minutes the picture changes just every 3 timeline minutes on not as in 1.32.3 where i can see several pictures/frames during the timeline mouseover.
This makes the timeline useless because you can not find out what happens inside an event, specialy if your section lengt is high (10 minutes or more).
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Re: Timeline shows just 1 frame / event

Post by Henri »

Is there someone else with the same problem or is nobody using the timeline feature.
td
Posts: 20
Joined: Wed Sep 27, 2006 5:56 am
Location: Breckerfeld, Germany

Re: Timeline shows just 1 frame / event

Post by td »

Hello Henri,

same with me, version 1.34.21.
When hovering the mouse ove the timeline exactly one image is displayed. When hovering further the displayed image does not change.

Best
td
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

I'm seeing the same problem on 1.34.22 on Ubuntu 18.04.5. I just upgraded from 1.30.4 yesterday, and it was working fine before the upgrade.

I see it on monitors that are capturing jpg frames, as well as ones that are capturing h264 video. For the monitors recording video, I can see one NNNNN-capture.jpg get generated in the events directory, but no more if I move the mouse. If I go out and back into the timeline view, then it will generate one more -capture.jpg for a different frame.

So far I can't find any errors in the apache logs, or in the zoneminder logs (I even turned on debug logging for a bit).

--Lee
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Timeline shows just 1 frame / event

Post by burger »

Related: viewtopic.php?f=42&t=29925

I wonder if adding 'savejpegs' will fix the timeline. With just x264 encode, I'm guessing it uses the one jpeg from where the movies are stored, but per previous post, maybe not.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

burger wrote: Tue Dec 01, 2020 8:16 pm I wonder if adding 'savejpegs' will fix the timeline. With just x264 encode, I'm guessing it uses the one jpeg from where the movies are stored, but per previous post, maybe not.
I see the problem on monitors with savejpegs, and without. I could understand the convert from h264 to jpeg to cause an issue..... but it happens even when the *-capture.jpg files are already sitting in the events directory (monitors with savejpegs on).

--Lee
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

I did a little more digging, and I see about 3 or 4 GET requests in the apache logs to get 1 frame of an event in the timeline when I mouseover it.
But if I move the mouse around some more, no additional requests are sent from the browser to apache.

I'm thinking this problem is on the browser side of things.

I can see another 3-4 GETs if I move to a 2nd event in the same timeline, but if I then move back to the original event, there are no more requests made.
It seems we get one mouseover action fired per event, and then no more until you reload the page, or pan the timeline.

--Lee
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

I think I have a fix. The problem was that previewEvent() in timeline.js would never request additional frame data after it had data for 1 event in the frame. With this change it will now call requestFrameData() if it doesn't have the frame already.

Code: Select all

diff --git a/web/skins/classic/views/js/timeline.js b/web/skins/classic/views/js/timeline.js
index 8742ac67b..b517a6a82 100644
--- a/web/skins/classic/views/js/timeline.js
+++ b/web/skins/classic/views/js/timeline.js
@@ -132,7 +132,7 @@ function requestFrameData( eventId, frameId ) {
 function previewEvent(slot) {
   eventId = slot.getAttribute('data-event-id');
   frameId = slot.getAttribute('data-frame-id');
-  if ( events[eventId] ) {
+  if ( events[eventId] && events[eventId]['frames'][frameId] )  {
     showEventData(eventId, frameId);
   } else {
     requestFrameData(eventId, frameId);
It's working for me on 1.34.22, but I'll keep testing it out to make sure.
--Lee
td
Posts: 20
Joined: Wed Sep 27, 2006 5:56 am
Location: Breckerfeld, Germany

Re: Timeline shows just 1 frame / event

Post by td »

Wonderful and thank you!
Works fine for me.
But, on the risk of sounding naive: why are there so few experiencing this problem?

Best
td
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

I wondered the same thing at first. Maybe not many people use the timeline?? I haven't seen anyone post that the timeline was showing multiple frames per event for them in 1.34.

I started out assuming it was something broken in my upgrade from 1.29 to 1.34. But then found the apache logs weren't showing requests, then chased it into the browser.

It looks like its been this way since 29Sep2019. The old logic had 3 tests before it would call showEventDetail(), otherwise it would call requestFrameData(), so ended up making additional requests for new frames.

--Lee
td
Posts: 20
Joined: Wed Sep 27, 2006 5:56 am
Location: Breckerfeld, Germany

Re: Timeline shows just 1 frame / event

Post by td »

There are more things in Heaven and Earth …

Thank you.
td
leewells
Posts: 11
Joined: Tue Dec 01, 2020 4:06 pm

Re: Timeline shows just 1 frame / event

Post by leewells »

A slight tweak to the fix. I had seen an error in the log with the first version when I would mouse over events that were stored as mp4 files instead of image captures.

Code: Select all

diff --git a/web/skins/classic/views/js/timeline.js b/web/skins/classic/views/js/timeline.js
index 3eacc2529..44551824f 100644
--- a/web/skins/classic/views/js/timeline.js
+++ b/web/skins/classic/views/js/timeline.js
@@ -132,7 +132,7 @@ function requestFrameData( eventId, frameId ) {
 function previewEvent(slot) {
   eventId = slot.getAttribute('data-event-id');
   frameId = slot.getAttribute('data-frame-id');
-  if ( events[eventId] ) {
+  if ( events[eventId] && events[eventId]['frames'] && events[eventId]['frames'][frameId] )  {
     showEventData(eventId, frameId);
   } else {
     requestFrameData(eventId, frameId);
--Lee
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Re: Timeline shows just 1 frame / event

Post by Henri »

Thank you leewells this solved my problem :-)
Post Reply