CannotReadException with m4a file

Issue #198 resolved
Former user created an issue

I'm receiving a CannotReadException with the attached m4a file. The exception message says the file is either corrupted or an mp4.

I'm however able to edit it with any other tag editor. I'm using JAudioTagger 2.2.6.

Comments (25)

  1. IJabz repo owner

    stack trace when read is

    org.jaudiotagger.audio.exceptions.CannotReadException: This file does not appear to be an Mp4 Audio file, could be corrupted or video 
        at org.jaudiotagger.audio.mp4.Mp4InfoReader.read(Mp4InfoReader.java:199)
        at org.jaudiotagger.audio.mp4.Mp4FileReader.getEncodingInfo(Mp4FileReader.java:41)
        at org.jaudiotagger.audio.generic.AudioFileReader.read(AudioFileReader.java:109)
        at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:359)
        at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:196)
    
  2. IJabz repo owner

    Atomic Parsley reports:

    C:\Apps\AtomicParsley-win32-0.9.0\AtomicParsley-win32-0.9.0>atomicparsley  test.m4a -T
    AtomicParsley error: unsupported MPEG-4 file brand found 'dash'
    

    so it seems the file is non-standard at tleast

  3. Kanedias

    I second this. All files downloaded from Youtube (e.g. via youtube-dl or NewPipe) possess this error.

  4. IJabz repo owner

    Are they actually video files (i.e Youtube) or just audio, because if they are video jaudioatgger should fail to read them

  5. fillobotto

    @Antic1tizen is correct, in fact replacing this line with:

    mvhdBuffer.position(pos);
    

    is now successfully reading the file. I don't know whether it is safe or not to do so. Writing it, throws an exception about discrepancy, because it's badly calculating the length difference of audio data I suppose...

  6. Xerus

    I just now read tags from an m4a file downloaded from Youtube and had no issues. Has this been resolved?

  7. Xerus

    Okay, the error appears with that one. Apparently I've edited my file once with mp3tag and that fixed it.

  8. fillobotto

    @ijabz it applies to all mpeg dash files. As I said above, changing one line of code will make the read succeed

  9. IJabz repo owner

    okay, great )but what exactly is an mpeg dash file) but we need a fix that will work for these but not break other mp4s

  10. Kanedias

    @IJabz We have tests for that, right?

    @fillobotto Did you test tag saving back to the file? Does it rewrite dash-mp4 header?

  11. fillobotto

    @Antic1tizen I didn't really check the structure after having the file edited.

    When I tried to change the library, the writing process failed because of a discrepancy test. Commented it out, the thing apparently worked fine for every kind of mp4s.

  12. fillobotto

    @Antic1tizen read yes, write no. I gives error in a discrepancy test. It must be fixed or at least commented out.

  13. fillobotto

    @ijabz I just remembered that I tested it using a pretty old commit so it was likely to be fixed.

  14. Binoy Babu

    @ijabz I'm still getting error while writing to mp4 dash files. Using Android and jaudiotagger 2.2.3:

    org.jaudiotagger.audio.exceptions.CannotReadException: This file does not appear to be an Mp4 Audio file, could be corrupted or video 
         at org.jaudiotagger.audio.mp4.Mp4InfoReader.read(Mp4InfoReader.java:195)
         at org.jaudiotagger.audio.mp4.Mp4FileReader.getEncodingInfo(Mp4FileReader.java:41)
         at org.jaudiotagger.audio.generic.AudioFileReader.read(AudioFileReader.java:104)
         at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:288)
         at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:151)
    
  15. Log in to comment