Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Freitag, 27. Juli 2018, 00:34

Dynamically set image.fisheye.crop

Hello,

I'm trying to set image.fisheye.crop from inside of an action but it doesn't seem to affect the image. Calling set() and then tracing get() shows the updated crop value, but it doesn't affect the display of the image. For reference, here is a minimal XML reproduction of what I'm doing:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<krpano debugmode="true" onstart="showlog();">
  <plugin name="video" videourl="video1080p.mp4" url.html5="plugins/videoplayer.js" muted="true" />
  <events onclick="cropvideo()" />
  <action name="cropvideo">
    trace('cropping image fisheye from: ', image.fisheye.crop);
    set(image.fisheye.crop,'0|1920|0|1080');
    trace('cropped image fisheye to: ', get(image.fisheye.crop));
  </action>
  <image hfov="180" vfov="90">
    <fisheye url="plugin:video" fov="180" crop="0|2560|0|1440" />
  </image>
</krpano>


A 1920x1080 video is being displayed on the fisheye image, and the crop on the fisheye is set at 2560x1440. The FOV is restricted to allow 180 horizontal panning but disallow vertical panning. As expected, there is some distortion and black background visible on the right edge when the crop dimensions are larger than the video dimensions. When the pano XML is loaded with an initial crop of the exact video dimensions (e.g. crop="0|1920|0|1080"), the result is a nice edge-to-edge video pano. There is an onlick action that attempts to crop the fisheye dynamically to the video dimensions, and trace its progress, which doesn't work. The log output shows the expected results, with the crop attribute changing:

Quellcode

1
2
INFO: cropping image fisheye from: 0|2560|0|1440
INFO: cropped image fisheye to: 0|1920|0|1080


I was expecting for the display to update along with the crop attribute, but it doesn't. Should I be approaching this a different way? For further background information, I'm working on an adaptive streaming video player plugin for fisheye videos that needs the image crop to update when the video dimensions change. I'm using krpano 1.19-pr16.