Uploaded image for project: 'Opencast'
  1. MH-9627

FFMPEG generates grey frames when ripping images for OCR purposes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed and reviewed
    • Affects versions: 1.4.0, 1.3.1, 1.3
    • Fix versions: 1.4.0
    • Components: Backend Software
    • Labels:
      None
    • Severity:
      Incorrectly Functioning With Workaround
    • Steps to reproduce:
      Hide
      -Process a lecture with segmentable video
      -Note that you get no OCR'd text (at least with the demo media)

      What's happening is that FFMPEG is spitting out grey frames rather than the expected image, along with this error:
      [mpeg2video @ 0x30f9da0] warning: first frame is no keyframe

      This appears to mean that we can only rip keyframes! The default ripping profile works fine on frame 0, but I have no been able to find another frame in the reference media which works.

      Workaround:
      Set the frame ripping point after the input file on the ffmpeg commandline. This:
      profile.text-analysis.http.ffmpeg.command = -strict unofficial -y -ss #{time} -i #{in.video.path} -r 1 -vframes 1 -f image2 -pix_fmt rgb24 #{out.dir}/#{out.name}#{out.suffix}
      becomes
      profile.text-analysis.http.ffmpeg.command = -strict unofficial -y -i #{in.video.path} -ss #{time} -r 1 -vframes 1 -f image2 -pix_fmt rgb24 #{out.dir}/#{out.name}#{out.suffix}

      I would just commit this change, except the second one is much less efficient. Basically, FFMPEG is playing back the video from the beginning for each frame that's ripped. This becomes extremely problematic with larger media.
      Show
      -Process a lecture with segmentable video -Note that you get no OCR'd text (at least with the demo media) What's happening is that FFMPEG is spitting out grey frames rather than the expected image, along with this error: [mpeg2video @ 0x30f9da0] warning: first frame is no keyframe This appears to mean that we can only rip keyframes! The default ripping profile works fine on frame 0, but I have no been able to find another frame in the reference media which works. Workaround: Set the frame ripping point after the input file on the ffmpeg commandline. This: profile.text-analysis.http.ffmpeg.command = -strict unofficial -y -ss #{time} -i #{in.video.path} -r 1 -vframes 1 -f image2 -pix_fmt rgb24 #{out.dir}/#{out.name}#{out.suffix} becomes profile.text-analysis.http.ffmpeg.command = -strict unofficial -y -i #{in.video.path} -ss #{time} -r 1 -vframes 1 -f image2 -pix_fmt rgb24 #{out.dir}/#{out.name}#{out.suffix} I would just commit this change, except the second one is much less efficient. Basically, FFMPEG is playing back the video from the beginning for each frame that's ripped. This becomes extremely problematic with larger media.

      TestRail: Results

        Attachments

          Activity

            People

            • Assignee:
              greg_logan Greg Logan
              Reporter:
              greg_logan Greg Logan
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                TestRail: Cases