How to get Drupal 9/10 version of Video to work like Drupal 7 version

Created on 20 January 2023, almost 2 years ago
Updated 7 June 2024, 6 months ago

Hello,

In Drupal 7 this is a well rounded fully functional module allowing users to upload video files that are then automatically transcoded to preset specifications.

Drupal 8 and Drupal 9 have been around for a considerable amount of time now (I'm more concerned about Drupal 9 for our use case) clarification to follow.

I'm currently "attempting" to build a Drupal 9 site based on a Drupal 7 site I built years ago and have kept maintained for a client which is heavily reliant on allowing users through content types and a video upload field to upload video in any format which is then queued and transcoded to a few formats based on presets with FFmpeg making them playable on pretty much all devices. Do to the amount of customizations and modifications on that site there is no migrate option to go from Drupal 7 to Drupal 9 - however that is beside the point at the moment.

In the case of the video module (which is by far a superior Drupal 7 module) it is either "still" severely lacking in capability for Drupal 9 or there is not enough documentation to get it working like it does for Drupal 7.

So I would like some clarification is someone could graciously provide it.

Simply adding a video field and switching the widget to upload doesn't do anything more than Drupal core media upload video which has me a bit confused (why not just use media if this is the case).

- How do I for starters get it to add some selectable thumbnails during upload before transcode? Is it even possible (this happens automatically for Drupal 7, where a specified number of thumbnails is generated based on admin configuration.)

- I've figured out how to create a transcoding preset, but near as I can tell the only way to have a video transcoded is via admin interface at admin/config/media/transcode-jobs/list which in itself is a bit confusing! When selecting "+ Add video job" it appears you need to add the video file/ upload the/a video file there (as a required field) to be transcoded but this is an option only available to admins and not a step that would be in any respect easy to extend to regular site users outside the scope of the designated content types (users who only have access to specific content types to create a post with a video that is "supposed" to be transcoded) but there isn't an option for that on a video field as far as I can tell.

-- In the same config media transcode-jobs UI under the "Video job settings" there is nothing displayed "Should there be?" Do I need to add fields under Manage fields (which also displays nothing, even though there are fields under "Manage form display" and "Manage display" tabs? And if so is this an entity which can be added to regular content type as a field (the paragraphs module comes to mind here) as in "is it similar to that approach?"

- I found there is also another field option made available to content types "Transcode Job Entity" but the only available widget is autocomplete. What exactly is this field, what should it be used for and how does one use it? Is this how I get a transcode-job into a content type? Or am I completely missing the boat on this!

I'm at a bit of a loss here on how this is so wildly different from the Drupal 7 version.

Is there anyway to get this version to work at least similar to the Drupal 7 version? I really need a field that a user can upload a video to and it get transcoded (at the very least at the time the content is saved - preferably queued so videos can be done in batch, but I would take on save just as long as it works).

Having stepped through this in my head while writing this issue I'm now wondering should I instead of creating a regular Drupal content type "be" some how creating a "Video job" as the content type instead and add all the fields I used in the regular/default Drupal built content type here at admin/config/media/transcode-jobs/settings/fields/add-field instead to achieve what is required for this site. Is that possible? Like I said it's a bit confusing knowing the Drupal 7 version so well and having used it for almost 10 years (maybe longer), and now going to this for Drupal 9.

Also what about "Rules" again (no documentation), there is no or doesn't appear to be "After video conversion failed" or "After video conversion success" (which is also in our use case a necessity).

- In rules I see "Transcode job entity with:"
-- After deleting a transcode job entity entity
-- After saving a new transcode job entity entity
-- After updating a transcode job entity entity
-- Before saving a transcode job entity entity
-- Entity of type transcode job entity is viewed

What are those specifically for and their specific use cases and do any of them translate to "conversion failed and conversion success"?

Again any information here would be greatly appreciated! I'm also willing to contribute in anyway I can..

If I can't get at least a similar approach in functionality as to getting this version working like the Drupal 7 version this will cause big problems in trying to recreate the Drupal 7 site in question in an updated and more secure Drupal 9 soon 10 (as end of life for Drupal 7 gets closer and closer)

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States sidgrafix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    OK, So now some more questions.

    I've found there to be another widget for form display for a video field "Video Upload & Convert" which uploads a video pretty much the same as "Video Upload" however when using it there are no options after the video has uploaded to transcode nor does it provide any thumbnails. There also isn't any other node/display options of the field format other than "URL to video" which really isn't very useful (at least in any respect needed) - Shouldn't there at least be a way to display the video in an html5 video player like when the upload widget is set to "Upload Video"? Also being the form widget is for upload and convert (I'm assuming convert by transcoding but I may be wrong) shouldn't there be a way to configure the transcoding for the field and get thumbnails as well?

    Worst case scenario one could take the provided url which isn't even a link that is clickable (in the current fields state) and use some jQuery to get the video by using the URL and place it on the page replacing the URL if absolutely had to. But in reality if convert doesn't actually work just setting the form display widget to "Upload video" and then on node display use the option for "HTML5Video Player Compact" would be simpler.

    There is also an error produced for maximum upload size if you try to set the "Max upload size" when the widget is set to "Video Upload & Convert" the manage-fields form display just won't accept any input and a php error is logged in DBlog (haven't looked to see if it has been reported yet under another issue) Error: Class "Drupal\video_transcode\Plugin\Field\FieldWidget\Bytes" not found in Drupal\video_transcode\Plugin\Field\FieldWidget\VideoUploadTranscodeWidget::validateMaxFilesize() (line 31 of /var/www/html/web/modules/contrib/video/modules/video_transcode/src/Plugin/Field/FieldWidget/VideoUploadTranscodeWidget.php)

    - However I did find if I set the widget to "Upload Video" and then set a "Maximum upload size" and update/save it that way, I could then switch the widget back to "Upload Video & Convert" and the "Maximum upload size / Max filesize:" limit would stay set and no error is produced.

    Other than that what exactly is this widget (Upload Video & Convert) option supposed to be used for? Is it for transcoding or is "convert" meant for something else?

    Now also seeing that alternatively when using form widget "Upload Video" where display format has the option for HTML5 video player - I see there is also the option for "URL to Video" and now having written through these additional questions I'm wondering is there a way to use the URL produced by Upload Video & Convert widget or if chosen "Video Upload" widget and display format "URL to Video" in another way or rule to process transcoding and thumbnails.

    I'm guessing most of this isn't working yet (and there is still a significant amount of bugs to get worked out) - but I'm still hopeful someone will graciously help me to fill in some blanks!

  • πŸ‡§πŸ‡ͺBelgium flyke

    +1, I was also expecting that I could for example create a Media type 'video' with a 'video' field with the upload and transcode widget and that users could create a new Video Media file, upload an AVI video, and that the website would upload it, transcode it (to mp4?) and that it could then be displayed on the website via some field formatter.
    But the truth is there is no transcoding happening, and I have no idea if either this functionality is present and working but documentation is severely lacking, or that this is not working at all.

    If anyone gets automatic transcoding to work, please let us know and document how to.
    Otherwise the scope of this function should be 'bug' instead of 'documentation' ?

  • πŸ‡§πŸ‡ͺBelgium flyke

    Ok so I found out this is still on the roadmap:
    https://www.drupal.org/project/video/issues/2637338 β†’

    The main transcoding for Drupal 8 and up issue is here:
    https://www.drupal.org/project/video/issues/2637682 πŸ“Œ Transcode video to support HTML5 Active

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS

    Thanks for those links, was just struggling with this as well, couldn't figure out what I am doing wrong, but based on those links it looks like the module does not offer that anymore huh? Kind of seems abandoned since I had to apply 2 other patches for D9 just to get the config screens of the module to work.

  • πŸ‡ΊπŸ‡ΈUnited States NicholasS
  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    @NicholaS, @flyke,

    I've given up on this module in favor of a module that actually works called "streaming." I just finished adding a sub-module to streaming as a new feature here https://www.drupal.org/project/streaming/issues/3393523#comment-15384408 ✨ Feature: streaming_transcode_queue Active which needs testing.

    If anyone is interested the module I added to streaming, "streaming_transcode_queue" provides options and similarities to how transcoding worked for the video module in Drupal 7. Plus a bunch of extra tools and a manual queue processing display table.
    - The only unfortunate is I haven't included any kind of upgrade/migrate path to go from video to streaming, that's a bit outside my scope of skillsets at the moment.

    If you give it a try and need any help getting things set up let me know. Until it is merged into streaming you will need to use the merge request as a patch to streaming version 2.0, I've been using it myself primarily without any issue for months now.

  • πŸ‡ΊπŸ‡ΈUnited States wilblakefcpl

    Hi @sidgrafix,
    Thanks for the recommendation. I have also struggled with the Video module after a relatively easier experience with the Drupal 7 version. I will try the streaming module shortly. Its home page warns that it is not covered by the Drupal security advisory policy- will the streaming module eventually adopt the Drupal security policy?

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    @wilblakefcpl

    In regards to the security advisory, I think it is planned as the dev version of streaming was updated with that intent to use git cli, If I remember correctly - but I can't say for sure! I'm not the developer for the module I just submitted the streaming_transcode_queue sub module as a new feature. I actually need to post an update for that feature (as is, it should work just fine, but I ran into a rare event that could cause some confusion if a video fails to transcode completely or a fatal error interrupts the transcoding process.) I should be able to get that done sometime this week, hopefully within the next day or two!

    If you do try the streaming module, post any questions to the feature request issue thread and I'd be happy to help get you setup and rolling with it... https://www.drupal.org/project/streaming/issues/3393523#comment-15384408 ✨ Feature: streaming_transcode_queue Active

  • πŸ‡ΊπŸ‡ΈUnited States sidgrafix

    @wilblakefcpl

    I Just updated the feature issue with a new patch addressing the errors I previously noted. So should be good to go at least for now..

Production build 0.71.5 2024