This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 20 - Pages: 2 [ Previous | 1 2 ] - Last Post: 18 Feb 21, 22:35 Last Post By: palthe Threads: [ Previous | Next ]
palthe

Posts: 24
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 17:40   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I don't know if this is related, but I found some similar "strange" behavior of the imageWidth and imageHeight variables:

Scenario:

I add an MP4 video-file to my album, as a link.
In the Video album-settings I select: Resolution = Do not re-encode.
The image bounds for images are: 1200 x 1200.
The actual size of the video is: 1920 x 1080.

When I create the album, jAlbum extracts one of the first frames from the video and saves it as a jpg-file, with the same name as the video-file. The mp4-file and the jpg-file are stored in a slides-folder in the output directory.
When I look at these files in the output-directory, I see that the jpg-file has a size of 1200 x 675 (so it is scaled-down according to the image bounds settings) and that the mp4-file is not scaled (1920 x 1080). This is what I would expect.

The related size-variables for the video-object have the following values:

imageWidth x imageHeight = 1200 x 675 (correct)
originalWidth x originalHeight = 1920 x 1080 (correct)

Now I right-click on the video-thumbnail in the explorer pane, select: "Use original" and re-create the album (using "Force remake").
When I look again at the files in the output directory, I see that the actual sizes have not changed (1200 x 675 for the jpg-file and 1920 x 1080 for the mp4-file). Again as expected.

However, the related size-variables for the video-object now have the following values:

imageWidth x imageHeight = 1920 x 1080 (not correct!)
originalWidth x originalHeight = 1920 x 1080 (correct)

I don't know if this is a bug or intended behavior, but I find it confusing. I would expect that the variables imageWidth and imageHeight refer to the image -file that resides in the location which is indicated by the variable imagePath. But apparently that is not always the case...

Note:
To "see" these values, I used the same method as described in my post of 10-Feb-2021 19:05 (a div with ${variable} items inside the <ja:fileiterator> loop in the index.htt file).
For a more extensive overview of the resulting variable-values see the attached pdf-file.

Note2:
I still like jAlbum :-)
JeffTucker

Posts: 8,212
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 17:56   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
The size of the representing image for a video is far less important than the video dimensions, because the image is used only as a poster image for the video player. As long as the player window is correctly sized for the video (which it will be if videoWidth and videoHeight are correctly reported), the poster image will look just fine.

In short, the size of the poster image is never used in the HTML anywhere - there are no width or height attributes, because there isn't actually an <img> tag anywhere. So, the accuracy of the dimensions is not an issue in the real world.
palthe

Posts: 24
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 20:54   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
In short, the size of the poster image is never used in the HTML anywhere - there are no width or height attributes, because there isn't actually an <img> tag anywhere. So, the accuracy of the dimensions is not an issue in the real world.

Well, in my world :-) that is almost exactly what I'm doing: In my skin I use Fancybox to display the images and video's and by passing the imageWidth and imageHeight to Fancybox I make sure that the size of the video-player is in line with the size of the images, regardless of the actual size of the mp4-file.

But that's not the point: even if the values are not (often) used, they still should be correct.

You would have a point if you had asked why anybody would select "Use original" for an individual video, because the User Manual clearly says: "This setting has no effect on a video or any other non-image file (audio file, PDF, etc.)." And my reply would be: If it should have no effect on video-files, then why is this option available in the context-menu of video's (and audio-files and PDF-files and webLocations etc.)?

Hmmm, I start to sound like a grumpy old man, which is not my intention. Just trying to point out some little inconsistencies in jAlbum, like: why is the variable videoPath empty for images but not empty for audio-files, PDF-files, webLocations etc.?
JeffTucker

Posts: 8,212
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 21:42   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
palthe wrote:
Just trying to point out some little inconsistencies in jAlbum....

Oh, you've barely scratched the surface!

If you want a little snowy day activity to keep you off the streets, try looking at the content of originalPath with images, videos that jAlbum is encoding, and videos that jAlbum is not encoding.

Still not sufficiently puzzled? Go further down the rabbit hole: remember that a user can assign an otherwise-unrelated image to serve as the poster image for a video (or audio, or PDF, etc.). This might be of any dimensions, since it's not being drawn from the video. Try that with and without Use original, and with various re-encoding options.

BTW, a poster image that's drawn from the video should, by definition, be the same dimensions as the video itself. Since it's just a frame from the video, how could it be otherwise? I suspect that the erroneous image dimensions are coming from the same error that produces the erroneous video dimensions. I just don't have the energy to hunt it down.
JeffTucker

Posts: 8,212
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 21:54   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
palthe wrote:
I make sure that the size of the video-player is in line with the size of the images, regardless of the actual size of the mp4-file.

I do the same in my skins (I'm using either Floatbox or a slide page with my own home-brew responsiveness - in a couple of older skins I used Highslide JS), but I don't rely on the image dimensions being reported by jAlbum. I confine the video player dimensions to the image bounds chosen for the project, or to the actual dimensions of the video, whichever is smaller. But if the user chooses Link to originals, the image bounds are ignored, and the actual video dimensions are left in control of the player size.

Somewhat off-topic, and I don't know the FancyBox script, but does it use the actual image dimensions to figure out the maximum lightbox size, or does it rely on what you tell it about the dimensions? If it's the former, you might want to experiment with the HiDPI images option, which produces double-sized images, but then lies about the dimensions when asked about the them. If you don't deal with that, you get oversized lightboxes.
palthe

Posts: 24
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 22:35   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Fancybox normally uses the actual size of the image/video as the maximum size for the lightbox, but it has two optional link-attributes data-width and data-height which you can use to force another dimension. But also for Fancybox I've only scratched the surface...
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums