ExifTool Forum

ExifTool => Newbies => Topic started by: regystro on April 30, 2019, 07:54:37 AM

Title: Excluding tags in tagsFromFile not working
Post by: regystro on April 30, 2019, 07:54:37 AM
Hi.

I'm trying to copy some tags from test.mov to test.mp4 which is just a conversion from test.mov using ffmpeg.

The mov has 4 tracks: Video, Audio and 2 extra (maybe geolocation... I dunno / don't care)
The mp4 also has 4 tracks (full streams copy)

exiftool -tagsFromFile test.mov -MediaCreateDate test.mp4
Error: Can't locate data reference to update offsets for Track3 - test.mp4


I know that must be some unsupported offset / tag in destination file, that's why I want to explicitly exclude it from tagsFromFile:

I want to avoid exiftool to copy all Track3 tags, but this doesn't work, even forcing the tag group:
exiftool -g1 -tagsFromFile test.mov -x Track3:* -Track1:MediaCreateDate>Track1:MediaCreateDate test.mp4
Error: Can't locate data reference to update offsets for Track3 - test.mp4


Shouldn't exiftool skip any references to track3 using that command-line?

Since this works for reading:
exiftool -a -s -g1 --Track3:* -MediaCreateDate test.mov
---- Track1 ----
MediaCreateDate                 : 2019:04:24 13:06:42
---- Track2 ----
MediaCreateDate                 : 2019:04:24 13:06:42
---- Track4 ----
MediaCreateDate                 : 2019:04:24 13:06:42


Been trying a lot of options, even -unsafe, etc... It's driving me nuts.

Please help!!!
Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on April 30, 2019, 09:24:35 AM
ExifTool only has limited write ability for MOV files.

But with an error like this:

Error: Can't locate data reference to update offsets for Track3

I don't think that ExifTool will write the file at all.

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: regystro on May 02, 2019, 08:48:27 AM
But I'm not trying to write to a mov file, but from mov to mp4 instead.

It works well if I previously remove Track3 from test.mp4 with ffmpeg, but I was wondering if ExifTool could bypass / exclude tags by family group, since it works for reading. I mean -g1 option is ignored when using -tagsFromFile I guess.

Thank you for your response.


Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on May 02, 2019, 09:42:59 AM
If there is an error in the track3 structure, then ExifTool will not write the file.  If you want to send it to me, I can take a look (philharvey66 at gmail.com)

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: regystro on May 06, 2019, 05:08:24 AM
I think I found where the problem is. This is ffprobe's output of the original mov, created with an iPad Air:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'original.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2019-04-24T13:13:19.000000Z
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPad Air
    com.apple.quicktime.software: 12.2
    com.apple.quicktime.creationdate: 2019-04-24T15:13:18+0200
  Duration: 00:00:44.24, start: 0.000000, bitrate: 17110 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17038 kb/s, 26.06 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2019-04-24T13:13:19.000000Z
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
      creation_time   : 2019-04-24T13:13:19.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-04-24T13:13:19.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-04-24T13:13:19.000000Z
      handler_name    : Core Media Data Handler
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 0 for input stream 3


Check 2 last lines.

exiftool "-MediaCreateDate=2019:01:01 00:00:00" "original.mov" works as expected without problems.

If I transcode it or even copy streams like this:
ffmpeg -i original.mov -map 0 -codec copy test.mov
... ffmpeg output says:
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
[mov @ 000001eab9858020] Unknown hldr_type for mebx, writing dummy values


and then, this fails:
exiftool "-MediaCreateDate=2019:01:01 00:00:00" "test.mov"
Error: Can't locate data reference to update offsets for Track3 - test.mov
    0 image files updated
    1 files weren't updated due to errors


If you want to have a look, here you are original2s.mov (https://mega.nz/#!FdtyjArA!tSBRgjPSX-6w78msmP-_T7k44XvTP6anOeGgdBUtW1U).  That's original.mov trimmed to 2 seconds (ffmpeg -i original.mov -t 2 -map 0 -codec copy original2s.mov). I don't know why ffmpeg makes it not suitable for exiftool. I have a lot of movs transcoded to mp4 this way... all with scrambled metadata due to ffmpeg I guess. That's why I hoped it would be great if we could skip some tags / tracks when using -tagsFromFile.
Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on May 06, 2019, 07:52:17 AM
Thanks for the sample.  I'll take a close look at this when I get a chance, but from the ffmpeg messages it does seem as if the metadata was messed up.  For fear of making things worse, Exiftool errs in the side of safety and won't rewrite a file if there are significant problems.  I'll take a look at this, but it does seem the safe thing to do in this case.

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on February 04, 2022, 01:32:28 PM
After all this time I have finally seen another file with this problem (see here (https://exiftool.org/forum/index.php?topic=13277.0)).

ExifTool 12.40 will include a patch to allow you to write videos like this.

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: DJDiva on April 01, 2022, 12:42:46 PM
I am having this issue (running 12.40) where I have an mp4 file I want to write the correct DateTimeOriginal.

When I run -s I see there is a minor error: "Warning                         : [minor] The ExtractEmbedded option may find more tags in the media data"

but it appears that this minor error causes the file not to be written at all.

for example if I write:
exiftool -DateTimeOriginal="2017:12:31 10:28:09" video.mp4
Error: No data reference for sample description 0 for Track2 -video.mp4
    0 image files updated
    1 files weren't updated due to errors

Even if I try to ignore minor errors it still won't write to any tags.

another that failed:
exifTool "-FileModifyDate>DateTimeOriginal" video.mp4
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - video.mp4
Error: No data reference for sample description 0 for Track2 - video.mp4
    0 image files updated
    1 files weren't updated due to errors

Am I doing something wrong? Is there a way to get this to work?
Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on April 01, 2022, 12:52:20 PM
The minor warning isn't an issue.

Try updating to ExifTool 12.41.  This should fix it.  There was a different handler type that could still cause this problem with version 12.40.

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: DJDiva on April 01, 2022, 01:08:23 PM
I'm not seeing a download for 12.41 only 12.40?
Title: Re: Excluding tags in tagsFromFile not working
Post by: Phil Harvey on April 01, 2022, 01:32:54 PM
Sorry.  Right.  That is the upcoming release.  I should have it out within a week or so.

- Phil
Title: Re: Excluding tags in tagsFromFile not working
Post by: DJDiva on April 01, 2022, 01:42:47 PM
ok thanks!