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


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

Posts: 16
Registered: 27-Dec-2009
VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 17:30
 
  Click to reply to this thread Reply
When I add an MP4 video file to an album (as link) and look at the size variables, I get the following values:
imageWidth x imageHeight = 640 x 360
originalWidth x originalHeight = 1920 x 1080
videoWidth x videoHeight = 10000 x 5625

My album settings are:
Album > Settings > Images > Image bounds > Images =640 x 640
Album > Settings > Videos > Resolution = Do not re-encode

Also for other-sized video's the videoWith value is always 10000. The videoHeight value reflects the correct aspect-ratio.

If I additionally select the option 'Do not re-encode' via the context menu of the video in Explorer-view, I get:
imageWidth x imageHeight = 640 x 360
originalWidth x originalHeight = 1920 x 1080
videoWidth x videoHeight = 1920 x 1080

Now the values are correct.

Is this a bug?
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 17:44   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
Where are you seeing the 10000x5625 value? Where are you "looking?"
palthe

Posts: 16
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 19:05   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I added the following to my index.htt file, inside a <ja:fileiterator></ja:fileiterator> block, made the album and opened the created index-page in my browser.
<div class="w3-tiny">
	fileCategory = <b>${fileCategory}</b><br>
	currentFile = ${currentFile}<br>
	-imageLinking = <%= engine.getImageLinking() %><br>
	-slides = <%= engine.isSlides() %><br>
	-copyOriginals = <%= engine.isCopyOriginals() %><br>
	link = <%= currentObject.isLink() %><br>
	includeOriginal = <%= currentObject.isIncludeOriginal() %><br>
	useOriginal = <%= currentObject.isUseOriginal() %><br>
	
	originalPath = ${originalPath}<br>
	thumbPath = ${thumbPath}<br>
	imagePath = ${imagePath}<br>
	closeupPath = ${closeupPath}<br>
	contentPath = ${contentPath}<br>
	iconPath = ${iconPath}<br>
	videoPath = ${videoPath}<br>
	
	thumbWidth x thumbHeight = ${thumbWidth} x ${thumbHeight}<br>
	imageWidth x imageHeight = ${imageWidth} x ${imageHeight}<br>
	originalWidth x originalHeight = ${originalWidth} x ${originalHeight}<br>
	videoWidth x videoHeight = ${videoWidth} x ${videoHeight}<br>
</div>


Edited by: palthe on 10-Feb-2021 19:05
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 20:59   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
That's an interesting bug!

If the skin has separate slide pages, by the time the core gets to processing slide.htt, everything is correct again. This bug shows up only on index.htt, within an iterator.

There are also two different "flavors" of the bug. Both can trip up a skin that doesn't have slide pages, and is using data on the index page to control things like the lightbox layout.

First, if you choose Videos > Resolution > Do not re-encode, the core reports the video dimensions as 10000 x something (according to the aspect ratio). It should report either the dimensions of the existing output video (which might have been the result of some earlier processing), or, if there is no output video, the resolution of the original (which will get copied to the output).

Second, if you make any other choice for resolution, but choose Do not re-encode on the individual object, a different, but similar error occurs. The core always reports the dimensions of the original, even if there is an existing output video that has different dimensions.

ETA: Within slide.htt, the core makes the same mistake in this second case. It reports the dimensions of the original video, even if there is already a video sitting in the output that has different dimensions. It should, of course, report the dimensions of the video that is actually going to be used in the album.
palthe

Posts: 16
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 22:26   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Software is a bit like the jungle of Borneo: always new animals to discover...

Actually I don't use these variables in my skin, so the bug is not a problem for me. I just found it by accident when I was experimenting with some variables to see how they behave under different conditions.
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 10 Feb 21, 23:14   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
It plays havoc with my skins. And it blows Tiger out of the water. If you choose Do not re-encode for the video resolution, you end up with videos that are blown up to the viewport size, in many cases way beyond their native dimensions, and the result is blurry as can be.

Happily, most users stick to the more "normal" settings (like 720p resolution), and things work fine when you do that.
palthe

Posts: 16
Registered: 27-Dec-2009
Re: VideoWidth and videoHeight have wrong value
Posted: 11 Feb 21, 15:43   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Well, I still hope you can find and repair the bug
I always edit and re-encode my videos outside jAlbum, so for me the option "Do not re-encode" is normal.

By the way, in my opinion the context menu option "Do not re-encode" for individual videos should be disabled when you already have set "Do not re-encode" in the album-wide settings.
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 15 Feb 21, 17:33   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
David, this is a much more important bug than my strange "deleting a project that hasn't even been saved yet" issues, which affect pretty much only me.
davidekholm

Posts: 3,459
Registered: 18-Oct-2002
Re: VideoWidth and videoHeight have wrong value
Posted: 16 Feb 21, 19:56   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Try a core update now (Tools->External tools->"jAlbum core update") and restart jAlbum when prompted. The splash screens should now say v23.2.2 (you need v23.2 installed prior to this). Now the videoWidth and videoHeight should be correctly reported.
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 16 Feb 21, 22:31   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Well, it's getting closer. I'm no longer seeing the truly bizarre 10000 x something dimensions.

But there's still one very common situation that it's lousing up. Start with a 1920x1080 video. Choose 720p as the video setting, and make the album. The output video is 1280x720, as expected, and the dimensions are reported as 1280x720. So far, so good.

But now either choose Do not re-encode as the video setting, or just choose that for that one object, and make the album again. The dimensions are being reported as 1920x1080, but the video that's sitting in the output directory is still 1280x720. The video has not changed - it shouldn't - but the core is now reporting the wrong dimensions for it.
davidekholm

Posts: 3,459
Registered: 18-Oct-2002
Re: VideoWidth and videoHeight have wrong value
Posted: 17 Feb 21, 13:06   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Well, it's getting closer. I'm no longer seeing the truly bizarre 10000 x something dimensions.

But there's still one very common situation that it's lousing up. Start with a 1920x1080 video. Choose 720p as the video setting, and make the album. The output video is 1280x720, as expected, and the dimensions are reported as 1280x720. So far, so good.

But now either choose Do not re-encode as the video setting, or just choose that for that one object, and make the album again. The dimensions are being reported as 1920x1080, but the video that's sitting in the output directory is still 1280x720. The video has not changed - it shouldn't - but the core is now reporting the wrong dimensions for it.


Ah, I guess all sorts out if you manually delete the video from the album folder and make the album again. This triggers a copy. What I could do to handle this situation is to quickly compare file sizes between the generated video and original video. If they differ, then I simply copy the video to the destination, right?
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 17 Feb 21, 13:13   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
NO! That's backwards.

C'mon, think this through. I've generated an album with the video resolution set at 720p. The output video is exactly the way I want it. I now change the video resolution to 1080p, but I don't want that video processed again. I set it to Do not re-encode. I don't want it processed to 1080p. But I don't want the original copied to the output, either. I want to leave that already-processed 720p video alone, and I want the dimensions on the album page to get set to 1280x720.

Here's the schema:

  • If I choose Do not re-encode, look at the output directory.
  • If the video is there, don't touch it. Determine its dimensions, and report those as videoWidth and videoHeight.
  • If the video isn't in the output, copy the original video to the output, and report its videoWidth and videoHeight.
davidekholm

Posts: 3,459
Registered: 18-Oct-2002
Re: VideoWidth and videoHeight have wrong value
Posted: 17 Feb 21, 13:27   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Ok, now I get it. It would mean breaking the rule of gathering all metadata from the project though...
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 17 Feb 21, 13:56   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
You already know what I'm going to say about this, don't you? ;)

The basic problem is that videos aren't handled the same way images are.

The current scheme has a fatal flaw, to wit, that the video dimensions reported to the HTML may not match the dimensions of the video that's actually in the album. So how do we address that?

If video and image processing were parallel, it wouldn't really be a problem. If the video is tagged as Use original, the original would be copied to the output, and its dimensions would be correctly reported. If it's not tagged as Use original, it would get processed using the current video resolution setting. It would be just like images, which get rescaled to the current image bounds. There's no option for scaling to one set of bounds, then changing the bounds but having the image still sitting there with the prior scaling.

Why should videos be different? I guess you could argue that the processing time is so onerous, you don't want to trigger a bunch of reprocessing if you change the video resolution. But I can't think of an elegant way to handle that.

The confusion stems from the Do not re-encode option. What does that really mean? How is that different from Use original with images?
JeffTucker

Posts: 8,075
Registered: 31-Jan-2006
Re: VideoWidth and videoHeight have wrong value
Posted: 18 Feb 21, 15:18   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
The current scheme has a fatal flaw, to wit, that the video dimensions reported to the HTML may not match the dimensions of the video that's actually in the album. So how do we address that?

Conceptually, I can think of only two ways to tackle this.

First possibility: if the object is marked Do not re-encode, or if that's the video resolution setting, and there's a video sitting in the output directory, figure out its dimensions. Reliable, but that does shift some of the metadata out of the project directory, so it's unappealing.

Second possibility: when you process a video, stash its resulting dimensions in the .info file. Now, on a subsequent build, if it's marked Do not re-encode and the output video still exists (the user might have deleted it, maybe even outside jAlbum), grab the dimensions from the .info file.
Legend
Forum admins
Helpful Answer
Correct Answer

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