[ 
https://issues.apache.org/jira/browse/TIKA-4777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095287#comment-18095287
 ] 

ASF GitHub Bot commented on TIKA-4777:
--------------------------------------

dschmidt commented on PR #2936:
URL: https://github.com/apache/tika/pull/2936#issuecomment-4935396937

   Thanks, that is remarkably thorough feedback, and almost all of it was right.
   Addressed in 315e01a30:
   
   1. **Plumbing**: reworked as suggested. The hdlr branch now returns a
      `TikaMp4MetaHandler extends Mp4MetaHandler` that fills in the empty
      `processSampleDescription`/`processTimeToSample` overrides. The global
      minf/stbl/stsd acceptance and the movie-timescale duplication are gone,
      `Mp4MetaDirectory` stays alive; only edts/elst remain in
      `TikaMp4BoxHandler`.
   2. **Edit list**: both bugs fixed: only leading empty edits count, summed,
      and the scan stops at the first normal entry. Overflow guard added, and
      the per-track state resets on the trak container instead of tkhd.
   3. **Sample count**: stts is now read and only single-sample tracks are
      reported, which is the actual invariant behind "track start = still
      moment" (previously the delay filter only correlated with it).
   4. **Tests**: the fixture gained realistic track plumbing (gmhd, dhlr/alis
      data handler, dinf/dref, full sample tables) plus tracks covering a
      version-1 elst, a non-leading empty edit directly after the delayed
      track (state-leak probe), and a delayed multi-sample track. set() is now
      add(), and the comment/placement nits are fixed. I re-verified against a
      real iPhone 15 Pro Live Photo: output unchanged.
   
   Two shape questions I deliberately did not touch and would like your call
   on before merge:
   - **Namespace**: keep `<apple key>.track-start-us`, or move to a Tika-owned
     scheme? I agree it is hard to rename later, so happy to change it now.
   - **Absence vs 0**: with the single-sample invariant in place, emitting 0
     for an undelayed single-sample track would make "still is the first
     frame" distinguishable from "not a Live Photo" without adding noise on
     multi-sample keys. Which do you prefer?
   




> Extract QuickTime timed metadata (mebx) tracks
> ----------------------------------------------
>
>                 Key: TIKA-4777
>                 URL: https://issues.apache.org/jira/browse/TIKA-4777
>             Project: Tika
>          Issue Type: Improvement
>            Reporter: Dominik Schmidt
>            Priority: Major
>
> Apple Live Photo videos mark the moment the paired still image was
> captured in a timed metadata track: the sample description declares the
> format 'mebx' with a keys structure containing
> com.apple.quicktime.still-image-time. The item value itself is always -1;
> the actual time is the presentation time of that sample, derived from the
> track's sample tables.
> Everything needed lives in the moov box, no mdat access is required:
> - mdhd: track timescale
> - stsd: detect the mebx sample entry and its still-image-time key
> - stts and elst: an empty edit shifts the single one-tick sample to the
>   still moment
> Example from a real Live Photo video (iPhone 15 Pro, iOS 18.5): the
> still-image-time track has timescale 600, an edit list with an empty edit
> of 740 units followed by the sample, giving a still time of 1.2333 s.
> Neither the current MP4 handler (which reads the static keys/ilst
> metadata, TIKA-2861) nor the underlying metadata-extractor exposes timed
> metadata tracks; ExifTool only surfaces the constant -1 marker value.
> Note that the Apple maker note tag 0x0017 in the paired image
> (historically documented as "LivePhotoVideoIndex") does not encode a
> usable time on current iOS versions, so the video track is the only
> reliable source for this timestamp.
> Proposal: extend TikaMp4BoxHandler to accept the relevant trak child
> boxes, correlate mdhd/stsd/stts/elst per track, and emit the still time
> as metadata (e.g. com.apple.quicktime.still-image-time, in
> microseconds).
> Related: TIKA-2861 (QuickTime item-list metadata), TIKA-4776 (image-side
> Apple maker note, LONG8), TIKA-852.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to