IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Mp4 support now added to opensrc jaudiotagger library
paultaylor
post Oct 12 2007, 16:13
Post #1





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



A first cut of Mp4 metadata support is now added to jaudiotagger Java library. I think this is the only open source Java library that reads and writes mp4 and m4a metadata (itunes format) its released under LGPL with code examples at
http://www.jthink.net/jaudiotagger/examples.jsp. It supports Reverse Dns Field and Multiple Cover Art in addition to the standard metadata fields.

It is working fine for my test cases, but there are some areas Im currently stumped on, if anybody could help me out with any of the following that would be great.

1. How do you properly calculate bitrate?
2. How do you calculate number of channels/Stereo ?
3. Most Fields with Byte type use a single byte (such as cpil and pgap) but tmpo requires two bytes, are there any other byte fields that require multiple bytes.
4.Are there any other binary fields except for the artwork (covr) field
5.How do you set the rtng field
6.In iTunes even if if select a genre from the list it still uses custom genre field (@gen) rather than the genr
field, how do I get it to use genr or ist now defunct.
7. What applications write mp4s with ID3v2 data instead.
8. When modificiations are made to a file my algorithm is as follows
if(total size of metadata under ilst atom ==original size)
(
replace data under ilst atom
)
else if(total size of metadata under ilst atom <original size)
(
replace data under ilst atom
modify size of ilst atom to match size of its metadata
increase size of free atom so meta atom is same size as before
)
else if(total size of metadata under ilst atom >original size)
(
if(total additional size required < (space in free atom - free atom header size))
(
replace data under ilst atom
modify size of ilst atom to match size of its metadata
decrease size of free atom so meta atom is same size as before
)
else
(
extra size = (additional size required - size of free atom)
replace data under ilst atom
modify size of ilst atom to match size of its metadata
dont write free atom
modify size field of meta, udta and moov atom adding extra size
)
)
So even in the last case i never have to chnage any data except the metadata itself and the sizes of its parent and the fiel plays , is this enough or is there anything else that has to be done.

thanks Paul
Go to the top of the page
+Quote Post
paultaylor
post Oct 26 2007, 13:43
Post #2





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



QUOTE (paultaylor @ Oct 12 2007, 16:13) *
2. How do you calculate number of channels/Stereo ?

In the spirit of information sharing did this with by searching for
MOOV.TRAK.MDIA.MINF.STBL.STSD.MP4A
and finding it within the MP4A atom (bytes 16,17)
Go to the top of the page
+Quote Post
menno
post Oct 26 2007, 13:58
Post #3


Nero MPEG4 developer


Group: Developer (Donating)
Posts: 1218
Joined: 11-October 01
From: LA
Member No.: 267



QUOTE (paultaylor @ Oct 26 2007, 14:43) *
QUOTE (paultaylor @ Oct 12 2007, 16:13) *

2. How do you calculate number of channels/Stereo ?

In the spirit of information sharing did this with by searching for
MOOV.TRAK.MDIA.MINF.STBL.STSD.MP4A
and finding it within the MP4A atom (bytes 16,17)

You should not expect that that value always has valid information (it's even defined differently between different subparts of the mpeg-4 standard). To have a better idea you should decode the audio specific config.
Go to the top of the page
+Quote Post
paultaylor
post Oct 26 2007, 15:09
Post #4





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



QUOTE (menno @ Oct 26 2007, 13:58) *
You should not expect that that value always has valid information (it's even defined differently between different subparts of the mpeg-4 standard). To have a better idea you should decode the audio specific config.

Im only dealing the with the case of a file containing a single audio track (AAC encoded), in that case doesnt it always have this MP4A atom, which atom is the audio specific config ?
Go to the top of the page
+Quote Post
menno
post Oct 26 2007, 16:25
Post #5


Nero MPEG4 developer


Group: Developer (Donating)
Posts: 1218
Joined: 11-October 01
From: LA
Member No.: 267



QUOTE (paultaylor @ Oct 26 2007, 16:09) *
QUOTE (menno @ Oct 26 2007, 13:58) *

You should not expect that that value always has valid information (it's even defined differently between different subparts of the mpeg-4 standard). To have a better idea you should decode the audio specific config.

Im only dealing the with the case of a file containing a single audio track (AAC encoded), in that case doesnt it always have this MP4A atom, which atom is the audio specific config ?


Yes, when there's an AAC track there should be a mp4a atom, but I mean that the "channels" value is not always the actual amount of channels (usually just 2 gets written there). The audioSpecificConfig is somewhere in the ESDS part.
Go to the top of the page
+Quote Post
paultaylor
post Oct 26 2007, 20:56
Post #6





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



QUOTE (menno @ Oct 26 2007, 16:25) *
Yes, when there's an AAC track there should be a mp4a atom, but I mean that the "channels" value is not always the actual amount of channels (usually just 2 gets written there). The audioSpecificConfig is somewhere in the ESDS part.

Your'e right, I have just found a file file shown as Mono in iTunes but recording 2 in the channels value. havent managed to work out the ESDS part yet.
Go to the top of the page
+Quote Post
paultaylor
post Oct 29 2007, 15:16
Post #7





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



Ok thanks, fixed found no of channels in section 5 of esds atom (Also got bit rate from section 4 of esds atom)
Go to the top of the page
+Quote Post
paultaylor
post Nov 1 2007, 14:17
Post #8





Group: Members
Posts: 109
Joined: 27-January 05
Member No.: 19366



Ive resolved the problems above, and posted a release at:
here
try out at your leisure.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th July 2014 - 20:29