Open jpllopes96 opened 5 years ago
Either the file is invalid or we have a bug. It's not possible to determine which without sample data. Can you provide a file that reproduces this problem?
This is the file, but any .mp4 happens the same error.
@payton is this something you'd have time to look into?
I'm from Brazil and the date format is: dd-mm-yyyy. Don't have some influence ? If yes, how can I resolve this issue? Thanks !
I'll give it my best to have a look this weekend!
Any new about this case ?
Here's the stacktrace:
java.io.EOFException: End of data reached.
at com.drew.lang.StreamReader.getByte(StreamReader.java:62)
at com.drew.lang.SequentialReader.getUInt32(SequentialReader.java:198)
at com.drew.metadata.mp4.boxes.Box.<init>(Box.java:40)
at com.drew.imaging.mp4.Mp4Reader.processBoxes(Mp4Reader.java:54)
at com.drew.imaging.mp4.Mp4Reader.extract(Mp4Reader.java:45)
at com.drew.imaging.mp4.Mp4MetadataReader.readMetadata(Mp4MetadataReader.java:57)
at com.drew.imaging.ImageMetadataReader.readMetadata(ImageMetadataReader.java:177)
at com.drew.imaging.ImageMetadataReader.readMetadata(ImageMetadataReader.java:124)
at com.drew.imaging.ImageMetadataReader.readMetadata(ImageMetadataReader.java:204)
at tester.main(tester.java:18)
And a little debug:
processBoxes() called with values: com.drew.lang.StreamReader@54bedef2, 4233, com.drew.metadata.mp4.media.Mp4SoundHandler@776ec8df, com.drew.metadata.mp4.Mp4Context@27716f4
Box initializer: bytes available = 2515645
Processing box stsd
Box initializer: bytes available = 2515554
Processing box stts
Box initializer: bytes available = 2515530
Processing box stsc
Box initializer: bytes available = 2515370
Processing box stsz
Box initializer: bytes available = 2513614
Processing box stco
Box initializer: bytes available = 2513510
Processing box mdat
Box initializer: bytes available = 0
So, in that last call, the processor is trying to initialize another box and get its size when there are no more bytes to be read... Potentially this means the file is malformed. I don't have enough info to say for certain, however.
@jpllopes96 can you explain why you closed this?
@drewnoakes, I believe they were referring to this bit https://github.com/drewnoakes/metadata-extractor/blob/master/Source/com/drew/imaging/mp4/Mp4Reader.java#L75
We end on an IOException
because MP4 files don't have any root atom/box, so the end is unknown. We could theoretically somehow inject the size from file inputs, but that doesn't cover streams.
Running on the sample file returns an expected output (with one error line from the directory error list):
[MP4] Major Brand = MP4 v2 [ISO 14496-14]
[MP4] Minor Version = 0
[MP4] Compatible Brands = [MP4 v2 [ISO 14496-14], MP4 Base Media v1 [IS0 14496-12:2003]]
[MP4] Creation Time = Thu Dec 31 19:00:00 EST 1903
[MP4] Modification Time = Thu Dec 31 19:00:00 EST 1903
[MP4] Duration = 444416
[MP4] Media Time Scale = 48000
[MP4] Duration in Seconds = 00:00:10
[MP4] Transformation Matrix = 65536 0 0 0 65536 0 0 0 1073741824
[MP4] Preferred Rate = 1
[MP4] Preferred Volume = 1
[MP4] Next Track ID = 3
[MP4] Rotation = -90
[MP4 Video] Creation Time = Thu Dec 31 19:00:00 -05:00 1903
[MP4 Video] Modification Time = Thu Dec 31 19:00:00 -05:00 1903
ERROR: End of data reached.
[MP4 Video] ISO 639-2 Language Code = und
[MP4 Video] Opcolor = 0 0 0
[MP4 Video] Graphics Mode = Copy
[MP4 Video] Compression Type = H.264
[MP4 Video] Width = 640 pixels
[MP4 Video] Height = 352 pixels
[MP4 Video] Depth = 24-bit color
[MP4 Video] Horizontal Resolution = 72
[MP4 Video] Vertical Resolution = 72
[MP4 Video] Frame Rate = 29.964
[MP4 Sound] Creation Time = Thu Dec 31 19:00:00 -05:00 1903
[MP4 Sound] Modification Time = Thu Dec 31 19:00:00 -05:00 1903
[MP4 Sound] ISO 639-2 Language Code = und
[MP4 Sound] Balance = 0
[MP4 Sound] Format = MPEG-4, Advanced Audio Coding (AAC)
[MP4 Sound] Number of Channels = 2
[MP4 Sound] Sample Size = 16
[MP4 Sound] Sample Rate = 48000
[File Type] Detected File Type Name = MP4
[File Type] Detected File Type Long Name = MPEG-4 Part 14
[File Type] Detected MIME Type = video/mp4
[File Type] Expected File Name Extension = mp4
[File] File Name = VideoMP4.mp4
[File] File Size = 2517743 bytes
[File] File Modified Date = Fri Mar 01 13:45:06 -05:00 2019
Thanks @payton. I'll re-open this as it still seems like a valid issue.
I made a code that I enter with a file and using the extractor metadata, I create a file with the extracted metadata, when I try to extract metadata from MP4 videos using Mp4MetadataReader the following error occurs: End of data reached. My code has the following lines to extract :
and the output file:
The log error: