Extracting AAC LC audio from mp4 using ffmpeg

0

Here is the info of the file that I am working with

General
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : iso5 (iso5/dsms/msix/dash)
File size                                : 266 KiB
Duration                                 : 32 s 485 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 67.1 kb/s
Writing application                      : Lavf57.71.100

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 32 s 485 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 254 KiB (95%)
Default                                  : Yes
Alternate group                          : 1
Tagged date                              : UTC 2019-11-26 18:55:23

You may download the file here:

https://mega.nz/#!59phHYJA!XG6jwlMOUeTjAt55RSrfDhofAyl1E4O2nxXwXKzr5Cs

I have tried the following methods of extracting, but the audio is cut down from 32 seconds down to 4 seconds

ffmpeg -i input_video.mp4 -c copy -map 0:a:0 output_audio.aac
ffmpeg -i input_video.mp4 -vn -acodec aac output_audio.aac

Is this even possible to make this right with ffmpeg, would you recommend any alternatives.

Aivan Monceller

Posted 2019-11-30T07:58:50.893

Reputation: 403

Answers

1

The file is in fragmented mode. And ffmpeg is skipping many fragments, likely due to some parsing bug. You may open a ticket at http://trac.ffmpeg.org

A workaround is to use mp4box (part of GPAC).

This extracts track 1.

mp4box -raw 1:output=raw.aac audio.mp4

Gyan

Posted 2019-11-30T07:58:50.893

Reputation: 21 016