Sorry if I'm missing something obvious here, but I'm unable to get Video.js to display any transcoded files. Only the source file is listed in the HTML body, and very often that file is many times larger than a transcoded file. (Else, what is the point of transcoding, right?)
My goal is to have Video and Video.js modules populate an HTML5 page with several formats of a video.
When adding content, my method is to leave "Convert video on save" unchecked so that I can use "drush cron" to start the transcoding job. This allows me to monitor any errors in the shell. But Video.js seems impatient. Instead of waiting for a manual or automatic cron job to complete the transcoding for all the checked presets, Video.js immediately builds a video frame and loads the source file into it.
Obviously, this would explain why large source videos load slowly or not at all in the browser (provided the browser supports the file type), and perhaps some of the other strange behaviors after the node is submitted, like black frames or squeezed frames with pillar boxes. (Distortion is corrected when the page is refreshed).
There is also no thumbnail on the node page, only the first frame of the actual video, so the chosen thumbnail and node pages don't match.
After looking at videojs.tpl.php and some other files, I just have no idea how Video.js is working with the Video module to build an array of the transcoded files into HTML. There seem to be many variables to track, from the unique numbers that are added to the end of its original filename (which seems useful for transcoding into multiple sizes), to the extensions themselves, and finally to a node's numbered sub-directories in the parent /converted directory. (I don't understand that numbering scheme either, by the way.)
Again, I apologize for my ignorance, but I can't find any configuration options between these two modules for how to build a transcoded file in the an HTML page, let alone multiple formats into an HTML5 page. Do I need to test with a different theme than Bartik?
Lastly, the Video and Video.js documentation is very hard to absorb, and the Video.js README file for D7 seems to be based on D6 so it's pretty vague.
Thanks for any help!
Comment | File | Size | Author |
---|---|---|---|
#12 | html5_video_src_order_mp4_first.png | 204.89 KB | michael.k |
#5 | before_cron_to_transcode.png | 60.62 KB | michael.k |
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commentedMy guess is that the problem lies with the video module, which is responsible for invoking Video.js. As you have noticed, I have only recently started to get involved with the Drupal 7 version of this module and this part I have not yet looked at. I will soon.
Comment #2
Jorrit CreditAttribution: Jorrit commentedWhat transcoder and file system are you using, by the way?
Comment #3
michael.k CreditAttribution: michael.k commentedJorrit, I am grateful that you are looking in to Video 7 issues. Thank you for so much help!
I use FFmpeg and, if I understand your question, I transcode into Drupal's default public file system. I will probably use the private file system later on but I want to keep things as simple as possible while testing. When everything starts to work well I plan to use some brand of CDN to distribute a lot of content, so I'm happy to see others post support requests for Storage API, et al.
Anyway, I use CENTOS 5.7 x86_64 kvm, and my version of FFmpeg is:
Comment #4
Jorrit CreditAttribution: Jorrit commentedThanks for your information. Is it possible for me to view a page with a video that only has one source element that points to the original video, not to the transcoded video?
Comment #5
michael.k CreditAttribution: michael.k commentedOf course...
Just to clarify, all my testing nodes have only one source element. I tried to add a duplicate video field with different settings in an old sandbox but it didn't work at all. Generally, the only thing that I've changed up to now is the number and type of transcoded videos that are based on the source that is uploaded. But now that you've helped me to get all my videos to transcode properly, I can move on to other parties. :)
Also, of the several sandboxes that I created for the Video module, http://video8.mkdev.org is the only sandbox with Video.js enabled.
*
So to get back to the point, I created two pages that I think you'll be interested in:
http://video8.mkdev.org/node/14 has a 150MB source file that Video.js tries to use, even though mov is NOT enabled for this file extension in /admin/config/media/video/players.
http://video8.mkdev.org/node/13 has a m4v source file. Video.js is NOT enabled for this file extension in /admin/config/media/video/players, and Video.js does not try to display anything, which is what I would expect.
Attached is a screen capture of what I see immediately after I click submit, even though drush cron is responsible for the transcoding job. You can see the first frame for the source video, which I believe is handled by the browser under the protocol for HTML5. But in theory I shouldn't see anything appear in the node until the job is done and the videos are ready to display.
Incidentally, throughout all my testing with the Video module, I have never seen any video displayed with the Video for everybody option set for the HTML5 Player in /admin/config/media/video/players.
Finally, I get this error for type: video_conversion for three out of four of the transcoding jobs (which you are addressing in a different thread):
I suspect the exception is flv, possibly because of FLVTool2.
Comment #6
Jorrit CreditAttribution: Jorrit commentedI have fixed that last error today. Maybe you can update the video module tomorrow to see if that helps.
Comment #7
Jorrit CreditAttribution: Jorrit commentedBy the way, can I get admin access to that sandbox instance?
Comment #8
michael.k CreditAttribution: michael.k commentedSure, http://video8.mkdev.org/user/register
Comment #9
Jorrit CreditAttribution: Jorrit commentedI have found the source of this problem. You had Video.js selected as the display widget for the video field. However, you should have selected the Video player. When the display is set to Video.js, the Video module is not invoked and the converted files are not loaded. When the Video player is selected, the Video module first loads the converted files and then invokes the player you have setup in the Video settings, in your case Video.js. I am going to commit a fix to Video.js such that it is no longer possible to select it as display widget for video fields, as users should select Video.js using the Video module.
Comment #10
michael.k CreditAttribution: michael.k commentedThanks for pointing out that Video.js is NOT intended for the display type in /admin/structure/types/manage/video/display. (Also, when I tested the display setting I was not able to transcode into other formats in the first place.)
As you say, transcoded files are loading now in my site, but new issues have emerged. Once I build another fresh sandbox with your latest dev I will verify them, but this is what I'm seeing now:
Again, I will have to test again and submit a more accurate issue when I have the time to build a fresh site.
Comment #11
Jorrit CreditAttribution: Jorrit commentedCan I get some URLs for these problems? I'm not sure whether mp4 should be first. I think Video.js can figure that out itself. Do you have any evidence that order matters?
Comment #12
michael.k CreditAttribution: michael.k commentedRegarding format order, I have read about the importance this in a few references. Here are three.
1) An attached excerpt from "The Definitive Guide to HTML5 Video" by Silvia Pfeiffer (p24)
2) The videos.com site has a different interface now, but he used to have a code builder function that used the same order. Right now code references are minimal, but this snippet puts mp4 on top:
3) http://camendesign.com/code/video_for_everybody
* * *
Regarding URLs that show these problems on my site, here are three. (BTW, clearly I am doing the flash fallback incorrectly, since the flv code is not separated from the other formats.)
http://video8.mkdev.org/node/19 - This node was created yesterday with mp4, webm, ogg, and flv selected, using a m4v file for the upload where only fly and webm are showing:
http://video8.mkdev.org/node/18 - This is a node created after the display change that doesn't play any video, only audio. Only mp4 and webm are showing:
http://video8.mkdev.org/node/13 - This video plays on iPhone and shows the most formats in the source, and was created before the display change:
Comment #13
Jorrit CreditAttribution: Jorrit commentedThanks for your extensive reply. First of all, MP4 should be first for the iPad. However, I think Video.js already fixes this. When I look at the HTML source after Video.js has run, there are no source elements anymore.
With Video.js, flv is just a
<source>
element of the<video>
element. The Video.js module builds the Flash fallback using any mp4 or flv files it finds in the sources.I looked at the URLs you provided, but I can't really investigate the problem if I can't take a look in the database. Is it possible for me to receive a login to the database of just this test installation?
Comment #14
michael.k CreditAttribution: michael.k commentedThanks for sticking with this issue, Jorrit. I am going to test with tomorrow's dev versions of this and the latest Video module, but I want to quickly address your points:
I'm not sure what you mean by "there are no source elements anymore." I am trying to differentiate between the source files (i.e., a mov file or something else that is uploaded to be transcoded), and the src elements in the HTML pages, which are the transcoded files in /videos/converted/x. I am still baffled why some of these transcoded files are missing. There should be four but there are only two. Also, there are always the uploaded source files in the /videos/original directory.
I understand that flv becomes one of the transcoded file formats, but I don't see how it gets used as the flash fallback by the browser. I thought that there is supposed to be specific code that is required for older browsers or IE that is used below the section with multiple transcoded src elements. And, if I understand you correctly, you are saying that the flash fallback is a flash-based player (or wrapper) for either a flash file or an mp4 file.
I am happy to provide you with anything you need for troubleshooting, including installing additional modules. You have admin access to this instance, so you could download any of the backups if you wish. In the meantime, however, like I said I will be building a site with the new version of the Video-dev and testing again so perhaps this will solve some of these issues.
Thank you again. Your quick response with this and so many other issues is deeply appreciated. The next stable release of these modules are going to rock the house. :)
Comment #15
Jorrit CreditAttribution: Jorrit commentedI'll try again to explain how I believe the current Video.js version works compared to other HTML5 players.
Other players put the Flash player in the video tag that is ignored by a HTML5 compatible browser, but read by older browsers.
Video.js detects whether the browser supports playing the file using javascript. Either the browser doesn't support HTML5 video at all (IE8 and lower) or the codec is not supported (MP4 in Firefox). In those cases, Video.js reads the list of
<source>
elements and locates all elements with either codec video/mp4 or codec video/flv. It then initializes a Flash player on the fly with one of those sources. As such, there is no longer a Flash fallback visible in the HTML source. It is all done on the fly.On the video8 instance, you used to have the devel module. It is no longer available. That one is also very useful. The point is, I need to look at the contents of the file_managed table to find out where the "missing" files are. I have found a bug with ogg transcoding in the code (which hasn't been reported at all on Drupal.org) and I would like to check if that bug occured for you. Also, I can't explain why video/mp4 is missing. Therefore, I could really use access to the video* and file* tables.
Comment #16
michael.k CreditAttribution: michael.k commentedThanks for the clarification about how flv fallback works in Video.js.
Regarding the devel module, I actually had not installed it for any of these sandboxes, but it is now enabled for you on video8. I also installed the schema module, just in case you want to test with that one, too, but I will leave it to you to enable it if you wish.
I will now test with the latest dev versions of Video and Video.js to see if these issues persist.
Comment #17
michael.k CreditAttribution: michael.k commentedOK, I built a clean sandbox with the Video module version 7.x-2.4+45-dev (February 28, 2012 - 16:44), and the Video.js module version 7.x-2.0-rc2+2-dev (February 26, 2012 - 16:43).
http://video9.mkdev.org/node/1
The good news is that the thumbnails are building as intended from beginning to end. Nice.
The bad news is that there are no transcoded files built into the html page, even though there are four transcoded files in the /converted directory -- nor is there a poster image -- so there is nothing for the browser to display.
Here is the html source (with a little extra for context):
Thanks for taking a look. Please let me know if you'd like to take a look at this site as you did for video8:
http://video9.mkdev.org/user/register
Comment #18
Jorrit CreditAttribution: Jorrit commentedI have found the following from your video8 installation (my video9 account is not activated yet):
- You're using the m4v extension. This results in a mimetype of video/x-m4v, which isn't recognized by the video or video.js module. I have updated the Video.js module.
- I also see that you encounter the ogg bug that I have found in the code. I'll update the Video module soon.
Comment #19
michael.k CreditAttribution: michael.k commentedI activated your account. Let me know if you'd like me to update the modules (which I'll be able to do in another 15 hrs). Feel free to turn on, install, or tweak anything you need. Currently Devel and Schema are available but not enabled.
Comment #20
Jorrit CreditAttribution: Jorrit commentedFor some reason the display value was not set at http://video9.mkdev.org/admin/structure/types/manage/video/display , when I submitted that form it worked. I'm still working on ogg by the way, the rest should work.
Comment #21
michael.k CreditAttribution: michael.k commentedOh geez, I probably didn't click the save button. Sorry I was extremely tired when I set it up.
Thanks for working on that ogg bug you found. I see that the other three formats I created are loading alphabetically the in the html code
, but the poster frame is missing.I'm not sure about the nature of the ogg bug, but is there any chance the Video module could force the wrapper/extension to read .ogv instead of .ogg? My understanding is that ogv should be for video and the browser is expecting that, whereas ogg is typically for audio, even though it still works for video. The Video module's preset drop down shows "Ogg format" (based on the user's copy of FFmpeg), but I know my build of FFmpeg is capable of transcoding properly with the correct default AV codecs to the ogv extension with "ffmpeg -i source.mov output.ogv"
Comment #22
Jorrit CreditAttribution: Jorrit commentedYes, that's the issue. The module uses the codec code as extension, but in the case of Ogg, that's "ogg". The Drupal MIME type list translates this to audio/ogg, which is then being ignored by the Video.js module.
Comment #23
michael.k CreditAttribution: michael.k commentedOh good to know that's the same one.
Comment #24
michael.k CreditAttribution: michael.k commentedIf it's a Drupal MIME type issue that does not source FFmpeg's list of extensions, would adding a declaration in the .htaccess file for ogv do any good?
Comment #25
Jorrit CreditAttribution: Jorrit commentedIt's not the .htaccess file. Drupal contains a function that translates a filename to a mime type. It checks the file extension by default. The file extension ogg is translated to audio/ogg. That's not a bug, because I should have named the file ogv.
See:
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/includes/f...
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/includes/f...
Comment #26
Jorrit CreditAttribution: Jorrit commentedThe next -dev release of the video module contains a fix for Ogg video. Could you install that version on video8 and video9 and see if the upgrade script runs successfully? After that, the Ogg files should be visible.
Comment #27
michael.k CreditAttribution: michael.k commentedI can't disable or uninstall the Video module normally and will submit a separate bug report for easier bug searches.
Since deleting and inserting a newer video module is likely to break the site, which was the case previously, I will go ahead and build a video10 to test the current dev for Video and Video.js. Let me know how you want to handle video8 and video9.
Comment #28
michael.k CreditAttribution: michael.k commentedThe ogv fix works on video10. Great job, Jorrit.
There seems to be an issue with the default display settings in /admin/structure/types/manage/video/display, as we saw previously. Leaving the default settings untouched produced no display with video player showing by default, whereas toggling the display to
<hidden>
and back to video player again, then re-saving, produces a functional display.Here is the code before re-saving:
And here is the code after re-saving:
Comment #29
michael.k CreditAttribution: michael.k commentedI ran another test with more presets to include ogg, m4v, and flv. The ogg file is discarded, even though it shows up in the /converted directory, which is good. Here is what shows up in the html file:
Comment #30
michael.k CreditAttribution: michael.k commentedFor what it's worth, it took exactly :50 seconds for my server to transcode from the uploaded 150MB source file into these six formats at their defaults. Sweet.
Also, the ogv and flv defaults are very poor quality next to mp4/m4v and runner up, webm. The mp4 files are extremely crisp while the flv file is surprisingly heavier with a major loss of quality. Ogv has the poorest quality, and webm actually shows up with smaller files than ogv. Surely this is related to FFmpeg's defaults, but perhaps there is a way for the Video module to take this into account and help the user to synchronize the quality a bit more with advice about what settings to choose for what formats.
Comment #31
Jorrit CreditAttribution: Jorrit commentedRegarding #27: Can't you just upload the new video module files to the modules directory and overwrite the old ones?
Regarding #28: I'll look into the default widget setting.
Regarding #29: I see video/ogg in the HTML you post.
Regarding #30: The default quality settings are probably not optimal. That something to solve later.
Comment #32
Jorrit CreditAttribution: Jorrit commentedRegarding #28: Fixed in #1466126: Video player formatter is not selected by default for new fields.
Comment #33
michael.k CreditAttribution: michael.k commentedRegarding #27: I have had errors in the past with this module by upgrading this way. (Also see http://drupal.org/node/1465940#comment-5683636)
But yes I have since upgraded and it appears to work ok. The only problem now is that the m4v file type is missing in html on video8 (I have not upgraded video9). I know that file type works because I think you fixed something for it recently, and it shows up properly in video10.
Here is my output with a successful update script:
Comment #34
michael.k CreditAttribution: michael.k commentedRegarding #28: Thanks for the fix in http://drupal.org/node/1466126.
Regarding #29: Yes video/ogg is present in the HTML. Just to clarify, I did a test for both extensions by creating two presets, one for ogv (normal) and one for ogg (should not be used for video). Your fix is perfect because it allows the custom preset to function in order to build the .ogg file, while excluding it from the HTML build. So it is correct to show the .ogv file and not the .ogg file.
Regarding #30: Indeed, this requires a lot of trial and error and is not critical to address now, I just thought I'd mention it since there are radical differences in quality and file size when using the defaults.
Comment #35
Jorrit CreditAttribution: Jorrit commentedIs there anything that has yet to be fixed regarding this issue?
Comment #36
michael.k CreditAttribution: michael.k commentedThanks for checking in about this. Unfortunately, I still can't get Video.js to display properly, but now that the transcodes are basically working and showing up in the HTML, I suppose particular issue is resolved.
Comment #37
Jorrit CreditAttribution: Jorrit commentedWhat is the problem with displaying Video.js?
Comment #38
michael.k CreditAttribution: michael.k commentedCurrently, I can't get mp4 files to play properly in Safari. Only audio works. This was after you had fixed many bugs that allowed me to get Video and Video.js to work well enough for me to upload and transcode videos for display in all browsers. Most of those files that were working do not work now. I also have problems with aspect ratio consistency for the same file among browsers, so the poster image is distorted and the player controls extend beyond the file's dimensions.
The strange audio-only behavior started happening March 5, as if a switch were thrown. I was posting tests to my sandbox and had not done any kind of updates, but suddenly the problems started. This also corresponded to another issue (http://drupal.org/node/1468538), which made me think it was some kind of issue with calls to the video.js vendor outside of Drupal.
Comment #39
michael.k CreditAttribution: michael.k commentedOk, I installed another new sandbox with fresh copies of everything, then ran a bunch of new tests at http://video11.mkdev.org.
The results are perplexing.
After setting up mp4 and webm presets with everything set to defaults, I uploaded a variety of source file formats based on the same original file. One would think that the ability to display would be consistent since the Video module is creating transcoded versions while Video.js is displaying them, but I'm seeing that some mp4 files play in Safari and Chrome, while others do not.
BROKEN:
DVCPRO50 > mp4 = audio only
DV > mp4 = audio only
Apple Intermediate Codec (AIC) > mp4 = (no codec support in my copy of FFmpeg)
MPEG-2 > mp4 = cannot upload file or add extension, but FFmpeg supports it
WORKS:
iPhone (mp4) > mp4
Apple ProRes 422 > mp4
JPEG-100 > mp4
Animation > mp4
Streaming mp4 > mp4
(Verified on OS X Snow Leopard, Lion, and an iPhone (iOS 5.0))
Comment #40
Jorrit CreditAttribution: Jorrit commentedYou must edit the field settings to add mpg or mpeg to the allowed extension list.
The DVCPRO50 video seems broken because of the H.264 profile. I am not an expert in this, but one of the differences in
ffmpeg -i
output is that the non-working video has profile "High 4:2:2" and the working one has "High". I know you have problems with profiles, so I think I need to look into those problems to solve this one.Also see http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles . High 4:2:2 seems kind of advanced.
Comment #41
Jorrit CreditAttribution: Jorrit commentedI'm going to close this issue because I think every issue is fixed.