Help, problem in STILL MODE - not continuous

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Help, problem in STILL MODE - not continuous

Post by victor_diago »

hi all and Phil.

Running 1.22.0, ive discovered that if you are in record mode, when you are watching an event that has say 300seconds (5 minutes) and click in the still mode, ONLY THE 4 FIRST IMAGES ARE SHOWN.


All the other images appear as broken. but if you leave it at continuous mode, it will play very well... ive searched and found that when you look at source code, you can see the bug :

Code: Select all

<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=97&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="97/0"></a>

<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=98&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="98/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=99&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="99/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=100&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000100-capture.jpg" width="80" height="60" class="normal" alt="100/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=101&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="101/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=102&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="102/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=103&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="103/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=104&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="104/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=105&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="105/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=106&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="106/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=107&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="107/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=108&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="108/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=109&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="109/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=110&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="110/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=111&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="111/0"></a>
<a href="javascript: newWindow( '/zm.php?view=frame&eid=27719&fid=112&scale=100', 'zmImage', 368, 320 );"><img src="events/7/27719/000000-capture.jpg" width="80" height="60" class="normal" alt="112/0"></a>
</div></td></tr>
LOOK the problem is events/7/27719/000000-capture.jpg

The first 4 images appears ok. The image number 100 also appears ok and the last image too.

Ive searched in zm_funcs.php for any bug in thumb_path but have found NOTHING.

Anyone could help ? or else has this problem ?

Thanks

Victor Diago
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi again.


Also ive found that make a video with ffmpeg doesnt work.


this is the result of zmvideo.log

Code: Select all

03/29/2006 01:29:49.176710 zmvideo[32496].INF [Creating video file Evento-34-r1-s1.mpg for event 34]
03/29/2006 01:29:49.177301 zmvideo[32496].INF [/usr/local/bin/ffmpeg -y -r 2.30  -i 000-capture.jpg -s  320x240 -hq 'Evento-34-r1-s1.mpg' > ffmpeg.log]
03/29/2006 01:29:49.187563 zmvideo[32496].INF []
AGAIN look the 000-capture.jpg bug.

Thanks

Victor Diago
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi again.


i also have the problem with jpeg file quality.

i have tested a lot of numbers, from 20 to 100 and ALL give-me the same quality (seems to be aways 70);


Thanks

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

Post by zoneminder »

victor_diago wrote:

Code: Select all

03/29/2006 01:29:49.176710 zmvideo[32496].INF [Creating video file Evento-34-r1-s1.mpg for event 34]
03/29/2006 01:29:49.177301 zmvideo[32496].INF [/usr/local/bin/ffmpeg -y -r 2.30  -i 000-capture.jpg -s  320x240 -hq 'Evento-34-r1-s1.mpg' > ffmpeg.log]
AGAIN look the 000-capture.jpg bug.
The 000 is just a result of the %03d being replaced in the debug output. The actual command is correct. I will fix this anyway in 1.22.1 but it won't change that actually gets run.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: Help, problem in STILL MODE - not continuous

Post by zoneminder »

victor_diago wrote:Running 1.22.0, ive discovered that if you are in record mode, when you are watching an event that has say 300seconds (5 minutes) and click in the still mode, ONLY THE 4 FIRST IMAGES ARE SHOWN.
You are correct here. I have just fixed this for 1.22.1, thanks for reporting it.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

victor_diago wrote:i also have the problem with jpeg file quality.

i have tested a lot of numbers, from 20 to 100 and ALL give-me the same quality (seems to be aways 70);
See other thread on this topic.
Phil
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi phil.

You said "thanks" for me ?

Thanks YOU man, that are developing this fantastic tool.

Also, do you have any patch for this version ? it would be great.


Thanks for all

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

Post by zoneminder »

Try this (not guaranteed :lol: )

Code: Select all

diff -c -r1.68 zm_html_view_event.php
*** zm_html_view_event.php      17 Jan 2006 21:22:05 -0000      1.68
--- zm_html_view_event.php      30 Mar 2006 22:19:56 -0000
***************
*** 441,465 ****
  {
        if ( $paged && !empty($page) )
        {
!               $lo_frame_id = (($page-1)*$frames_per_page)+1;
                $hi_frame_id = min( $page*$frames_per_page, $event['Frames'] );
        }
        else
        {
!               $lo_frame_id = 1;
                $hi_frame_id = $event['Frames'];
        }
        $sql = "select * from Frames where EventId = '$eid'";
-       if ( $paged && !empty($page) )
-               $sql .= " and FrameId between $lo_frame_id and $hi_frame_id";
        $sql .= " order by FrameId";
        $result = mysql_query( $sql );
        if ( !$result )
                die( mysql_error() );
        $frames = array();
        while( $frame = mysql_fetch_assoc( $result ) )
        {
!               $frames[$frame['FrameId']] = $frame;
        }
        mysql_free_result( $result );
  ?>
--- 441,465 ----
  {
        if ( $paged && !empty($page) )
        {
!               $lo_frame_id = (($page-1)*$frames_per_page);
                $hi_frame_id = min( $page*$frames_per_page, $event['Frames'] );
        }
        else
        {
!               $lo_frame_id = 0;
                $hi_frame_id = $event['Frames'];
        }
        $sql = "select * from Frames where EventId = '$eid'";
        $sql .= " order by FrameId";
+       if ( $paged && !empty($page) )
+               $sql .= " limit $lo_frame_id, $hi_frame_id";
        $result = mysql_query( $sql );
        if ( !$result )
                die( mysql_error() );
        $frames = array();
        while( $frame = mysql_fetch_assoc( $result ) )
        {
!               $frames[] = $frame;
        }
        mysql_free_result( $result );
  ?>
***************
*** 471,482 ****
        $thumb_height = (int)round($event['Height']/ZM_WEB_FRAMES_PER_LINE);
        $thumb_scale = (int)round( SCALE_BASE/ZM_WEB_FRAMES_PER_LINE );
  
!       for ( $frame_id = $lo_frame_id; $frame_id <= $hi_frame_id; $frame_id++ )
        {
!               $frame = $frames[$frame_id];
                $image_data = getImageSrc( $event, $frame, $thumb_scale );
  ?>
! <a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame_id ?>&scale=<?= $scale ?>', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w']  ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><img src="<?= $image_data['thumbPath'] ?>" width="<?= $thumb_width ?>" height="<?= $thumb_height ?>" class="<?= $image_data['imageClass'] ?>" alt="<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>"></a>
  <?php
        }
  ?>
--- 471,482 ----
        $thumb_height = (int)round($event['Height']/ZM_WEB_FRAMES_PER_LINE);
        $thumb_scale = (int)round( SCALE_BASE/ZM_WEB_FRAMES_PER_LINE );
  
!       for ( $i = 0; $i < $frames_per_page; $i++ )
        {
!               $frame = $frames[$i];
                $image_data = getImageSrc( $event, $frame, $thumb_scale );
  ?>
! <a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame['FrameId'] ?>&scale=<?= $scale ?>', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w']  ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><img src="<?= $image_data['thumbPath'] ?>" width="<?= $thumb_width ?>" height="<?= $thumb_height ?>" class="<?= $image_data['imageClass'] ?>" alt="<?= $frame['FrameId'] ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>"></a>
  <?php
        }
  ?>
I haven't properly tested this with other event types yet but it seems to work with Recorded events and I _think_ it should ge ok in general.
Phil
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Thanks for this Phil.

A question, i should copy this to a file right, then apply patch -p0 ?

Could you post here how do i do that ?


Thanks for now

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

Post by zoneminder »

Yes, pretty much.

Create a file with the above patch in and then just run something like 'patch -p0 < patch.txt'. I _think_ that should be all you need to do.
Phil
vahan1
Posts: 15
Joined: Sat Apr 01, 2006 4:33 am

Post by vahan1 »

Phil,

Do you think you could post the whole php file as an attachment or something? I'm having issues patching it and even if I update it manually, I'm not getting expected behavior.

Thanks a lot.

p.s. newbie, getting setup. had lotsa issues, getting slowly worked out - next big one is streaming into firefox :roll: Thanks for all the hard work and support!
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

Hi all and phil.


Really, i had problem patching it too.

Should be better to let us download THese files.


Im waiting , much thanks to you.

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

Post by zoneminder »

It might be easier at your end but it's more fiddly at my end. I can't usually just upload the file as it will contain elements of other changes so I have to poke around and try and reconstruct the file. It may well be that is why the patch is failing. The best thing is to wait a couple of days for 1.22.1 and apply that.
Phil
vahan1
Posts: 15
Joined: Sat Apr 01, 2006 4:33 am

Post by vahan1 »

Thanks Phil.

I got the streaming working, so I'm good for now - looking forward to 1.22.1

Thanks a lot!
v
Locked