Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate thumbnails for videos #1005

Closed
dannylamb opened this issue Jan 16, 2019 · 6 comments · Fixed by Islandora-Devops/islandora-playbook#105
Closed

Generate thumbnails for videos #1005

dannylamb opened this issue Jan 16, 2019 · 6 comments · Fixed by Islandora-Devops/islandora-playbook#105
Milestone

Comments

@dannylamb
Copy link
Contributor

dannylamb commented Jan 16, 2019

When ingested, video derivatives are made, but it would be nice if we could extract a thumbnail from the video. We should be able to adapt Homarus to read Accept headers to know if it should make images or videos. The ffmpeg command should be altered accordingly. The logic would go roughly here: https://github.com/Islandora-CLAW/Crayfish/blob/master/Homarus/src/Controller/HomarusController.php#L113 I imagine in the long run we'll want to do audio derivatives this way too, so keep that in mind, even though it's certainly out of scope for this issue.

@dannylamb
Copy link
Contributor Author

linking to #929

@Natkeeran
Copy link
Contributor

@dannylamb We discussed having a common approach to derivative creation. Is that to be explored? Or since we can customize the input parameters with actions, we should be good to with the approach stated here. Please confirm.

@dannylamb
Copy link
Contributor Author

The common approach we have now is re-using the camel routes to connect the derivative microservices back into the repository. We've got that, but that's really only for adding new microservices. For this we'll either have to adapt homarus or make a new action that has different Islandora Args. It all comes down to the ffmpeg command you have to run to extract a thumbnail.

@whikloj whikloj added this to the 1.x milestone Apr 11, 2019
@Natkeeran
Copy link
Contributor

Natkeeran commented May 4, 2019

@dannylamb

Adding the ffmpeg format image2pipe to the config, then passing appropriate params will create thumbnail image. Example:

curl -H "Authorization: Bearer islandora" -H "X-Islandora-Args: -ss 00:00:01.000 -frames 1"  -H "Accept: image/jpeg" -H "Apix-Ldp-Resource:http://localhost:8080/fcrepo/rest/2019-05/test.mp4" http://localhost:8000/homarus/convert --output output.jpg

We can start with the above and then refine the logic to set more appropriate time frame later as in the 7.x stack.

I set up the context and action, it did not create it. Need to troubleshoot that further. But I do note that context that is setup to fire on any Service file can be problamatic. Also, I am not sure if Alpaca is setup to handle creation of multiple file types for video!

# managed by Ansible

homarus:
  # path to the ffmpeg executable
  executable: ffmpeg
  mime_types:
    valid:
      - video/mp4
      - video/x-msvideo
      - video/ogg
      - audio/x-wav
      - audio/mpeg
      - audio/aac
      - image/jpeg
    default: video/mp4
  mime_to_format:
    valid:
      - video/mp4_mp4
      - video/x-msvideo_avi
      - video/ogg_ogg
      - audio/x-wav_wav
      - audio/mpeg_mp3
      - audio/aac_m4a
      - image/jpeg_image2pipe
    default: mp4


fedora_resource:
  base_url: http://localhost:8080/fcrepo/rest

log:
  # Valid log levels are:
  # DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY, NONE
  # log level none won't open logfile
  level: DEBUG
  file: /var/log/islandora/homarus.log

syn:
  # toggles JWT security for service
  enable: True
  # Path to the syn config file for authentication.
  # example can be found here:
  # https://github.com/Islandora-CLAW/Syn/blob/master/conf/syn-settings.example.xml
  config: ../syn-settings.xml

@dannylamb
Copy link
Contributor Author

dannylamb commented May 7, 2019

@Natkeeran

I just modified the validator in the form for islandora_video to accept image/jpeg, and it totally worked first time! Too easy!!!

Screenshot from 2019-05-07 10-58-04

Needs some image styles, but hey 🎉

@dannylamb
Copy link
Contributor Author

@Natkeeran^^ PRs are up. Testing instructions in https://github.com/Islandora-CLAW/islandora_demo/pull/26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants