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

VideoConvertersTest.testScreenshotConverter must use better ffmpeg options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.7.2
    • Fix Version/s: 5.6.0-HF24, 5.7.3
    • Component/s: Convert
    • Backlog priority:
      500

      Description

      Raised by NXP-12230 which fixes the swallow of the command execution failure, the test org.nuxeo.ecm.platform.video.convert.VideoConvertersTest.testScreenshotConverter() fails on command:
      $ ffmpeg -y -ss "0" -i "/tmp/elephantsdream-160-mpeg4-su-ac3.avi" -f image2 "/tmp/test.jpg" fails with
      error [image2 @ 0x267f780] Could not get frame filename number 2 from pattern '/tmp/test.jpg'

      This is because multiple images are produced. Using the following command fixes the issue:
      $ ffmpeg -y -ss "0" -i "/tmp/elephantsdream-160-mpeg4-su-ac3.avi" -f image2 "/tmp/test_%05d.jpg"

      Another fix is using the option -vframes 1 which is used by the StoryboardConverter but not the ScreenshotConverter:

      ./nuxeo-platform-video-convert/src/main/java/org/nuxeo/ecm/platform/video/convert/ScreenshotConverter.java:57:    public static final String FFMPEG_SCREENSHOT_COMMAND = "ffmpeg-screenshot";
      ./nuxeo-platform-video-convert/src/main/java/org/nuxeo/ecm/platform/video/convert/StoryboardConverter.java:66:    public static final String FFMPEG_SCREENSHOT_RESIZE_COMMAND = "ffmpeg-screenshot-resize";
      
          <command name="ffmpeg-screenshot" enabled="true">
            <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file -->
            <parameterString> -y -ss #{position} -i #{inFilePath} -f image2 #{outFilePath}</parameterString>
          </command>
      
          <command name="ffmpeg-screenshot-resize" enabled="true">
            <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file.
              The -vframes 1 option tell to take only one screenshot. This is necessary as apparent the use of the "-s" option forces ffmpeg to switch in "many output files" mode.
            -->
            <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 -s #{width}x#{height} #{outFilePath}</parameterString>
          </command>
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified