Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: FLAC version & vendor string (Read 8355 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC version & vendor string

i seem to be getting a vendor string in my flac metadata that indicates version 1.1.0 of the codec is being used, when i have installed 1.1.2. instalation was with the standard windows installer (inc. frontend) from the flac site.

have scanned my machine for old versions of flac.exe, but everything is at 1.1.2.

direct extractions to flac using plextools report 1.1.1 - assume they have not updated the libraries.

no big deal i guess, but am i dillusional or could something more sinister be going on?

any pointers appreciated.

thx.

h.

FLAC version & vendor string

Reply #1
search for libFLAC.dll, there could be a stray old version of that lurking somewhere higher up in your search path.

Josh

FLAC version & vendor string

Reply #2
Everytime I look at my freshly encoded flac files in foobar they say v1.1.0 even though it is infact v1.1.2, I use the Windows FLAC Frontend v1.7.1 eTree Edition with the newest FLAC.

FLAC version & vendor string

Reply #3
Thx Josh.

I'll check the .dll file this evening.

I did a little more playing around yesterday evening after writing the post. The issue seemed to be around a bunch of files i encoded a few weeks ago. New wavs were getting encoded OK, with a 1.1.2 vendor string. Digging a little further, it looked to me like my tagger (MP3Tag) was deleting the vendor string when i deleted all the tags in a particular FLAC. And I think I may have done that with these files as I set the tag import incorrectly in the frontend (memory bit hazy though).

If you then re-tag the files, the vendor string comes back with a different value depending on what you use to tag it - foobar gave 1.1.1 - beta for example.

It was late, and I was a little tired, but that's my current theory. Assuming this is the case (will test a bit more later), I should probably post on the MP3Tag forum - it would probably be desirable for a tag delete to delete everything apart from the vendor tag, right???

thx.

h.

FLAC version & vendor string

Reply #4
Quote
It was late, and I was a little tired, but that's my current theory.

yep, that's probably it.

Quote
Assuming this is the case (will test a bit more later), I should probably post on the MP3Tag forum - it would probably be desirable for a tag delete to delete everything apart from the vendor tag, right???

yeah, usually you would just want all the fields removed.  like with metaflac you want "metaflac --remove-all-tags" (which leaves the vendor string) not "metaflac --remove --block-type=VORBIS_COMMENT"

Josh

FLAC version & vendor string

Reply #5
I'll change it to the next release. Thanks for pointing that out.

Best regards,
~ Florian

FLAC version & vendor string

Reply #6
Thx Florian. Sorry, should have closed the post saying I'd informed you ...

FLAC version & vendor string

Reply #7
OK, I am sure you will kick me for keeping this one going but ...

It appears to me that multiple things were causing the issue. Here's where I am at ...

1. Florian has fixed (in rapid time) the issue with MP3Tag so that the vendor string is retained, even on a tag delete, which is kool.

2. But, I was still getting (in some cases) a vendor string of "1.1.0" when using FLAC Frontend.

3. I looked for libFLAC.dll, and there was one there! In the MusicBrainz install. I wasn't using it so uninstalled completely from my machine. Searched every disk for libFLAC and it's gone.

4. But was still getting a "1.1.0" string using FLAC Frontend. However, I recalled having tested it the other night and deffo getting "1.1.2". So dug a little further.

Bare with me on this for a sec ...

5. Now, if I create a FLAC using Frontend but without adding tags I get "1.1.2" ... But if I have the add tags check box ticked I get "1.1.0". So it's only when you add tags that it happens (for me at least).

To be honest it's not a big problem as I can just set the tags after the encoding ... but if there's anything else I should look for let me know.

And finally, just one more thing ...

I thought it was worth going through my "suspect" files and re-encoding so that everything is "clean". It's easy enough as I scripted it so that the tags were preserved. The script basically scans folders, finds FLACs, reads the tags, decodes, and then encodes writing the tags.

Have noticed though that FLAC seems to set the last modified date to that of the original WAV. Again, no big deal, but it meant the files were not backed up/copied to my slim server, as the software I was using only checks the file mod date (not the creation date). I just resaved the tags using MP3Tag, bit it *may* be good to set the mod date according to the encode time (am thinking that as the tags have been added the file has effectively been modified).

Right, am off down the pub as I think i need to get a life ...

H.

FLAC version & vendor string

Reply #8
Quote
5. Now, if I create a FLAC using Frontend but without adding tags I get "1.1.2" ... But if I have the add tags check box ticked I get "1.1.0". So it's only when you add tags that it happens (for me at least).

maybe flac frontend statically links with libFLAC? (I thought it just called flac.exe).  I don't know what the windows equivalents are, but to track down stuff like this on unix I use 'ldd' (shows shared lib deps), 'nm' (shows symbols in object files), and 'strings' (shows printable strings in binaries).  so I would start with 'ldd' and 'strings' 'on the flac frontend and look for 1.1.0 references.

Quote
Have noticed though that FLAC seems to set the last modified date to that of the original WAV. Again, no big deal, but it meant the files were not backed up/copied to my slim server, as the software I was using only checks the file mod date (not the creation date). I just resaved the tags using MP3Tag, bit it *may* be good to set the mod date according to the encode time (am thinking that as the tags have been added the file has effectively been modified).

hmm, I thought I had an option for that but I guess not, should add it.

Josh

FLAC version & vendor string

Reply #9
Quote
Quote
5. Now, if I create a FLAC using Frontend but without adding tags I get "1.1.2" ... But if I have the add tags check box ticked I get "1.1.0". So it's only when you add tags that it happens (for me at least).

maybe flac frontend statically links with libFLAC? (I thought it just called flac.exe).

FLAC frontend just makes a batch file for flac.exe and executes it. For tagging it uses Tag.exe, and Case's last version(2.0.39) uses libFLAC 1.1.0...

-Martin.

FLAC version & vendor string

Reply #10
aha, mystery solved.

FLAC version & vendor string

Reply #11
I ran into this issue with the libflac version not matching up with my flac.exe I was using.  I was pulling my hair trying to figure this out and searched through this forum and found this old thread.

I just wanted to mention that if you use the current FLAC FrontEnd (flac113b.exe) for adding tags it will show "reference libFLAC 1.1.2 20050205" in the properties of the flac file.

I understand the problem has to do with the libflac.dll version used when tag.exe is compiled.  This might be a lot to ask, but is it possible that when new Flac versions come out and the Windows Installer File with the Frontend is created, that tag.exe be recompiled to match? 

This would certainly make it less confusing for others that might come across this issue in the future.

FLAC version & vendor string

Reply #12
If it is using Case's original then there is little hope of a change.

I have just compiled 2.0.48 to use libFLAC 1.1.3.
I'm on a horse.

FLAC version & vendor string

Reply #13
For anyone that is interested, I just kludged up this yesterday.  It will read the vendor string in a flac file and display it and exit with a code equal to the encoder level: i.e. version 1.1.3 would yield an exit code of 113.  I'm using this in a script to conditionally re-encode my flacs using the newest version.

FlacGetV.c:
Code: [Select]
/*
    FlacGetV.c -- displays the flac vendor string and returns an errorlevel.
*/

#include "FLAC/ordinals.h"
#include "FLAC/assert.h"
#include "FLAC/format.h"
#include "FLAC/metadata.h"

#include <stdio.h>
#include <string.h>

#define QUIET    0x00000001
#define MAXPATH 260
#define STRSIZE 260



void DispSyntax(void)
    {
    puts("FlacGetV: returns the encoder vendor string from a flac file. \n\n"
          "Synatx: FlacGetV filename [-q]\n\n"
          "The optional \"-q\" arg supresses output.\n\n"
          "Returns: An errorlevel indicating the version of FLAC that encoded\n"
          "         the flac file.  E.g.: FlacGetV returns errorlevel 113 for\n"
          "         flac files encoded with reference libFLAC 1.1.3 20061120.\n\n");
    }




FLAC__bool GetOpts(int argc, char *argv[], unsigned int *pOpts,  char *lpFileName)
    {
    int n;

    if (argc < 2)
        {
        DispSyntax();
        return false;
        }

    memset(lpFileName, '\0', MAXPATH);

    *pOpts = 0;

    for (n = 1; n < argc; n++)
        {
        if (argv[n][0] == '-' || argv[n][0] == '/')
            {
            switch (tolower(argv[n][1]))
                {
                case 'q':
                    *pOpts |= QUIET;
                    break;
                }
            }
        else    //this must be the filename..
            strcpy(lpFileName, argv[n]);
        }
    
    if (*lpFileName)
        return true;

    return false;
    }




FLAC__bool GetVendorString(char *lpVendorString, int nStrSize, char *lpFileName)
    {
    FLAC__bool bRet;
    FLAC__StreamMetadata *pTags;
    bRet = false;

    memset(lpVendorString, '\0', nStrSize);

    if (FLAC__metadata_get_tags(lpFileName, &pTags))
        {
        if (pTags->data.vorbis_comment.vendor_string.length)
            {
            strncpy(lpVendorString, (char *) pTags->data.vorbis_comment.vendor_string.entry, __min( pTags->data.vorbis_comment.vendor_string.length, (unsigned) nStrSize) );
            bRet = true;
            }
        FLAC__metadata_object_delete(pTags);
        }

    return bRet;
    }


int GetVendorInt(char *lpVendorString, int nStrSize, char *lpFileName)
    {
    char szReference[STRSIZE], szBuffer[STRSIZE];
    int nVendorInt, nMajor, nMinor, nSub, nDate, nScanned;

    nVendorInt = 0;

    if (GetVendorString(lpVendorString, nStrSize, lpFileName))
        {
        //Parse this:
        //"reference libFLAC 1.1.2 20050205"
        nScanned = sscanf(lpVendorString, "%s %s %d.%d.%d %ld", szReference, szBuffer, &nMajor, &nMinor, &nSub, &nDate);
        if (!(nScanned == EOF || nScanned < 5))
            nVendorInt = (nMajor * 100) + (nMinor * 10) + nSub;

        }
    return nVendorInt;
    }



int main(int argc, char *argv[])
    {
    char szFileName[MAXPATH];
    char szVendorString[STRSIZE];
    int nOpts, nVendor;

    if (!GetOpts(argc, argv, &nOpts, szFileName))
        return 0;

    nVendor = 0;

    nVendor = GetVendorInt(szVendorString, STRSIZE, szFileName);

    if (nVendor && (! (nOpts & QUIET)))
        printf("%s\n", szVendorString);

    if (!nVendor)
        {
        if (!(nOpts & QUIET))
            printf("Error: %s not found or contains no FLAC vendor string.\n", szFileName);
        nVendor = 255;
        }

    return nVendor;
    }

edit: code fix and added error check.
See http://www.hydrogenaudio.org/forums/index....showtopic=51084 for a win32 binary.

FLAC version & vendor string

Reply #14
If it is using Case's original then there is little hope of a change.

I have just compiled 2.0.48 to use libFLAC 1.1.3.


Thanks for compiling that file.  I'd like to recompress all my FLAC files to the new 1.1.3 version and like having the version string be correct.

I think the previous FLAC 1.1.2 Windows package with tag.exe used 1.1.0 in the string.