xmpDM:duration - units?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

xmpDM:duration - units?

Nick Burch-3
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
Reply | Threaded
Open this post in threaded view
|

Re: xmpDM:duration - units?

Tim Allison
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 <[hidden email]> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: xmpDM:duration - units?

Nick Burch-3
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 <[hidden email]> 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
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: xmpDM:duration - units?

Nick Burch-3
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