About Me

Michael Zucchi

 B.E. (Comp. Sys. Eng.)

  also known as Zed
  to his mates & enemies!

notzed at gmail >
fosstodon.org/@notzed >

Tags

android (44)
beagle (63)
biographical (104)
blogz (9)
business (1)
code (77)
compilerz (1)
cooking (31)
dez (7)
dusk (31)
esp32 (4)
extensionz (1)
ffts (3)
forth (3)
free software (4)
games (32)
gloat (2)
globalisation (1)
gnu (4)
graphics (16)
gsoc (4)
hacking (459)
haiku (2)
horticulture (10)
house (23)
hsa (6)
humour (7)
imagez (28)
java (231)
java ee (3)
javafx (49)
jjmpeg (81)
junk (3)
kobo (15)
libeze (7)
linux (5)
mediaz (27)
ml (15)
nativez (10)
opencl (120)
os (17)
panamaz (5)
parallella (97)
pdfz (8)
philosophy (26)
picfx (2)
players (1)
playerz (2)
politics (7)
ps3 (12)
puppybits (17)
rants (137)
readerz (8)
rez (1)
socles (36)
termz (3)
videoz (6)
vulkan (3)
wanki (3)
workshop (3)
zcl (4)
zedzone (26)
Monday, 11 February 2013, 07:47

Hanger for Pots & Pans

Got sick of shovelling dirt - and besides I finished most of the hard stuff and need the electrician before progressing - so I thought i'd hack up a hanger for my pots and pans and get them out of the draws and cupboards they're choking up at present. Yep, a bit of physical hacking ...

It's something i've been meaning to do for a while - I had some salvaged jarrah which came up something wonderful with a bit of a plane and a sand down, and finished with linseed oil. I kept the design 'simple/modern', and just put a chamfer around the whole piece, there is a larger chamfer in the mid-section which is a rough attempt at hiding a piece missing from one side (it didn't completely remove it and it can been seen in the second shot, but it reached the limit of my tools). It's not very visible so not very important. In general I could've finished it a good bit better but a bit of lived-in rusticity just adds to the charm.

The hooks and chain cost about $50 - mostly from the ceiling hooks which are stainless steel (~24$ for all 4), but otherwise it was just a bit of elbow grease. This old jarrah is almost as hard as steel but luckily I didn't have to do much to it. Trying to locate the beams in the ceiling was a bit tricky and trying to measure square to the walls didn't work - the window end came through right on the edge instead of the middle. At least I know those are in the middle of the beams but i'm not sure about the other end. The anchor points are further away from the centre than I would have liked but I didn't have much choice for stability vs length.

I estimate the total weight is around the 30kg mark - pretty hefty but apart from some initial anxiety I don't think there should be any trouble with it holding up even if it is only anchored in pine. I was worried at first that it would cast too much shadow from the down-lights, but as it sits toward the rear of the kitchen bench it isn't a problem. Same with respect to head-clangers.

It's just under 2m long, and mostly over the sink anyway.

All in all, i'm "well pleased"[sic] with the result. The oil turned the wood from a deep brown-red to a dark chocolate, which works particularly well with the brass plated fittings.

Now I probably need something for the lids ...

But for now my next project is a toe^H^H^Hbiltong cutter, and I think I came up with a cheap and easy-to-procure source for the cutting blade (vs a bench plane blade, which rusts anyway). More on that when i've got it sorted.

It wasn't the only thing i've been up to, I filled all my bottles with homebrew (4x worts), did a batch of biltong, and did some work on one of the gutters today. I really should've written down the second spice mix recipe for the biltong because it's really tasty! From memory the differences were black pepper, pimento (all-spice), fennel seeds, and i'm not sure if coriander came along too. I'm still making some of it a bit too salty (i'm kind of mixing up various recipes on the net but I think i've worked it out for the next lot), although it goes very well with beer ...

Tagged hacking, house.
Wednesday, 06 February 2013, 03:42

It's all down-hill from here ...

I'm a couple of weeks away from being officially 'middle aged', although it doesn't really feel any different from any time in the past 5 years or so. Probably not surprising as nothing has really changed in that time. I guess mainly i'm not going out as much and not riding anywhere near as much but otherwise i'm about the same weight/fitness, same grey/hairline and have a similar set of aches and pains ...!

One thing hasn't changed in a very long time is my cynicism in general - one nick-name at work back in the late 90s was 'Grumpy' - although these days i'm less reticent about verbalising it as bluntly as I feel like at the time.

However one thing in particular I'm getting more and more disillusioned with is the state of technology in terms of software. Despite enormous advances in hardware and information and cost, we still basically have software at about the same level of shittyness as we always have. If anything, it's worse due to the sheer volume of mediocrity dragging the bell curve down. Together with particularly stupid ideas like HTML5. Whilst there are a few gems I believe the core problem is the complexity of software. It just keeps going up - which just means software is always playing catch up and never reaching maturity.

Some people seem to really get off on this constant change - like a manipulative game which doles out worthless rewards piecemeal in order to turn your learning-by-play-for-survival instincts against you - mostly worthless incremental improvements or often just 'change for change sake' which seem to get people overly excited. But we've all seen this shit before - if everything gets better ever release then it must've been pretty shit to start with, and with a certainty whatever we have now will be shit compared to the future, so why all the excitement? It might appear to be rapid progress but in reality it's just spinning the wheels.

This complexity and constant (but in reality unmoving) change is really just a competitive tool to manipulate the public. Think of the fashion industry. On the surface it is vibrant and active but in reality nothing really changes and it just goes around in cycles and it's all about marketing and extracting money.

For example over the last 15 years i've seen an awful lot of man hours go into every system, but the differences to a 15 year old desktop computer are really quite minimal outside of details and performance due to hardware improvements. What improvements there are are really despite the software side of things not because of them.

So here's a few thoughts and rants on many topics in no particular order:

Apple mini ipad
Big mistake. After big jobby's filing-fingers comments it had to be something special, and a low-res screen/underpowered for the time hardware is not it. This severely tarnishes the 'best of the best' premium brand Apple likes to project and is the start of relegating them back to the niche from which they came. After all the "retina" bullshit it really had to have at least that + upgraded cpu.
Microsoft
Lots of stupid mistakes. Phone is a complete disaster, although bringing down Nokia and QT was a good move on their part (removing a huge chunk of the competition - if it wasn't illegal it surely should be). RT is a complete disaster.

Surface PRO is a dumb idea - mostly because it competes with their own customers even if it ever does sell. Which I don't think it will - it's just an overpriced underpowered machine which can't make up it's mind what it is. A business would be better off with a netbook and the general public just wants a dumb appliance.

Unlike some weak willied saps I don't mind saying I hate Microsoft. They set the tech world back at least a decade with their junk and illegal shenanigans and they continue to interfere outside of the open market. And if you don't think that isn't a valid reason for 'hate', I think you need to re-evaluate your value system.

Android
I wish it was a proper GNU/Linux and I wish it was a proper Java. After some initial 'wow, neat', my thoughts have definitely cooled based on it's limitations and roadblocks. It suffers greatly from being designed for 5+ year old hardware whose assumptions no longer hold even for a $50-outright phone.
Google
Google is NOT the friend of free software or 'open sauce'. They are just a user and abuser of it and their customers in general. I wish more in the free software world recognised this. They only contribute when they're legally required or where it suits them commercially or for marketing purposes. Which obviously works well.

They're also a general proponent of the "fuck the user, we know best" mindset which is infiltrating all of IT. Not that I don't sympathise with this substantially, but i'm not the one trying to win over and influence people.

ChromeOS
Yay, thin clients all over again.

Yay, netbooks all over again.

World has been there before. Even battery powered ARM devices are getting powerful enough now they can do much more than run lightweight frontends to network services. Well they could if the frontends were lightweight and not supporting such a heavyweight framework as ...

HTML5
This will be one of the biggest sinks of money and man-power in tech-history. The multi-national software vendors are just using it as a weapon to keep their competitors occupied whilst they cement their own technology. It is now so complex and large it may never be possible to create an implementation of sufficient quality and interoperability. Problems which have forever plagued the net since the first clone of NCSA Mosaic was made will never be resolved. The web is becoming more closed than ever - more and more sites are 'chrome-only' or 'firefox-only', and then only with the absolutely latest versions.
FirefoxOS
See ChromeOS.
SystemD(OS)
The authors don't like Unix and want to create their own clone of Apple's operting system. Sure why not, but why do they have to fuck up a GNU/Linux system to do it? Apart from the ego trip it seems to be about proprietising their brand of Unix and stealing a customer base from what used to be a different product.

Next time I "upgrade" or install a system it will probably be slackware (if i have the choice on the hardware in question, I am hoping it is ARM based). Whilst i'm still using Fedora on a few machines they will not be installed with anything more recent than the already dated version they have.

Java
Oracle need to make the browser plugin free-software or face it's extinction as a platform for Java delivery - not that it isn't that far off at this point. Mostly for security reasons but also for cost and platform support.

The browser plugin has been a PR disaster, but one must also temper it with the fact that for Mozilla, Google, and Apple - Java is a direct competitor. It is in their interest to make it appear as scary as possible as well - and they're sparing no effort there.

At least the GNU/Linux support for Java is finally absolutely first class and in some cases arguably the best of all platforms. As a developer this creates great freedom - it doesn't matter which GNU/Linux distribution I use for development, or which proprietary os the customer does. For me Java is the 'platform', making the system it runs on irrelevant.

JavaFX
Apart from the media stuff which sucks about as much as every other media api ... ever ... it's looking great. The Android and apple versions must be released for free (in terms of cost at least) - there's no real money (of the sort Oracle could justify) to be made in development toolkits anymore and there hasn't been for a very long time.
ARM
Just going from strength to strength. The A15 and big/little stuff looks very exciting but I really want to see some micro itx form-factor machines with desktop-class i/o and memory and first-class GNU/Linux support. The mobile/low power i/o & memory stuff is really hampering the performance where battery power is not an issue and too many machines are just disposable android computers.

There is far too many proprietary parts to ARM SOC's though - including the CPU itself.

Netbooks
Apparently ASUS is dropping them. Apart from some obvious microsoft influence on the decision ... I really just think it comes down to margins for the manufacturers. A cheap product doesn't make much money and with margins so thin in the industry already it just doesn't make any sense for them. Just add a bit more hardware and call it an 'ultrabook' and sell it for a much higher margin instead ...

Presumably we'll be able to get cheep/small laptops intended for the Chinese market for some time to come though, so they will never really 'die'.

Python
Anytime I see a GUI app written in python it just makes me groan. Whilst there are are couple of OK ones in general they remind me of AMOS basic back in the day, or tcl/tk. Sure you can write applications with it but in general they're shit and even the really good ones are noticeably less than the best on the platform. I figure this is mostly because the sort of people who choose python choose it because it's "easy", which means they're probably not very good coders to start with - because it's really no different to any other language. Still can't even do threads ffs.
AMD
Good hardware, software getting better, but I just don't know what's going on there. Can they deliver with their grand plans of the HSA? Don't know, don't know. HSA is very exciting but I'd be more comfortable if it wasn't a consortia of a who's who of the also-rans of the multinational user-abusing elite.

If it isn't some ARM SOC, I want my next laptop to be a GCN based APU with full GNU/Linux support but i'm not holding my breath (and with 2 thinkpads which are still kicking along fine, i'm in no rush).

OpenCL
Whilst I think it's fun and cool, it's still not ubiquitous enough for software developers to rely on. Its also too hard for most modern developers who just don't seem to be very good at their jobs to start with. I'm not sure if this is because programming has been dumbed down too much (when we did software engineering 1 at uni, the whole mantra was that coding was so boring it should be given to low-cost code-monkeys and only the high level design mattered - but that wasn't true then or now), poor education, people are just too lazy, there's better money for the type of people good at it elsewhere, or some other reason.

Still - regardless of all that it is too hard and too costly to develop for OpenCL in general so improvements need to be made somehow. Ideally something like the Sumatra project in openjdk together with project lambda which makes it relatively transparent.

The HSA stuff is the widest industry push for something a bit more substantial to try to break the homogeneous multi-core mould - intermediate bytecode, support for more languages and an UMA for cheap cross-processor calls. Still to be honest - more than one cpu scares the willies out of most programmers so I think even that is likely to be too much to ask.

OTOH computers are so fast these days single core programming is more than adequate for the majority of processing tasks anyway.

Time
... is an illusion, lunch time doubly so. I think time is not a dimension but merely a measure of passing state. i.e. one can only travel forward in time at a fixed-rate (relatively) as the only state which exists is 'now'. This does away with nonsense like parallel universes required otherwise. Whilst general relativity is a great model of the universe which fits many practical problems, like every other model it is only a model and not the mathematics and machinery on which reality actually executes. No matter how fine or reliably the measurements match.

Not that I have any evidence for it, I suspect that the universe is infinite of age and size and the popularity of the big bang theory (and most of cosmology in general) has it's roots more in Abrahamic theology than in hard science. After all a big bang still needs a starting point and cause.

I don't believe FTL travel will ever be possible, and humans will never leave the solar system (too much energy required). Stephen Hawking and their ilk dreaming of a star-spanning future for humanity is no better to me than believing in the sky faery of an Abrahamic god, or that advanced (i.e. god-like) aliens will save the day.

The earth
We only have one world, we'd better work that out soon or be doomed. I don't hold much hope. Humanity has been given a cruel legacy from it's evolution - it is just too effective at breeding and controlling the wild environment that it will clearly consume all resources before it learns to live within it's means. And the only practical solutions are too morally objectionable to be contemplated - i.e. population control. Our evolutionary training has even ill-equipped us for a modern world of relative safety and internationalisation.

Of course given we are on a single planet the population will be controlled one way or another by itself - famine, epidemics of disease, natural disasters, man made disasters, accidents, wars.

We're already seeing nature fighting back - anti-biotics will no longer work effectively very soon and the results will be catastrophic, perhaps cataclysmic. This will happen in my life-time. In the past individual groups might have died out or be decimated by localised disasters, but we will clearly face global catastrophes in the not-too-distant future. I suspect at some point in the not-too-distant future many of the hailed medical advances of the 20th century - antibiotics in particular - will be seen as a near fatally-dangerous mistake.

Whilst I reckon life is widespread throughout the universe (just look at how widespread it is on earth - anywhere with water + energy = life), "intelligent" life may itself be an evolutionary dead-end.

free will
I'm not sure whether free will exists or doesn't, but any system as complicated as any animal is so chaotic it probably makes no practical difference no matter what the physics suggests.

But I am convinced you have no soul.

Religion
Whilst adults are free to believe whatever brainless nonsense they wish, I think religious indoctrination of children is tantamount to mental abuse. Particularly the hell and eye-in-the-sky aspects.
Tablets
Whilst I think they're here to stay I see them as a somewhat disturbing trend away from a general purpose computer. Although they have some usefulness on the whole they are just throw-away devices used to deliver mindless entertainment to the unthinking masses.

The OLPC coming out with a tablet really put me off their whole project - a computer without a keyboard isn't useful enough for learning the skills needed for the future.

IT skills - including scripting and programming - is a huge competitive advantage to any industry that involves workers using a computer. Whichever country decides that this needs to be part of the core educational set (like it was when I was a kid, and not just learning a few arcane microsoft applications) will surely have a bright future.

Parallella/Epiphany
Well i'm basically waiting on the hardware before I get too excited on this one. Still don't have any particular application in mind but I'm hoping it's fun to code on for the entertainment value alone.
Patents/eye pee, etc.
This sort of extortion, commons-stealing, and rent-extraction is unforgivably a direct result of the corrupt political system we all have in the west. I don't currently see any solution to this problem whilst courts are involved.

It will just be an on-going cost of doing business which will be borne by the general public to the detriment of most and the benefit of very few.

The only hope is for China to ignore it all (as they are) and booming as a result (as they are), and the western countries starting to look at their own self interest instead of the interests of the pan-national rentiers to which they currently answer (hah, asif). Although the pan-nationals have their fingers in the pie over there too.

Given that the USA isn't far off a developing country as it is (run-down infrastructure, high infant mortanity rate etc) if they haven't already done something about it I don't see much chance for change. I just hope Australia's current obsession with the USA and it's demonstratively bad-ideas cools off a bit and keeps us from the same route.

Playstation 4
Who cares? Fuck Sony.
Work/Leave
Well i'm on my 8th week of leave and I gotta say i'm getting pretty comfortable with the idea. Pity it can't last forever ...
Tagged biographical, philosophy, rants.
Wednesday, 23 January 2013, 03:54

Short hacking break

Finally got into some house stuff so have had a break from hacking. I'd hit a few 'milestones' anyway and thought it time for a decent break from it whilst i'm still on leave. Haven't been particularly interested in reading much net or watching much tv either.

Been fairly busy - cleared some overgrowth, did some downpipes, adjusted my suit trousers for a funeral (after 15 years and that adjustment, the suit still fits), got some road-base and barrow-ed it around the house, bought some pavers, ... That and a few other things should keep me busy for a few weeks.

Tagged biographical, house.
Wednesday, 16 January 2013, 09:28

Kobo stuff

Well i had to do a factory reset of the Kobos - I just couldn't be fucked with seeing a blank page every time I opened a text file and dealing with their embarrassingly slow font tweaking window. I left it at the version it came with and just bypassed the "must have an account and be logged in to even use the machine" bullshit it comes with.

Very nice when simply "logging out" has it reboot to what appears to be a factory reset (it isn't, it just looks that way).

I left a rant on the mobileread forums about how shitfully fucked and slow the firmware is, but i'm just one voice amongst many there.

Anyway, so I guess I did do some kobo hacking soon rather than later after-all, and today I spent too much time today playing with some new widget code.

Basically i'm not all that happy with the old gadget toolkit stuff - although it surely would do the job. And although some guy who took a copy of some of the ReaderZ code via the koper project worked out how to make Swing talk to an alternative device (looks easier than I thought) ... after JavaFX i'm not a big fan of Swing either.

So, foolishly I started hacking on another toolkit which is basically a "cut down JavaFX". Which is obviously a bit pointless in itself because it should eventually be available in the ARM backend ... although that depends on if they support it for the soft float abi, and unless it comes with native eink support it might not be so easy to add it in.

Actually I just noticed that openjfx is GPLv2 + classpath exception, which I missed the first time I looked - should have been obvious I guess. Maybe I should just look at that (when it's ready?) ... although I guess by the time I get anything working maybe kobo will have released a working-enough firmware like 2.0.0 was.

Tagged hacking, kobo, rants.
Tuesday, 15 January 2013, 06:59

Kobo glo

So i was a bit bored so I went and got a kobo glo today - although there's nothing wrong with my kobo touch and I use it all the time, I though the light might be handy. And besides it isn't very expensive. Actually I got two, as i'm going to give one to my luddite sister who is in to reading books but otherwise wouldn't bother with such a machine.

I'm still going through the 'something happened to your network' errors whilst configuring it using the kobo setup software inside wine, but at least it appears to be working ... It did the upgrade now it's just syncing some books or something. Oh I can just skip that.

So I finally got to try the backlight after all that - the one in the shop (officeworks - bloody useless for customer service but it's close to me, although they only had black, or black) wasn't configured so just showed the setup screen. Looks like it's supposed to I guess, I will have to wait until I read tonight. If anything there is a slight bright line across the very top and slight dark line across the bottom but the whole text area is nice and even. The higher resolution vs the kobo touch is noticeable too, and now it's about the limit of my tired eyes.

The hardware looks nice as always - but it's a pity the software still has issues. Although the lack of the re-assuring home button is ... well, not as re-assuring as it is having one on the kobo touch. And the soft quilted back isn't as soft in it's quilting as the touch is. As to the software, the i/o code needs to be multithreaded or something so it's more responsive to clicks, and other annoying things. Like setting the font waits for the whole document to be reformatted before refreshing. And it still takes FOREVER to close a text file down (sometimes ... garbage collection is a massive massive win).

Speaking of fonts, Times New Roman has vanished! Only left with Georgia as a remotely decent serif font - which is just not good enough. I tried some of the 'fattened' ones on the mobileread forums but ended up with DejaVu Sans Serif for now - the descenders are a bit squat and the serif's aren't pointy enough but otherwise it seems ok. Unfortunately the font fine-tuning which I used on the touch doesn't work on third-part fonts but i'm happy enough with the weight as it is.

Anyway, this frees up my kobo touch for just hacking on, although I don't have any immediate plans for doing so. Whilst I have some holidays left I need to get some shit organised around the yard, well if i don't get too lazy ...

Update: Well I 'upgraded' to the latest firmware, and it's pretty fucked. Dropped linux filesystem support - well that's not the end of the world. But text files always open blank until you change the font settings. And they are excruciatingly slow to close or to suspend - it takes 25 seconds to suspend when reading one text file, which is about how long it takes to 'close' a text file as well. The touch with it's older firmware is pretty fast.

The hardware is mostly excellent, why is it so let down by shitty software?

So maybe it wont be that long before i'm hacking on it after-all ...

Update: So after having it for 6 weeks, here's a little update.

I did a factory reset to restore the original firmware it came with and bypassed the "must be logged in to use" mis-feature, and just load books using usb mass-storage or the sd-card. This makes it a pretty usable reading device, although without connecting to kobo I don't get a dictionary - but I can live without that even though it would be nice to have.

I've warmed to DejaVu Serif (extended version of Bitstream Vera Serif) and actually prefer now it to the Times New Roman on the touch (I never quite liked Times New Roman before, a little too thin). It just has a nice weight and horizontal density and good readability on the e-ink screen. The higher resolution of the glo is definitely noticeable compared to the touch too.

The backlight is really useful, allows me to read anywhere without any extra bits or reaching to turn off lights. I like the way the on/off button for the light works - unobtrusive and easy to access. As mentioned in some reviews I read, it would be nice if it was a touch dimmer at it's lowest setting for reading in a completely dark situation, but it's still comfortable enough as it is.

The battery life is definitely better than the kobo touch was which seemed to drain fairly fast in suspend mode, although i've been reading more epub's which seem to use orders of magnitude less cpu resources than text files.

The touch responsiveness is "adequate". It still seems to miss touches sometimes or get ones I didn't intend at others if my fingers are near the edge of the screen, but it's a minor annoyance. I'm not a 'skim reader', so any delay from a wrong page isn't the end of the world.

My sister is also really happy with the one I bought her, for the convenience and backlight, and also having access to old editions of classics which are hard to find in the cultural backwater where she lives.

The only thing I can say I really miss is the soft-quilted back cover! The touch is definitely nicer to hold with the raised diamond pattern versus the flat one. It's a feature I would never have thought to be quite so important but it was one of the first things my sister mentioned when I showed it to her and I would have to agree it is noticeable.

Although I wish they would improve the software, it works fine as a novel reader and I would get another one. Although I can't see needing one until the battery dies it's inevitable non-removable death. The support for standard formats and the ability to use it without any "desktop software" is a real winner for me. I just wish it came like that and didn't need poking at first.

Tagged kobo.
Saturday, 12 January 2013, 03:28

A/V sync II

Had another go at a/v sync this morning. So far it's looking quite good although it needs a good clean-up from so many aborted experiments.

I managed to remove most of the synchronous code that was being used to try and coordinate everything and instead I'm using a centrally coordinated sequence number.

Every packet and frame created has a sequence number associated with it which is maintained through the data flow graph. Every time a seek operation is performed the sequence number is incremented. This feeds through to each stage and lets them make cheap decisions on what to do:

I also use similar code to JJMediaReader so that after a seek it discards any frames which come through before desired seek position.

I still need some out-of-band callbacks for seek and pause because all of the above means the renderers may never see anything, but they don't need to do much.

The android player is somewhat broken so I need to fix that before committing anything.

Update: Got it working well enough and checked everything in. The new sync code causes some extra 'recovery time' after seeking, but once it's settled down it ends up with better sync. The recovery time is only noticeable on slow hardware.

Tagged android, hacking, javafx, jjmpeg.
Friday, 11 January 2013, 04:13

A/V sync

Had a bit of a limp stab at a/v sync today.

I started with something simple although it ended up a bit too complicated - trying to synchronise multiple decoding and display threads is a little messy. I was trying to hide as much as possible inside MediaReader and the Audio/VideoDecoder classes, but it got ugly.

But as far as the timing, the simple approach nearly worked as far as sync goes, there's just a couple of issues remaining:

The simple approach was to have a central MediaClock object which tracks the audio renderer position, and then does various timing calculations for the video sync. It manages pause as well as interacts with seek. Maybe it isn't so simple ...

Eventually I should work it out.

Tagged hacking, jjmpeg.
Wednesday, 09 January 2013, 11:01

Preserving arbitrary Aspect Ratio in JavaFX

I had an attempt at displaying the proper aspect ratio in JavaFX, and after a couple of false-starts came up with a pretty simple solution. The ImageView does it's own aspect ratio preservation but for a WritableImage the pixels are always square - as far as I can tell.

So one must adjust it outside. First I just used:

        vout.setScaleX(aspect);

To set the ratio - this displayed the video properly but didn't take the adjust size into account during layout and fitting to the display area. Not really a show-stopper as the user can just adjust the window until it fits, but I was sure I could do better than that.

I tried various things such as placing the vout (an ImageView) into a Group and so on - but this didn't work (of course) as I was setting the dimensions of the ImageView relative to the window size.

Actually it turned out to be extremely simple: since I'm scaling the ImageView when it is being displayed, I just have to scale the inverse when I'm binding it's dimensions:

        vout.fitWidthProperty().bind(root.widthProperty().divide(aspect));

The height is simply bound to the root.height.

And also remember to take it into account on the initial scene size too:

        Scene scene = new Scene(root, width * aspect, height);

So apart from calculating the aspect ratio, those were the only lines of code required. Seems to work although i've only tested it on one PAL 16:9 video so far ...

Although the screen capture stuff just stores the unscaled frame still ... which is probably what I want tbh.

Well not a bad haul today for a poor nights sleep and feeling a bit crap overall.

Update: Added some shots to show it it works in JJPlayer.

Window too narrow - automatically scaled to fit horizontally:

Window too wide - automatically scaled to fit vertically (and controls fading out):

A raw non-corrected frame grab showing the image using square pixels:

Tagged hacking, javafx, jjmpeg.
Newer Posts | Older Posts
Copyright (C) 2019 Michael Zucchi, All Rights Reserved. Powered by gcc & me!