GithubHelp home page GithubHelp logo

Genre not found about mp4v2 HOT 13 CLOSED

kcchen2012 avatar kcchen2012 commented on July 17, 2024
Genre not found

from mp4v2.

Comments (13)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
same issue with trunk-355

Original comment by razone on 3 Dec 2009 at 3:14

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
The problem is that there are two ways to specify a genre.  The ~gen atom which
contains a string and the gnre atom which contains a genre number.  It appears 
that
MP4V2 only supports the ~gen atom.  I've created a fix which will support both, 
but
I'm not enlisted so I can't check it in. If you can build the source, go to
src\itmf\tags.cpp, find the line:
    fetchGenre(   cim,                         genreType,         c.genreType );
and after it add:
    if (genre == "") {
        genre = enumGenreType.data[genreType-1].formal;
        c.genre = genre.c_str();
    }
That way if the ~gen atom is empty, it will decode the gnre atom and use it.

If you can't build and would like a fixed DLL, email me at [email protected].

If someone who understand both the format of MP4 files and this code sees that 
this
is a bad solution, please let me know.

Dan

Original comment by [email protected] on 13 Dec 2009 at 9:01

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Thanks, it worked perfect.

razone

Original comment by razone on 14 Dec 2009 at 1:25

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
[deleted comment]

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Danahinsley can now commit code. Thanks Dan. Cheers Ed.  

Original comment by [email protected] on 14 Dec 2009 at 7:51

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Eddy,  I've tried using the same username/password that I use to log into google
code, but it doesn't like it.  Do I have some other username/password that I 
need to
use?  You can email me directly at [email protected]

Original comment by [email protected] on 14 Dec 2009 at 11:57

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Okay, I checked this in, although with one bugfix--it also needs to make sure
genreType isn't GENRE_UNDEFINED:

    // Fix for issue #45 - two different ways to specify a genre string, the
    // ~gen atom which contains a string and the gnre atom, which contains
    // an index.  if our genre is empty and we have a valid genreType,
    // go ahead and populate genre with the correct string.
    if (genre == "" && genreType != GENRE_UNDEFINED) {
        genre = enumGenreType.data[genreType-1].formal;
        c.genre = genre.c_str();
    }

Without the extra check, files that contain either will display an empty genre 
string
in MP4Info.  Hopefully kona can drop in and comment on this change (seems out of
place to me), but it's in r378.

Original comment by [email protected] on 4 Apr 2010 at 12:56

  • Changed state: Fixed

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Reopening...after discussing this with Kona, I'm going to implement a slightly
different change.  Callers should be checking for both genre and genreType if 
they're
interested in a genre value.  

The basic problem here seems to be there's no way to get a string value that
corresponds with genreType.  The one thing we can do is provide a mapping 
between
string values in the enum and genreType.  But with the way the code currently 
is, it
wouldn't be possible for someone to have an empty genre, which is invalid.

Original comment by [email protected] on 23 Apr 2010 at 10:20

  • Changed state: Accepted

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
okay--turns out you can pretty easily fetch the genreType and convert that into 
its
associated string reference:

            if ( tags->genreType ) {
                string s =
itmf::enumGenreType.toString(static_cast<itmf::GenreType>(*tags->genreType ), 
true);
                fprintf( stdout, " GenreType: %u, %s\n", *tags->genreType, s.c_str() );
            }

...I've updated mp4info to show how to do this--it follows suit with many of the
other enum types in the same file, so nothing too extraordinary here.  

I backed out dana's fix (sorry)--it gives a false impression of what's actually 
in
the file; mp4v2 should respect the fact that there truly is no "genre" tag and 
not
misreport the contents of the file.

changes should be in changeset 384.

Original comment by [email protected] on 27 Apr 2010 at 5:56

  • Changed state: Fixed

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Also, to the original poster, I should mention one more thing--you'll need to 
use
r355 or trunk to use genreType, I don't believe they're available in 1.9.1.

Original comment by [email protected] on 27 Apr 2010 at 6:42

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
I`m actually using r355 with dana`s fix, tested with a lot of mp4 files and no
problems. I will upgrade to trunk and report if there are new issues.
Thanks

Original comment by razone on 27 Apr 2010 at 7:35

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
okay--if you use trunk, please make sure you review the changes in r384--I 
updated
the command line utility to show you how to convert the genreType to its string
value.  genre will still be empty/null.

Original comment by [email protected] on 27 Apr 2010 at 8:08

from mp4v2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
(many years pass)

So, I see the code in mp4info and it works fine.  My question is simply how can 
one easily use this approach in their own code which uses mp4v2.  The 
enumGenreType, toString, and assorted other bits that get called into play are 
all in the non-exposed part of the project.  I tried to use as minimal a subset 
as possible of the code and it just kept snowballing needing more headers and 
cpp files that weren't part of the API.
enumGenreType looks like it is actually in the created lib files, but I don't 
see a clean way to hook into it from outside code.

Original comment by [email protected] on 11 May 2015 at 8:29

from mp4v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.