-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 8.10, 9.1, 9.2
-
Fix Version/s: QualifiedToSchedule
-
Tags:
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.
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); } }