Issue 45 in mp4v2: Genre not found

28 views
Skip to first unread message

mp...@googlecode.com

unread,
Dec 3, 2009, 9:50:49 AM12/3/09
to mp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 45 by razone: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

Hello,
mp4v2 cant find Genre tag in an mp4 file. I used mp4info compiled with
VS2005 C++

output:
c:\mp4v2-1.9.1\mp4v2-1.9.1\vstudio9.0\mp4info\Release>mp4info.exe "AAC_Ma
préfér
ence.m4a"
mp4info.exe version 1.9.1
AAC_Ma prΘfΘrence.m4a:
Track Type Info
1 audio MPEG-4 AAC LC, 204.474 secs, 128 kbps, 44100 Hz
Name: Ma préférenceAAC
Artist: Julien Clerc
Composer: Composer_JClerc
Encoded with: iTunes 8.0.0.35, QuickTime 7.5.5
Release Date: 1988
Album: Preferences
Track: 5 of 0
BPM: 0
Part of Compilation: no
Part of Gapless Album: no

iTunes seems to find the genre tag "Vocal"


I am using mp4v2 1.9.1 in a project with the same result. operating system
windows xp, mp4v2 info and library was compiled with VS2005 c++ release
profile

File is attached


Attachments:
AAC_Ma préférence.m4a 3.2 MB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

mp...@googlecode.com

unread,
Dec 3, 2009, 10:15:22 AM12/3/09
to mp...@googlegroups.com

Comment #1 on issue 45 by razone: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

same issue with trunk-355

mp...@googlecode.com

unread,
Dec 13, 2009, 4:02:06 PM12/13/09
to mp...@googlegroups.com

Comment #2 on issue 45 by danahinsley: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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
da...@danhinsley.com.

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

mp...@googlecode.com

unread,
Dec 14, 2009, 8:26:05 AM12/14/09
to mp...@googlegroups.com

Comment #4 on issue 45 by razone: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

Thanks, it worked perfect.

razone

mp...@googlecode.com

unread,
Dec 14, 2009, 8:30:07 AM12/14/09
to mp...@googlegroups.com

Comment #3 on issue 45 by razone: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

Thanks, it worked perfect.

razone

mp...@googlecode.com

unread,
Dec 14, 2009, 2:52:25 PM12/14/09
to mp...@googlegroups.com

Comment #5 on issue 45 by ed...@myreflection.org: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

Danahinsley can now commit code. Thanks Dan. Cheers Ed.

mp...@googlecode.com

unread,
Dec 14, 2009, 6:58:28 PM12/14/09
to mp...@googlegroups.com

Comment #6 on issue 45 by danahinsley: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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 da...@danhinsley.com

mp...@googlecode.com

unread,
Apr 3, 2010, 9:01:04 PM4/3/10
to mp...@googlegroups.com
Updates:
Status: Fixed
Owner: kidjan

Comment #7 on issue 45 by kidjan: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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.

mp...@googlecode.com

unread,
Apr 23, 2010, 6:21:34 PM4/23/10
to mp...@googlegroups.com
Updates:
Status: Accepted

Comment #8 on issue 45 by kidjan: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups "mp4v2" group.
To post to this group, send email to mp...@googlegroups.com.
To unsubscribe from this group, send email to mp4v2+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mp4v2?hl=en.

mp...@googlecode.com

unread,
Apr 27, 2010, 1:58:50 PM4/27/10
to mp...@googlegroups.com
Updates:
Status: Fixed

Comment #9 on issue 45 by kidjan: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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.

mp...@googlecode.com

unread,
Apr 27, 2010, 2:43:30 PM4/27/10
to mp...@googlegroups.com

Comment #10 on issue 45 by kidjan: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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.

mp...@googlecode.com

unread,
Apr 27, 2010, 3:36:19 PM4/27/10
to mp...@googlegroups.com

Comment #11 on issue 45 by razone: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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

mp...@googlecode.com

unread,
Apr 27, 2010, 4:08:20 PM4/27/10
to mp...@googlegroups.com

Comment #12 on issue 45 by kidjan: Genre not found
http://code.google.com/p/mp4v2/issues/detail?id=45

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.

mp...@googlecode.com

unread,
May 11, 2015, 4:29:38 AM5/11/15
to mp...@googlegroups.com

Comment #13 on issue 45 by r...@loci.net: Genre not found
https://code.google.com/p/mp4v2/issues/detail?id=45

(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.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages