Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24316

Rework Video conversion listener for mass import

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 10.1
    • Component/s: DAM
    • Upgrade notes:
      Hide

      Removed VideoConstants#VIDEO_CHANGED_EVENT,
      VideoAutomaticConversionListener, VideoStoryboardListener

      Added VideoInfoWork, VideoStoryboardWork

      The video info (duration, format, etc.) is now computed by an asynchronous work to avoid loading the blob and running ffmpeg-info synchronously. This work, in turn, schedules two asynchronous works to process the video storyboard and conversions.

      As a consequence, the user might not have the video info in the UI immediately after creating / updating a Video document, needing to refresh the page once the asynchronous work is done.

      Show
      Removed VideoConstants#VIDEO_CHANGED_EVENT , VideoAutomaticConversionListener , VideoStoryboardListener Added VideoInfoWork , VideoStoryboardWork The video info (duration, format, etc.) is now computed by an asynchronous work to avoid loading the blob and running ffmpeg-info synchronously. This work, in turn, schedules two asynchronous works to process the video storyboard and conversions. As a consequence, the user might not have the video info in the UI immediately after creating / updating a Video document, needing to refresh the page once the asynchronous work is done.
    • Sprint:
      nxfit 10.1.5
    • Story Points:
      5
    • Epic Link:

      Description

      On document creation the sync listener videoChangedListener is:
      1. updating video metadata by processing the blob
      2. it fires a videoChanged event that is catch by 2 other async listener
      2.1 one is scheduling an async work for running the conversion work
      2.2 the other is doing the storyboard in the async listener

      This does not scale because:

      • the sync listener is reading the blob and we don't want that to get hyper fast import the blob is already in the binarystore we just set a ref on it.
      • there is 2 async listeners (converted in ListenerWork) one is just scheduling another work so a total of 3 works.

      This flow might be ok for new document from the UI but for mass import we need to change it.
      Just having a sync listener that is scheduling 2 works: a Storyboard and conversion.
      Here is an impl:
      https://github.com/nuxeo/nuxeo-platform-video/commit/e9b1a9ef99f38458dee8fbf54be3f18228a188a1

      To use it:

      <component name="b10b-video-config">
        <require>org.nuxeo.ecm.platform.video.service.contrib</require>
        <require>org.nuxeo.platform.video.core.listeners</require>
        <!-- Replace the default sync listener that is slow and generate too much async works -->
        <extension target="org.nuxeo.ecm.core.event.EventServiceComponent" point="listener">
          <listener name="videoChangedListener" enabled="false" />
          <listener name="videoImportListener" async="false" postCommit="false"
            class="org.nuxeo.ecm.platform.video.listener.VideoImportListener" priority="20">
            <event>documentCreated</event>
          </listener>
        </extension>
      
      </component>
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 4 hours
                  3d 4h