I cannot play "mp4" and "m4a" files

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

I cannot play "mp4" and "m4a" files

Postby Emanuel Martins » Tue Mar 29, 2022 3:32 pm

I am using a code altered by me from example pipeline_sdcard_mp3_control (https://github.com/espressif/esp-adf/tr ... p3_control) and from example cli (https://github.com/espressif/esp-adf/tr ... amples/cli) with changes to work with USB (form example msc).

I made a "player" that can read/play mp3, wav, aac/m4a/mp4 files.
for "mp3", "wav" and "aac" files it works.
For mp4 and m4a files gives an error:

...
... file://usb/gs-16b-2c-44100hz.mp4
...
E (3353) M4A_PARSER: Get no data (line 1112)
E (3353) M4A_PARSER: read error, read bytes(-9) less than wanted read size (8), line 20
E (3363) M4A_PARSER: read error, read bytes(-9) less than wanted size (8), line 136
E (3373) M4A_PARSER: currently not support mvdt ahead of moov case,0
E (3373) AAC_DECODER: error mp4 stream, release
E (3383) AUDIO_ELEMENT: [aac] AEL_STATUS_ERROR_OPEN,-1
W (3383) AUDIO_ELEMENT: [aac] audio_element_on_cmd_error,7
W (3393) AUDIO_ELEMENT: IN-[filter] AEL_IO_ABORT
...

The file is one of the examples of Espressif in in "https://docs.espressif.com/projects/esp ... rt-samples".
Does this means that the AAC decoder cannot read the example gs-16b-2c-44100hz.mp4?
If AAC decoder cannot read this example, where is the decoder that can read this example music file?

Also: I cannot download example "https://dl.espressif.com/dl/audio/gs-16b-2c-44100hz.m4a" (????) so I went to a site with m4a examples, https://filesamples.com/formats/m4a, and all of them give error:

...
... file://usb/sample2.m4a
...
E (13393) M4A_PARSER: Get no data (line 1112)
E (13393) M4A_PARSER: read error, read bytes(-9) less than wanted read size (8), line 20
E (13393) M4A_PARSER: read error, read bytes(-9) less than wanted size (8), line 136
E (13413) M4A_PARSER: currently not support mvdt ahead of moov case,0
E (13413) AAC_DECODER: error mp4 stream, release
E (13413) AUDIO_ELEMENT: [aac] AEL_STATUS_ERROR_OPEN,-1
W (13423) AUDIO_ELEMENT: [aac] audio_element_on_cmd_error,7
W (13433) AUDIO_ELEMENT: IN-[filter] AEL_IO_ABORT

Does this means that the AAC decoder cannot read the examples in https://filesamples.com/formats/m4a?

Any help would be appreciated.

rpiloverbd
Posts: 101
Joined: Tue Mar 22, 2022 5:23 am

Re: I cannot play "mp4" and "m4a" files

Postby rpiloverbd » Thu Mar 31, 2022 1:59 pm

Hello, without any altering, if you upload exactly the example code, what do you see? Can you read mp4 and m4a files?

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: I cannot play "mp4" and "m4a" files

Postby Emanuel Martins » Fri Apr 08, 2022 2:29 pm

My code has several differences from the example "pipeline_sdcard_mp3_control":
- It reads USB pens instead of SD cards
- It reads mp3, aac and wav files, instead of only mp3 files
- It used a I2S DAC instead of a codec IC

The behavior is similar if I apply a mp3 decoder in a wav file. Error is similar.
So I admitted that the pipeline examples cannot read mp4 and m4a files.

I think the most similar example is the https://github.com/espressif/esp-adf/tr ... card_music but I cannot use it without making modifications.

jason.mao
Posts: 98
Joined: Mon Nov 19, 2018 2:05 am

Re: I cannot play "mp4" and "m4a" files

Postby jason.mao » Fri Apr 15, 2022 7:26 am

Hi Emanuel Martins,
M4A_PARSER: currently not support mvdt ahead of moov case,0
Here is error message, the decoder does not support AAC or MP4 M4A file include mvdt ahead of moov currently.

Please test with https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.m4a file. https://dl.espressif.com/dl/audio/gs-16b-2c-44100hz.m4a is not available, let us fix it.

Who is online

Users browsing this forum: No registered users and 24 guests