SCENE-CE / mirador-video

An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.
https://projectmirador.org
Apache License 2.0
4 stars 0 forks source link

Mirador video annotation playback, wrong origin #4

Open daxid opened 1 month ago

daxid commented 1 month ago

Manifest URLs: https://files.tetras-libre.fr/dev/vertical_video_with_annot.json

Open the above manifest URL in Mirador Video. It is a vertical video with an annotation targeted at #xywh=0,0,400,400&t=0,12

You can see the origin 0,0 used in the target correspond to the upper-left corner of the PLAYER when it should be the corner of the VIDEO.

I think that this problem can have caused issues in the following : https://github.com/SCENE-CE/mirador-annotation-editor/issues/90****

geourjoa commented 1 month ago

@daxid

I dont see the annotation in Mirador (in the side list or on the video). But I see the annotation on the manifest file Did you have tested the manifest ? And if working, where ?

geourjoa commented 1 month ago

I have tested on Mirador Video alone, Mirador 4 with MAE and on Arvest Dev (MMU so MV with MAEV))

daxid commented 1 month ago

Well, the annotation is not appearing in the side panel probably because the motivation is off. I thought that painting was the one to have it displayed in the side panel. I must have been mistaken. You can always change it in https://filebrowser.tetras-libre.fr/.

The annotation still appears on mouse over :

image

geourjoa commented 1 month ago

Ok on mouse over I See it

geourjoa commented 1 month ago

image

SOme progress !

daxid commented 1 month ago

Quick progress indeed !! :-)

geourjoa commented 1 month ago

Do you have landscape video manifest with annotation ?

daxid commented 1 month ago

There you go :

https://files.tetras-libre.fr/dev/cats_video_with_annot.json

Same as before, the annotation only appears on mouseover

geourjoa commented 1 month ago

Additional inputs

--> Start from the branch 4-fix-orign-on-video/

The most important file is src/components/VideoViewer.js

This file hold the component displaying the video.

VideoViewer.js

<StyledContainer>
    {video && (
        <>
            <StyledVideoContent>
                <StyledVideo key={video.id} ref={this.videoRef} {...videoOptions}>
                    <source src={video.id} type={video.getFormat()}/>
                    {vttContent.map(vttc => (
                        <track key={vttc.id} src={vttc.id} srcLang={vttc.language}/>))}
                </StyledVideo>
                <AnnotationsOverlayVideo windowId={windowId} videoRef={this.videoRef}
                                         videoTarget={videoTargetTemporalfragment}
                                         key={`${windowId} ${video.id}`} style={{height: '100%', border: '3px solid orange'}}/>
            </StyledVideoContent>
            <WindowCanvasNavigationControlsVideo windowId={windowId}/>
        </>
    )}
</StyledContainer>

CSS stuff of styledContainer, styleVideoContent and styledVideo are on top of VideoViewer

The other interesting file is src/components/AnnotationsOverlayVideo.js, which contains the annotation layer

geourjoa commented 1 month ago

Case 1

2024-10-09_14-57

geourjoa commented 1 month ago

Case 2

2024-10-09_15-00

geourjoa commented 1 month ago

The annotation (on left top corner) is only displayed on mouse over and with annotation panel opened

geourjoa commented 1 week ago

https://github.com/SCENE-CE/mirador-video/pull/6

geourjoa commented 1 week ago

I have problem to use MV in MAEV

WIP is in MAEV/UpdateToLatestMiradorVideo

geourjoa commented 4 days ago

Minimal React component showing a video and an overlay div @daxid

import React from 'react';
import ReactPlayer from 'react-player';

const App = () => {

  const paused = true;

  const playerRef = React.useRef(null);

  const video = {
    id: 'https://youtu.be/dbX5Is_M4CE'
  };

  return (
    <div
    className="outerContainer"
    style={{
      display: 'flex',
      height: '100%',
      justifyContent: 'center',
      overflow: 'auto',
      position: 'relative',
      width: '100%',
    }}
  >
    {video && (
    <>
      <div style={{
        alignItems: 'center',
        backgroundColor: 'black',
        display: 'flex',
        flexDirection: 'column',
        marginBottom: '122px', // TODO Space for navigation controls
        position: 'relative',
        width: '100%',
      }}
      >
        <div style={{
          height: '100%',
          position: 'relative',
          display: 'flex',
          width: '100%',
          alignItems: 'center',
          flexDirection: 'column',
        }}
        >
          <ReactPlayer
            ref={playerRef}
            url={video.id}
            controls={false} // Hide default controls
            pip={false}
            playbackRate={1}
            playing={!paused}
            config={{
              peertube: {
                controls: 0,
                mode: 'p2p-media-loader',
              },
            }}
            style={{
              position: 'relative', // 'absolute' or 'block
              maxWidth: '100%',
              height: '100%',
              textAlign: 'center',
            }}
          />

          {/* AnnotationOverlayVideo */}
          <div style={{height: "100%", width: "100%"}}>
            <div style={{backgroundColor: 'red', 
              opacity : '0.3', 
              height: "100%", 
              width: "100%", 
              zIndex: 100, 
              position: "absolute", 
              top:0, left:0}}>

            </div>
          </div>
        </div>
      </div>
      {/* <WindowCanvasNavigationControlsVideo windowId={windowId} /> */}
    </>
    )}
  </div>
  );
};

export default App;