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

Use direct download URL for managed blob to get Video Info

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 8.10, 9.1, 9.2
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Core, DAM

      Description

      ffmpeg can use a URL as input and then downloads only the part of the file required to extract metadata.

      Today we download the whole file locally which does not scale well with really large files.

      In https://github.com/nuxeo/nuxeo-platform-video/blob/master/nuxeo-platform-video-core/src/main/java/org/nuxeo/ecm/platform/video/VideoHelper.java

          public static VideoInfo getVideoInfo(Blob video) {
              if (video == null) {
                  return null;
              }
              try {
                  ExecResult result;
                  try (CloseableFile cf = video.getCloseableFile("." + FilenameUtils.getExtension(video.getFilename()))) {
                      CommandLineExecutorService cles = Framework.getLocalService(CommandLineExecutorService.class);
                      CmdParameters params = cles.getDefaultCmdParameters();
                      params.addNamedParameter("inFilePath", cf.getFile().getAbsolutePath());
      
                      // read the duration with a first command to adjust the best rate:
                      result = cles.execCommand(FFMPEG_INFO_COMMAND_LINE, params);
                  }
                  if (!result.isSuccessful()) {
                      throw result.getError();
                  }
                  return VideoInfo.fromFFmpegOutput(result.getOutput());
              } catch (CommandNotAvailable | CommandException | IOException e) {
                  throw new NuxeoException(e);
              }
          }
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: