Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-71839

Metadata cannot be extracted from MP4 videos

    Details

      Description

      Using Tika's MP4Parser to extract metadata from MP4 videos as documents fails, and causes errors.

      Steps to reproduce:
      1. Set the following portal properties:
      web.server.servlet.accept.ranges.mime.types=audio/basic,audio/mid,audio/midi,audio/mod,audio/mp3,audio/mp4,audio/mpeg,audio/mpeg3,audio/ogg,audio/vorbis,audio/wav,audio/x-mid,audio/x-midi,audio/x-mod,audio/x-mpeg,audio/x-pn-realaudio,audio/x-realaudio,audio/x-wav,video/avi,video/mp4,video/mpeg,video/ogg,video/quicktime,video/x-flv,video/x-m4v,video/x-ms-wmv,video/x-msvideo
      dl.file.entry.preview.audio.mime.types=audio/basic,audio/mid,audio/midi,audio/mod,audio/mp3,audio/mp4,audio/mpeg,audio/mpeg3,audio/ogg,audio/vorbis,audio/wav,audio/x-mid,audio/x-midi,audio/x-mod,audio/x-mpeg,audio/x-pn-realaudio,audio/x-realaudio,audio/x-wav,video/avi,video/mp4,video/mpeg,video/ogg,video/quicktime,video/x-flv,video/x-m4v,video/x-ms-wmv,video/x-msvideo
      2. Create a new Basic Document
      3. Upload an MP4 video file and publish the document
      Expected result: there are no errors. Clicking on the document to view its details will show its metadata on the side of the page.
      Actual result: errors display in the console. Clicking on the document to view its details will throw more (of the same) errors, and the metadata is not shown.

      The errors in the logs are like the following:

      21:38:39,151 WARN  [liferay/document_library_raw_metadata_processor-1][TikaRawMetadataProcessor:92] Unable to extract metadata
      21:38:39,152 WARN  [liferay/document_library_raw_metadata_processor-1][RawMetadataProcessorMessageListener:38] Unable to save metadata for file version 30309
      com.liferay.portal.kernel.exception.SystemException: java.io.IOException: org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.mp4.MP4Parser@4c1c8f0
              at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:151)
              at com.liferay.portal.metadata.BaseRawMetadataProcessor.getRawMetadataMap(BaseRawMetadataProcessor.java:71)
              at com.liferay.portal.kernel.metadata.RawMetadataProcessorUtil.getRawMetadataMap(RawMetadataProcessorUtil.java:41)
              at com.liferay.portlet.documentlibrary.util.RawMetadataProcessorImpl.saveMetadata(RawMetadataProcessorImpl.java:133)
              at com.liferay.document.library.kernel.util.RawMetadataProcessorUtil.saveMetadata(RawMetadataProcessorUtil.java:113)
              at com.liferay.portlet.documentlibrary.messaging.RawMetadataProcessorMessageListener.doReceive(RawMetadataProcessorMessageListener.java:34)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
              at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:58)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.mp4.MP4Parser@4c1c8f0c
              at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:99)
              at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:148)
              ... 11 more
      Caused by: org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.mp4.MP4Parser@4c1c8f0c
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:282)
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
              at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
              at com.liferay.portal.metadata.TikaRawMetadataProcessor.extractMetadata(TikaRawMetadataProcessor.java:77)
              ... 12 more
      Caused by: java.lang.RuntimeException: java.io.IOException: requesting read past end of stream
              at com.googlecode.mp4parser.AbstractBox.readContent(AbstractBox.java:70)
              at com.googlecode.mp4parser.AbstractBox.parseDetails(AbstractBox.java:171)
              at com.googlecode.mp4parser.RequiresParseDetailAspect.before(RequiresParseDetailAspect.java:54)
              at com.coremedia.iso.boxes.FileTypeBox.getMajorBrand(FileTypeBox.java:86)
              at org.apache.tika.parser.mp4.MP4Parser.parse(MP4Parser.java:139)
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
              ... 15 more
      Caused by: java.io.IOException: requesting read past end of stream
              at org.apache.tika.parser.mp4.DirectFileReadDataSource.map(DirectFileReadDataSource.java:115)
              at com.googlecode.mp4parser.AbstractBox.readContent(AbstractBox.java:68)
              ... 20 more

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              alec.shay Alec Shay
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 21 weeks, 4 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP23
                  7.0.X EE
                  7.0.4 CE GA5
                  7.1.X
                  Master