You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by Nick Burch <ni...@apache.org> on 2020/11/18 20:26:32 UTC

xmpDM:duration - units?

Hi All

This question promoted by https://stackoverflow.com/q/64888488/685641

Is there / should there be fixed units on the xmpDM:duration metadata 
property? And if so, what?

Currently, MP3 seems to use milliseconds via 
http://tika.apache.org/1.24.1/api/org/apache/tika/parser/mp3/AudioFrame.html#getDuration--
but Ogg Vorbis uses seconds, as does M4A

Thoughts?

Nick

Re: xmpDM:duration - units?

Posted by Nick Burch <ni...@apache.org>.
On Thu, 19 Nov 2020, Nick Burch wrote:
> On Thu, 19 Nov 2020, Tim Allison wrote:
>> Looks like 'scale' needs to be taken into consideration? See 1.2.6.9
>> 
>> https://www.adobe.com/content/dam/acom/en/devnet/xmp/pdfs/XMPSDKReleasecc-2020/XMPSpecificationPart2.pdf
>
> Ah, yes, check the spec!
>
> 1.2.6.5 suggests that xmpDM:duration can be frames or can be in seconds, when 
> used for a marker. 1.2.6.6 seems to say the overall media xmpDM:duration 
> should be a time with a default unit in seconds (unless changed by a scale)
>
> I guess we could set a scale for mp3 and leave the duration in ms, but 
> swapping it to seconds seems cleaner/better to me, even though it's a 
> breaking change.

I'm thinking I'll fix this on both 1.x and 2 in a few days. 2.x feels a 
no-brainer, 1.x is a breaking change but arguably has been a long-standing 
bug that no-one has flagged until now.

Any objections, before I raise a JIRA and commit the fixes?

Thanks
Nick

Re: xmpDM:duration - units?

Posted by Nick Burch <ni...@apache.org>.
On Thu, 19 Nov 2020, Tim Allison wrote:
> Looks like 'scale' needs to be taken into consideration? See 1.2.6.9
>
> https://www.adobe.com/content/dam/acom/en/devnet/xmp/pdfs/XMPSDKReleasecc-2020/XMPSpecificationPart2.pdf

Ah, yes, check the spec!

1.2.6.5 suggests that xmpDM:duration can be frames or can be in seconds, 
when used for a marker. 1.2.6.6 seems to say the overall media 
xmpDM:duration should be a time with a default unit in seconds (unless 
changed by a scale)

I guess we could set a scale for mp3 and leave the duration in ms, but 
swapping it to seconds seems cleaner/better to me, even though it's a 
breaking change.

Thoughts?

Nick

> On Wed, Nov 18, 2020 at 3:26 PM Nick Burch <ni...@apache.org> wrote:
>> Hi All
>>
>> This question promoted by https://stackoverflow.com/q/64888488/685641
>>
>> Is there / should there be fixed units on the xmpDM:duration metadata
>> property? And if so, what?
>>
>> Currently, MP3 seems to use milliseconds via
>>
>> http://tika.apache.org/1.24.1/api/org/apache/tika/parser/mp3/AudioFrame.html#getDuration--
>> but Ogg Vorbis uses seconds, as does M4A
>>
>> Thoughts?
>>
>> Nick
>>
>

Re: xmpDM:duration - units?

Posted by Tim Allison <ta...@apache.org>.
Looks like 'scale' needs to be taken into consideration? See 1.2.6.9

https://www.adobe.com/content/dam/acom/en/devnet/xmp/pdfs/XMPSDKReleasecc-2020/XMPSpecificationPart2.pdf

On Wed, Nov 18, 2020 at 3:26 PM Nick Burch <ni...@apache.org> wrote:

> Hi All
>
> This question promoted by https://stackoverflow.com/q/64888488/685641
>
> Is there / should there be fixed units on the xmpDM:duration metadata
> property? And if so, what?
>
> Currently, MP3 seems to use milliseconds via
>
> http://tika.apache.org/1.24.1/api/org/apache/tika/parser/mp3/AudioFrame.html#getDuration--
> but Ogg Vorbis uses seconds, as does M4A
>
> Thoughts?
>
> Nick
>