Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1436 closed defect (worksforme)

transcoding .aac to mp4

Reported by: Silly Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: aac mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When transcoding .aac audio files to .mp4 (regardless of output audio codec) files, audio is broken (different effect depending on player).

How to reproduce:
I have used Blue Öyster Cult - Don't Fear the Reaper song in stereo 16 bit pcm 44,100Hz .wav file as my source, from which I produced a .aac (-strict experimental -acodec aac) and .mp3 (-acodec libmp3lame).
I then transcoded both into .mp4 in different variations (without parameters to conserve audio or with the parameters above to change audio stream).
The results were consistent, using aac as source broke my mp4 audio regardless of output audio codec.
Using mp3 source went fine regardless of output audio codec.

My ffmpeg was built according to: https://ffmpeg.org/trac/ffmpeg/wiki/CentosCompilationGuide

ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Hyper fast Audio and Video encoder

Red Hat Enterprise Linux Server release 5.8 (Tikanga)
2.6.18-194.el5xen

Attachments (1)

test.aac (269.9 KB) - added by Silly 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by cehoyos

Please provide the command line you used together with complete, uncut console output.

comment:2 Changed 4 years ago by Silly

.wav to .aac:

$ ffmpeg -i the_reaper_stereo_44.1k.wav -strict experimental -acodec aac -y the_reaper_stereo_44.1k.aac
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[wav @ 0x14786100] max_analyze_duration 5000000 reached at 5015510
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from 'the_reaper_stereo_44.1k.wav':
  Metadata:
    title           : (Don't Fear) The Reaper
    artist          : Blue Öyster Cult
    date            : 1983
  Duration: 00:05:09.76, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[aformat @ 0x1480f760] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x1483a3a0] chl:stereo fmt:s16 r:44100Hz -> chl:stereo fmt:flt r:44100Hz
Output #0, adts, to 'the_reaper_stereo_44.1k.aac':
  Metadata:
    title           : (Don't Fear) The Reaper
    artist          : Blue Öyster Cult
    date            : 1983
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac, 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> aac)
Press [q] to stop, [?] for help
size=    4973kB time=00:05:09.77 bitrate= 131.5kbits/s    
video:0kB audio:4882kB global headers:0kB muxing overhead 1.868102%

.aac to .mp4

ffmpeg -i the_reaper_stereo_44.1k.aac -y the_reaper_stereo_44.1k.mp4
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[aac @ 0x11034100] max_analyze_duration 5000000 reached at 5015510
[aac @ 0x11034100] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'the_reaper_stereo_44.1k.aac':
  Duration: 00:05:31.22, bitrate: 122 kb/s
    Stream #0:0: Audio: aac, 44100 Hz, stereo, s16, 122 kb/s
Output #0, mp4, to 'the_reaper_stereo_44.1k.mp4':
  Metadata:
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> libvo_aacenc)
Press [q] to stop, [?] for help
size=    4966kB time=00:08:41.16 bitrate=  78.1kbits/s    
video:0kB audio:4841kB global headers:0kB muxing overhead 2.573264%

comment:3 Changed 4 years ago by Silly

This has succeeded producing a playable .mp4

.wav to .mp4

$ ffmpeg -i the_reaper_stereo_44.1k.wav -strict experimental -acodec aac -y the_reaper_stereo_44.1k.mp4
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[wav @ 0x855d100] max_analyze_duration 5000000 reached at 5015510
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from 'the_reaper_stereo_44.1k.wav':
  Metadata:
    title           : (Don't Fear) The Reaper
    artist          : Blue Öyster Cult
    date            : 1983
  Duration: 00:05:09.76, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[aformat @ 0x858e660] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x8560680] chl:stereo fmt:s16 r:44100Hz -> chl:stereo fmt:flt r:44100Hz
Output #0, mp4, to 'the_reaper_stereo_44.1k.mp4':
  Metadata:
    title           : (Don't Fear) The Reaper
    artist          : Blue Öyster Cult
    date            : 1983
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> aac)
Press [q] to stop, [?] for help
size=    4935kB time=00:05:09.77 bitrate= 130.5kbits/s    
video:0kB audio:4882kB global headers:0kB muxing overhead 1.086087%

.aac to .mp3 to .mp4

$ ffmpeg -i the_reaper_stereo_44.1k.aac -strict experimental -acodec libmp3lame -y the_reaper_stereo_44.1k_aac.mp3
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[aac @ 0x13dac100] max_analyze_duration 5000000 reached at 5015510
[aac @ 0x13dac100] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'the_reaper_stereo_44.1k.aac':
  Duration: 00:05:31.22, bitrate: 122 kb/s
    Stream #0:0: Audio: aac, 44100 Hz, stereo, s16, 122 kb/s
Output #0, mp3, to 'the_reaper_stereo_44.1k_aac.mp3':
  Metadata:
    TSSE            : Lavf54.6.101
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> libmp3lame)
Press [q] to stop, [?] for help
size=    4841kB time=00:08:41.16 bitrate=  76.1kbits/s    
video:0kB audio:4841kB global headers:0kB muxing overhead 0.003833%

$ ffmpeg -i the_reaper_stereo_44.1k_aac.mp3 -y the_reaper_stereo_44.1k_aac_mp3.mp4
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mp3 @ 0xa6c2100] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from 'the_reaper_stereo_44.1k_aac.mp3':
  Metadata:
    encoder         : Lavf54.6.101
  Duration: 00:05:09.83, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Output #0, mp4, to 'the_reaper_stereo_44.1k_aac_mp3.mp4':
  Metadata:
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 -> libvo_aacenc)
Press [q] to stop, [?] for help
size=    4895kB time=00:05:09.85 bitrate= 129.4kbits/s    
video:0kB audio:4842kB global headers:0kB muxing overhead 1.093016%

$ ffmpeg -i the_reaper_stereo_44.1k_aac.mp3 -strict experimental -acodec aac  the_reaper_stereo_44.1k_mp3.mp4
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mp3 @ 0xfc2c100] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from 'the_reaper_stereo_44.1k_aac.mp3':
  Metadata:
    encoder         : Lavf54.6.101
  Duration: 00:05:09.83, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
[aformat @ 0xfc5cf60] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0xfc53e80] chl:stereo fmt:s16 r:44100Hz -> chl:stereo fmt:flt r:44100Hz
Output #0, mp4, to 'the_reaper_stereo_44.1k_mp3.mp4':
  Metadata:
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 -> aac)
Press [q] to stop, [?] for help
size=    4816kB time=00:05:09.84 bitrate= 127.3kbits/s    
video:0kB audio:4763kB global headers:0kB muxing overhead 1.111131%

comment:4 Changed 4 years ago by cehoyos

Does the following work?
$ ffmpeg -i the_reaper_stereo_44.1k.aac -y -acodec aac -strict experimental the_reaper_stereo_44.1k.mp4

comment:5 Changed 4 years ago by Silly

Sorry but no:

$ ffmpeg -i the_reaper_stereo_44.1k.aac -strict experimental -acodec aac -y the_reaper_stereo_44.1k_aac.mp4
ffmpeg version N-41113-ge7cb161 Copyright (c) 2000-2012 the FFmpeg developers
  built on May 29 2012 19:26:04 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3
  libavutil      51. 55.100 / 51. 55.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[aac @ 0xe6fa100] max_analyze_duration 5000000 reached at 5015510
[aac @ 0xe6fa100] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'the_reaper_stereo_44.1k.aac':
  Duration: 00:05:31.22, bitrate: 122 kb/s
    Stream #0:0: Audio: aac, 44100 Hz, stereo, s16, 122 kb/s
[aformat @ 0xe727c80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0xe718fa0] chl:stereo fmt:s16 r:44100Hz -> chl:stereo fmt:flt r:44100Hz
Output #0, mp4, to 'the_reaper_stereo_44.1k_aac.mp4':
  Metadata:
    encoder         : Lavf54.6.101
    Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> aac)
Press [q] to stop, [?] for help
size=    5096kB time=00:08:41.15 bitrate=  80.1kbits/s    
video:0kB audio:4972kB global headers:0kB muxing overhead 2.505627%

comment:6 Changed 4 years ago by cehoyos

Since it works fine here with a random sample, please provide the_reaper_stereo_44.1k.aac

Changed 4 years ago by Silly

comment:7 Changed 4 years ago by Silly

Not wanting to get any of us into copyright trouble, I have added another aac file which produced the exact same results.

comment:8 Changed 4 years ago by cehoyos

Am I correct that the resulting file plays fine with ffplay and MPlayer?
Which players fail?

comment:9 Changed 4 years ago by Silly

The players I use on regular basis are Totem and VLC

comment:10 Changed 4 years ago by Silly

Installed and tested with Mplayer and it plays perfectly well, unlike with Totem and VLC

comment:11 Changed 4 years ago by cehoyos

  • Resolution set to worksforme
  • Status changed from new to closed

Since the resulting files also plays fine with QuickTime?, I am closing this ticket.

Please reopen the ticket if you receive any indication that there actually is a bug in FFmpeg (and not in Totem / GStreamer).

comment:12 Changed 4 years ago by cehoyos

  • Keywords mov added; mp4 removed
Note: See TracTickets for help on using tickets.