Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#4546 closed defect (fixed)

-acodec copy doesn't work with AAC VBR

Reported by: ericzutter Owned by:
Priority: minor Component: avformat
Version: git-master Keywords: AAC mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When using "-acodec copy" to extract AAC VBR codec from video, the extracted codec becomes AAC CBR. I use MediaInfo CLI to check if AAC codec is CBR or VBR.

How to reproduce:

  1. test.mp4 contains an AAC VBR audio codec
  2. MediaInfo.exe test.mp4 => says "Audio Bitrate mode=variable"
  3. ffmpeg.exe -i test.mp4 -vn -acodec copy test.m4a
  4. MediaInfo.exe test.m4a => says "Audio Bitrate mode=constant"

Expected result:

Normally when using '-acodec copy', the "Bitrate mode" on the output should be the same as the input.

My configuration :

I am using ffmpeg.exe 64 bits with Windows 7-64 bits

ffmpeg version N-71899-g6ef3426 Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 37.100 / 56. 37.100
libavformat 56. 31.102 / 56. 31.102
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

Attachments (2)

test.mp4 (1.5 MB ) - added by ericzutter 9 years ago.
test.m4a (188.4 KB ) - added by ericzutter 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Carl Eugen Hoyos, 9 years ago

Component: ffmpegundetermined
Keywords: VBR copy removed
Priority: importantnormal
Resolution: needs_more_info
Status: newclosed

Please reopen if you can provide your FFmpeg command line including the complete, uncut console output but please understand that -acodec copy does not (and can not) change the AAC bitstream.

comment:2 by ericzutter, 9 years ago

Resolution: needs_more_info
Status: closedreopened

Inputfile test.mp4 has metadata AAC audio bitrate mode=variable.

Ouputfile test.m4a (created using "-acodec copy") has metadata AAC audio bitrate mode=constant.

So test.m4a contains the following:
Metadata : audio bitrate mode=constant
Audio bitstream : audio bitrate mode=variable

When you play test.m4a with an audio player, will the audio player play the audio bitstream as a Constant Bitrate Mode or as a Variable Bitrate Mode ?

Does an audio player use the audio bitrate mode info from the metadata to play an audio file ?

How can I view the correct audio bitrate mode from an audio bitstream when the audio bitrate mode info in the metadata is not correct ?

See here the uncut console output :

ffmpeg.exe -i test.mp4 -vn -acodec copy test.m4a

ffmpeg version N-71899-g6ef3426 Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 37.100 / 56. 37.100
libavformat 56. 31.102 / 56. 31.102
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':

Metadata:

major_brand : mp42
minor_version : 0
compatible_brands: isomavc1mp42
creation_time : 2009-05-28 15:09:33

Duration: 00:02:51.47, start: 0.000000, bitrate: 2127 kb/s

Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:

creation_time : 2009-05-28 15:09:33
handler_name : (C) 2007 Google Inc. v08.13.2007.

Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1999 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:

creation_time : 2009-05-28 15:09:33
handler_name : (C) 2007 Google Inc. v08.13.2007.

[ipod @ 0000000002dbcbe0] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, ipod, to 'test.m4a':

Metadata:

major_brand : mp42
minor_version : 0
compatible_brands: isomavc1mp42
encoder : Lavf56.31.102
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 125 kb/s (default)
Metadata:

creation_time : 2009-05-28 15:09:33
handler_name : (C) 2007 Google Inc. v08.13.2007.

Stream mapping:

Stream #0:0 -> #0:0 (copy)

Press [q] to stop, ? for help
size= 2651kB time=00:02:51.45 bitrate= 126.7kbits/s
video:0kB audio:2621kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.128996%

comment:3 by Carl Eugen Hoyos, 9 years ago

Please provide your input sample.

comment:4 by Carl Eugen Hoyos, 9 years ago

Priority: normalminor
Version: unspecifiedgit-master

by ericzutter, 9 years ago

Attachment: test.mp4 added

by ericzutter, 9 years ago

Attachment: test.m4a added

comment:5 by ericzutter, 9 years ago

I added as attachement the inputfile "test.mp4" and the outputfile "test.m4a".

comment:6 by Ganesh Ajjanagadde, 9 years ago

Resolution: fixed
Status: reopenedclosed

comment:7 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavformat
Keywords: mov added
Note: See TracTickets for help on using tickets.