getmusicbee.com
General => Beyond MusicBee => Topic started by: BoringName on October 29, 2024, 03:05:46 AM
-
BinExtractor.zip (https://www.mediafire.com/file/ga0r28ljngyc88i/BinExtractor.zip/file)
This is a small utility to extract images from a foobar bin file. I threw it together pretty quickly and I don't intend on doing anything else with it.
The open file button will open to the folder the EXE is placed in so probably best to place it in the same folder with the bin files you want to extract.
There are toggle buttons for Show Background, Show LED, Show Needle, Show left and Show right. These determine what will be displayed on the screen and what will be extracted. You can change the current frame with the mouse wheel or by using the slider at the bottom.
Export frame will extract the current frame. Depending on which toggles are enabled it will extract Needle<Frame No.>.png, LED<Frame No>.png and background.png to a "Frames" subfolder. If this folder doesn't exist it will be created in the same directory the EXE is in. Files for the right meter will have an "R" appended to the start of the filename.
Export All will export all frames based on the toggle buttons except it will ignore the Show Left and Show Right toggles. It will export both left and right frames.
Warning: This can result in a lot of files being created, over 4000 in some cases. Number of frames x 4. Left needle, left LED, right needle, right LED. There are no confirmations, warnings or cancel buttons so be careful what you click on.
If you have a skin with LED and no needles make sure you untoggle the Show needle button before clicking export all.
You may find some needle images have part of the background image around them, that's just how they are stored in the bin file, it's not an error with the program.
-
BinExtractor.zip (https://www.mediafire.com/file/ga0r28ljngyc88i/BinExtractor.zip/file)
This is a small utility to extract images from a foobar bin file. I threw it together pretty quickly and I don't intend on doing anything else with it.
The open file button will open to the folder the EXE is placed in so probably best to place it in the same folder with the bin files you want to extract.
There are toggle buttons for Show Background, Show LED, Show Needle, Show left and Show right. These determine what will be displayed on the screen and what will be extracted. You can change the current frame with the mouse wheel or by using the slider at the bottom.
Export frame will extract the current frame. Depending on which toggles are enabled it will extract Needle<Frame No.>.png, LED<Frame No>.png and background.png to a "Frames" subfolder. If this folder doesn't exist it will be created in the same directory the EXE is in. Files for the right meter will have an "R" appended to the start of the filename.
Export All will export all frames based on the toggle buttons except it will ignore the Show Left and Show Right toggles. It will export both left and right frames.
Warning: This can result in a lot of files being created, over 4000 in some cases. Number of frames x 4. Left needle, left LED, right needle, right LED. There are no confirmations, warnings or cancel buttons so be careful what you click on.
If you have a skin with LED and no needles make sure you untoggle the Show needle button before clicking export all.
You may find some needle images have part of the background image around them, that's just how they are stored in the bin file, it's not an error with the program.
hi @BoringName,
thank you for creating BinExtractor utility, that enables us to have a look inside fb2k's VU Meter BIN.
just a wishlist : could you please compile it as a command-line utility ?
in detail, example: c:\BinExtractor.exe c:\fb2k VU Meter\fb2k1000.bin
=> all frames , including background, needles and LEDS (if any) will be extracted into c:\fb2k VU Meter\fb2k1000\left and c:\fb2k VU Meter\fb2k1000\right
reason: we are developing a script to play around with VU meter, but get stuck with fb2k Vu meter BIN.
regards
@ilovefb2k
-
just a wishlist : could you please compile it as a command-line utility ?
I threw it together pretty quickly and I don't intend on doing anything else with it.
Sorry.
If you're trying to automate reverse engineering a bin file I don't think it's going to work as I've found a lot of the needle images do not extract the same as the original. VUEditor seems to do some kind of anti-aliasing when creating the bin file and the needle images tend to have an outline added to them that matches the background image at the position of the current frame.
-
just a wishlist : could you please compile it as a command-line utility ?
I threw it together pretty quickly and I don't intend on doing anything else with it.
Sorry.
If you're trying to automate reverse engineering a bin file I don't think it's going to work as I've found a lot of the needle images do not extract the same as the original. VUEditor seems to do some kind of anti-aliasing when creating the bin file and the needle images tend to have an outline added to them that matches the background image at the position of the current frame.
hi @BoringName,
thank you very much for your very quick reply.
we have scoured the Internet and found your tool as the ultimate solution. as such, we surely will not take it seriously as just want to play around with beautiful fb2k Vu Meter skins.
we hope that you will give it a try later on. for now on, your BinExtractor.exe tool is still the best way to extract that skins.
can we share that tool with others at https://hydrogenaud.io and https://vnav.vn/ 4rums ?
wish you all the best
@ilovefb2k
-
can we share that tool with others at https://hydrogenaud.io and https://vnav.vn/ 4rums ?
No problems with you sharing it. Just make sure to warn people that extract all can create upwards of 4000 files.
I've just found the Jscript thread on Hydrogenaud.io so I'll have a read through and reply there if I think of anything that can help. There is probably a better option than extracting all those images from the BIN file.
-
can we share that tool with others at https://hydrogenaud.io and https://vnav.vn/ 4rums ?
No problems with you sharing it. Just make sure to warn people that extract all can create upwards of 4000 files.
I've just found the Jscript thread on Hydrogenaud.io so I'll have a read through and reply there if I think of anything that can help. There is probably a better option than extracting all those images from the BIN file.
hi @BoringName
wow, it is more than fantastic with your positive feedback.
thank you very much.
regards
@ilovefb2k
-
I didn't plan on doing anything with the extractor but now I've gone and updated it....
BinExtractor1.1.zip (https://www.mediafire.com/file/h0vuneho1gy9eaa/BinExtractor1.1.zip/file)
BinExtractor will now take 2 command line arguments. The first is the path to the bin file and the second is a frame number.
eg)
BinExtractor.exe "C:\FoobarSkins\McIntosh.bin" 400
This will extract the background image, needle and LED frame for frame number 400 into the following folders
C:\FoobarSkins\McIntosh\left
C:\FoobarSkins\McIntosh\right
If there is no right meter the folder will be empty.
The frame number argument starts at zero so if a skin has 1024 frames and you want the last one you need to use 1023.
If the frame number argument is omitted it will extract all the frames. As previously mentioned this has the potential to create A LOT of files, over 4000.
If you specify a frame number argument that is larger than the number of frames in the specified bin file, it will extract all frames.
If you extract a bin file that only has LEDs and no Needles, it will still create a needle file for each frame, they will just be blank.
This is provided as is, use at your own risk. It doesn't really check for errors and if the arguments are wrong it will just exit without letting you know why. Make sure you enclose the bin path in quotes if it has any spaces in it.
-
BoringName, wouldn't work approach to extract say every 10th frame? to don't extract frame by frame manually and don't extract all.
-
BoringName, wouldn't work approach to extract say every 10th frame? to don't extract frame by frame manually and don't extract all.
Really depends on the intended use. If you just want the images to create your own skin or convert it to a different format, you just need 1 frame that has the best image of the needle.
The user I made the change for on the Hydrogenaudio forums wants to extract all the images and reproduce the meter that way. I did warn them it's not the best way to do it but that's what they are going with.
Neither of the 2 options above would benefit from just getting every 10th frame as far as I can tell.
The only useful piece of information stored in the bin file is the Zero frame number. In terms of how the meter moves anyway. It uses the number of frames to create the scale for the meter. if you take 2 meters that are the same except one starts at minus 20 and the other minus 40. The peak value for -20 is 0.10 so the first 10% of frames will show the needle pointing at minus 20. -40 is 0.01 so the first 1% of frames will show the needle pointing at minus 40.
I don't know if I have explained that properly but the point is, if you want to reproduce the skins movement just from images, you need to export all the frames. Otherwise you need to make assumptions and do a bunch of angle calculations to try and replicate the movement.
-
i.e. if i use 400 of 4000 frames, then needle movement will be jaggy, and it's useless?
-
I didn't plan on doing anything with the extractor but now I've gone and updated it....
BinExtractor1.1.zip (https://www.mediafire.com/file/h0vuneho1gy9eaa/BinExtractor1.1.zip/file)
This is a nice and interesting piece of work.
But personally I am wondering if it will really make it easier to build a VU meter skin using an existing .bin file.
By which I mean, if I understand correctly what it can and can not do:
It won't be able to extract perfect images for needle and glass?
It will provide something that can be used as a starting point, but it will require some image editing capabilities to create something useful from them.
What I would be doing (and partly have been doing with my remakes of the Hartmann & Braun and Accuphase skins) :
When loading VU meter in foobar2000, you can adjust the size of the VU meter panel so it's pixel-perfect.
(the right-click menu has a field that shows that information)
Then (by e.g. using some test tone) you can position the needle in an (or a couple of) optimal position(s) to make a screenshot of it.
After that, using something like Photoshop, it shouldn't be hard to create an isolated image of the needle.
Pretty much the same for background and glass.
And about the needle action:
I'm not sure the original needle action is always great and should be tried to replicate.
Why not just use the VUEditor tool to create a nice curve for it?
So I am honestly wondering, will this tool actually be making things easier, or allow for getting better results compared to using screenshots, Photoshop and VUeditor?
PS
Would it be an idea to split posts about this BinExtractor into a new and separate topic?
It would help in keeping this topic more on-topic, and making it easier to navigate through when trying to find relevant posts on the VUMeter plugin.
-
Would it be an idea to split posts about this BinExtractor into a new and separate topic?
Maybe. I really don't want to spend any more time on it because of the reasons above.
Fair enough.
Still I am sure people will be curious about it now or in the future.
So people will be looking for it, and probably will have new questions.
If it had its own topic, people could more easily find it without the need of going through (currently) 400+ posts in this VUMeter topic.
You could then also clearly state there that development and support has officially ended. (if that is indeed the case)
-
I didn't plan on doing anything with the extractor but now I've gone and updated it....
BinExtractor1.1.zip (https://www.mediafire.com/file/h0vuneho1gy9eaa/BinExtractor1.1.zip/file)
BinExtractor will now take 2 command line arguments. The first is the path to the bin file and the second is a frame number.
eg)
BinExtractor.exe "C:\FoobarSkins\McIntosh.bin" 400
This will extract the background image, needle and LED frame for frame number 400 into the following folders
C:\FoobarSkins\McIntosh\left
C:\FoobarSkins\McIntosh\right
If there is no right meter the folder will be empty.
The frame number argument starts at zero so if a skin has 1024 frames and you want the last one you need to use 1023.
If the frame number argument is omitted it will extract all the frames. As previously mentioned this has the potential to create A LOT of files, over 4000.
If you specify a frame number argument that is larger than the number of frames in the specified bin file, it will extract all frames.
If you extract a bin file that only has LEDs and no Needles, it will still create a needle file for each frame, they will just be blank.
This is provided as is, use at your own risk. It doesn't really check for errors and if the arguments are wrong it will just exit without letting you know why. Make sure you enclose the bin path in quotes if it has any spaces in it.
hi @BoringName,
Thank you very very much for your help. without your tool, we can not do anything with fb2k Vu Meter.
But your have just made it more fantastic, we can now extract the BIN file on-the-fly, it works flawlessly.
again, thank you a lot for your time.
wish your all the best and a very happy, enjoyable weekend.
regards
@ilovefb2k
-
f it had its own topic, people could more easily find it without the need of going through (currently) 400+ posts in this VUMeter topic.
Probably the best option at this point. Can a mod move all the binextractor posts into a designated thread or should I create one first for them to move it to?
In other news, I figured out how to write a header into the LZMA file that works. I think I'll post that on the sharpCompress authors github so they can add it into the library.
The benefit of this is I can repackage a bin that used BZIP2 into one that uses LZMA without needing the source files or using VUEditor. I don't really know how useful that is in the scheme of things as most existing skins are small and load fast regardless of the compression used. Anyway I thought it was pretty cool getting that worked out.
-
Thank you very very much for your help. without your tool, we can not do anything with fb2k Vu Meter.
But your have just made it more fantastic, we can now extract the BIN file on-the-fly, it works flawlessly.
I'm curious, what is your end-goal for using this BinExtractor tool?
foobar2000's VU meter plugins are (obviously) working fine using .bin VU meters.
So what is it that you do with the extracted images exactly?
-
Thank you very very much for your help. without your tool, we can not do anything with fb2k Vu Meter.
But your have just made it more fantastic, we can now extract the BIN file on-the-fly, it works flawlessly.
I'm curious, what is your end-goal for using this BinExtractor tool?
foobar2000's VU meter plugins are (obviously) working fine using .bin VU meters.
So what is it that you do with the extracted images exactly?
hi @hiccup,
as we can not decode the bin file (as it is beyond our ability in terms of coding and bin format) although @oops and @BoringName are very kind to give all necessary information. we, then, found that this tool can extract all images of needle, LED and background of a bin.
out of 1024 needle/LED images, we select randomly 1/5 ~ 1024/5 = 205 images scattered along the meter range. we then, by converting the RMS/Peak signal (signal can be extracted by FFmpeg) into an index value, then we can get the needle/LED image to paint.
why 205, as our observation, a FB2k VU Meter is roughly around a 100 degree curve (and it is a curve if diameter length (pivot point x,y) is short enough ) = > 100/205 ~ we may have 2 images per every 1 degree.
on a small screen, this movement id nice enough.
it is not efficient at all, but that is all we have until we may go further.
regards,
@ilovefb2k
-
as we can not decode the bin file ...
Thanks, but that was not was I was really asking.
I asked what your end-goal is for using this tool.
-
The author of the jscript panel plugin that ilovefb2k was using to draw the vumeter has cracked the shits and disabled image drawing in his panel once the script queries audio chunk data so that probably brings that saga to a close.
It's a specific change aimed solely at disabling VU Meters with his plugin. Seems a bit spiteful to be honest but there we go.
-
It's a specific change aimed solely at disabling VU Meters with his plugin. Seems a bit spiteful to be honest but there we go.
Yes, seems like just a sadistic move because he was irritated that posts about the script meters were clogging his thread. I made a separate thread just for the meters to alleviate that, and he destroyed the compatibility the same day. One sad individual.
The meters will continue to run on versions of his JSP3 plugin released from early summer to the 3.8.5 version released 4 days ago so I'm just holding on to the latter for the foreseeable future. I know he can't touch foo_vis_vumeter but I found/find it fun experimenting with new meter implementations. A big thank-you to ilovefb2k for his work nailing the AIMP Analog and LVU meters in any case, you are a smart and decent person.
-
Yes, seems like just a sadistic move because he was irritated that posts about the script meters were clogging his thread. I made a separate thread just for the meters to alleviate that, and he destroyed the compatibility the same day. One sad individual.
I have to admit I can see where he is coming from. Extracting 2000 images just for a vumeter is pretty nuts. Especially when other plugins can display the exact same thing with less overhead. He probably thinks he is protecting people from their own stupidity and it's hard to argue he is incorrect in this particular case. Not just the creators of the plugins but anyone down the line that installs it not understanding what it does in the background.
I have to stop myself dismissing things sometimes just because they don't make sense to me. I didn't agree with ilovefb2k's method but I figured if that's what they wanted to do I didn't mind making the change to facilitate it. Marc obviously went the other direction and took it upon himself to stop what he didn't agree with.
Another update - BinExtractor1.2.zip (https://www.mediafire.com/file/vqpfxti34qzk9f8/BinExtractor1.2.zip/file)
Changes
- Added a "Save Bin File" button. This will save the currently loaded bin as a single Bin file using LZMA compression. It will be saved in the same location as the loaded bin with "_new" appended to the file name.
I'd done the work so figured it was worth sharing.
Use cases -
- Repackage a bin using BZip2 compression to use LZMA which loads a lot faster.
- Repackage an uncompressed bin to use LZMA compression and take up less space.
- Repackage bin files stored as separate files for left and right meters into a single bin file. eg) Accuphase A-46 1.bin, Accuphase A-46 2.bin will be saved as a single bin file Accuphase A-46 _new.bin. May be handy for skin creators to deploy a single file instead of 2.
-
I'm still not sure what ilovefb2k's end-goal for this is/was.
Is it to make it possible to use AIMP skins in foobar2000?
-
I'm still not sure what the end-goal for this is/was.
Is it to make it possible to use AIMP skins in foobar2000?
No, ilovefb2k wanted to use it to experiment with making BIN meters usable in his JSP3 script meter for foobar2000, after doing a great job already with AIMP Analog and LVU skins. Yes the plugin foo_vis_vumeter by oops already handles all three with ease, but experimenting with a new display technique was pretty cool even if it didn't conquer the BIN. Below is a shot of the original hiccup AIMP-version DejaVu Compact LED Calibrated Elemental-mod2 being run in his skin. The latest version successfully added the "Show Peak with LEDs" selectable option.
(https://i.imgur.com/7G65eBr.png)
-
I'm still not sure what ilovefb2k's end-goal for this is/was.
Is it to make it possible to use AIMP skins in foobar2000?
They were using it to implement bin file skins in the jscript plugin for Foobar. I believe they struggled with the code to support it natively so they were extracting the images so they could use their AIMP code instead. It was essentially a very messy work around. Their AIMP implementation probably needs work as well. I can't be too critical, plenty of times I've shoehorned something together in a horrible way just to get it working and then figured out a better way later on.
I'm not really sure what the very end goal was considering oops' plugin already supports them natively which probably has all the configuration options you would need.
-
I'm not really sure what the very end goal was considering oops' plugin already supports them natively which probably has all the configuration options you would need.
That's pretty much what I was figuring. So it is/was more of an interesting experiment, possibly for them learning and understanding how to do or not to do things. Without it resulting in anything that can't already be achieved easier and better.
I'm thinking perhaps one thing it might have brought was CUI support for a VU meter, which oops seems reluctant/unwilling to provide or support?
(some rather weird easter-egg stuff having been mentioned regarding that)
It seems that some developers over there can get annoyed about things pretty easily, and have no problem with lashing out to other users, or obstructing them in doing things that they kind-of don't want them to be doing.
Makes me appreciate developers like you even more.
-
I didn't agree with ilovefb2k's method but I figured if that's what they wanted to do I didn't mind making the change to facilitate it. Marc obviously went the other direction and took it upon himself to stop what he didn't agree with.
With marc2k3 I don't think it went as far as him disagreeing with a method as it was just a surface reaction to his annoyance at the preponderance of the posting level. He's thrown similar "hissy fits" in the past and didn't hesitate in calling people obscene names when they requested help on modifying a JSP3 project that didn't interest him.
Another update - BinExtractor1.2.zip (https://www.mediafire.com/file/vqpfxti34qzk9f8/BinExtractor1.2.zip/file)
THANKS for this, the ability to convert dual BINs into one and changing compression to a speedy format is great and something even an end-user should feel comfortable with. Can it change ALL the other compression options to LZMA, or only BZip2 and uncompressed?
-
Can it change ALL the other compression options to LZMA, or only BZip2 and uncompressed?
Bin files only come with 3 types of compression. BZip2, LZMA or none.
-
Can it change ALL the other compression options to LZMA, or only BZip2 and uncompressed?
Bin files only come with 3 types of compression. BZip2, LZMA or none.
OK was asking as I read this AI statement on Google "BIN files often contain critical binary data where preserving the exact information is essential; popular methods include gzip, bzip2, LZMA (LZMA), and XZ depending on the desired compression level and platform compatibility."
-
OK was asking as I read this AI statement on Google
Two things for a happier life
1. Don't watch the news.
2. Don't ask AI questions. Especially when it's not even AI. It's just a text predictor using the whole garbage pit of the internet as a source.
-
1. Don't watch the news.
the big +1
-
Two things for a happier life
1. Don't watch the news.
I haven't watched, listened to, or read the news since November 5 and I have found that ignorance is bliss.
-
OK was asking as I read this AI statement on Google
Two things for a happier life
1. Don't watch the news.
2. Don't ask AI questions. Especially when it's not even AI. It's just a text predictor using the whole garbage pit of the internet as a source.
You can decide if this makes anyone happier, I just found it interesting:
https://help.2brightsparks.com/support/solutions/articles/43000335985-comparison-of-compression-methods-and-levels (https://help.2brightsparks.com/support/solutions/articles/43000335985-comparison-of-compression-methods-and-levels)
-
I found a few articles when I was trying to work out why bzip2 was so slow. The answer here (https://serverfault.com/questions/872749/bzip2-too-slow-multiple-cores-are-avaible) has a pretty good comparison table.
It seems like Brotli (q1) is the best all round choice but the fact I'd never heard of it and that post is over 7 years old would probably indicate it doesn't have wide support. There are other links there with comparisons to LZMA.
VUEditor was written in a time where storage and download limits was more of an issue. If it was written today, I wonder if compression would have been considered at all.
-
@BoringName
Using BinExtractor1.2 works fine.
VU Editor does something nasty to to the source Back image png when building a BIN. It stores the transparent parts of a background to a grey checkerboard when building the BIN.
How do I replace a background png with a modified png with transparent parts inside the BIN?
Can your tool be modified to replace the background png or is there another way?