[FFmpeg-user] Convert and AAC to M4a file using bitstream flag aac_adtstoasc

Mohammed Sha mohammed.sha at vvdntech.in
Thu Jul 12 14:07:04 EEST 2018


Hi Mortiz,

How do you know it's not converted or filtered? Wouldn't it be nice if you
showed us the error message (if you get one)? Or should we guess?
     I have checked the converted audio file info using Mediainfo binary.

Actually, please show us the complete console output
   Fmmpeg console output is provided below and the Mediainfo output.

console $ ./ffmpeg -i ~/Downloads/test_audio.aac -c:a copy  -bsf:a
aac_adtstoasc aac_try_with_bsf.aac
ffmpeg version 4.0.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --pkg-config-flags=--static --enable-gpl --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libx265 --enable-nonfree --enable-openssl
--enable-bsf=aac_adtstoasc
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[aac @ 0x3d0c880] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from '/home/vkchlt0199/Downloads/test_audio.aac':
  Duration: 00:08:47.25, bitrate: 81 kb/s
    Stream #0:0: Audio: aac (LC), 16000 Hz, mono, fltp, 81 kb/s
File 'aac_try_with_bsf.aac' already exists. Overwrite ? [y/N] y
Output #0, adts, to 'aac_try_with_bsf.aac':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Audio: aac (LC), 16000 Hz, mono, fltp, 81 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help


size=    5245kB time=00:09:03.16 bitrate=  79.1kbits/s speed=8.46e+03x
video:0kB audio:5187kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.118535%

console $ mediainfo ~/Downloads/test_audio.aac
General
Complete name                            :
/home/vkchlt0199/Downloads/test_audio.aac
Format                                   : ADTS
Format/Info                              : Audio Data Transport Stream
File size                                : 5.12 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format version                           : Version 4
Format profile                           : LC
Bit rate mode                            : Variable
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 16.0 KHz
Frame rate                               : 15.625 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 5.12 MiB (100%)

Console $ mediainfo aac_try_with_bsf.aac
General
Complete name                            : aac_try_with_bsf.aac
Format                                   : ADTS
Format/Info                              : Audio Data Transport Stream
File size                                : 5.12 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format version                           : Version 4
Format profile                           : LC
Bit rate mode                            : Variable
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 16.0 KHz
Frame rate                               : 15.625 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 5.12 MiB (100%)

I am able to convert the aac audio file to m4a using below command, But for
my actual use case the this  wont help.

Console $$ ./ffmpeg -i ~/Downloads/test_audio.aac -c:a copy
aac_try_with_bsf.m4a
ffmpeg version 4.0.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --pkg-config-flags=--static --enable-gpl --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libx265 --enable-nonfree --enable-openssl
--enable-bsf=aac_adtstoasc
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[aac @ 0x3ed47c0] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from '/home/vkchlt0199/Downloads/test_audio.aac':
  Duration: 00:08:47.25, bitrate: 81 kb/s
    Stream #0:0: Audio: aac (LC), 16000 Hz, mono, fltp, 81 kb/s
File 'aac_try_with_bsf.m4a' already exists. Overwrite ? [y/N] y
Output #0, ipod, to 'aac_try_with_bsf.m4a':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp,
81 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help

size=    5221kB time=00:09:03.16 bitrate=  78.7kbits/s speed=8.69e+03x
video:0kB audio:5245kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown


This is the expected output
#########################
Console $ mediainfo aac_try_with_bsf.m4a
General
Complete name                            : aac_try_with_bsf.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (isom/iso2)
File size                                : 5.10 MiB
Duration                                 : 9mn 3s
Overall bit rate mode                    : Variable
Overall bit rate                         : 78.7 Kbps
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Writing application                      : Lavf58.12.100

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 9mn 3s
Bit rate mode                            : Variable
Bit rate                                 : 78.2 Kbps
Maximum bit rate                         : 81.5 Kbps
Channel(s)                               : 2 channels
Channel(s)_Original                      : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 16.0 KHz
Frame rate                               : 15.625 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 5.07 MiB (99%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00



On Thu, Jul 12, 2018 at 3:59 PM, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Thu, Jul 12, 2018 at 12:43:01 +0530, Mohammed Sha wrote:
> > But when i try below command the file is not getting converted or adding
> > the bitstream filter
> >
> > ./ffmpeg -i ~/Downloads/test_audio.aac -c:a copy  -bsf:a aac_adtstoasc
> > aac_try_with_bsf.aac
>
> How do you know it's not converted or filtered?
>
> Wouldn't it be nice if you showed us the error message (if you get
> one)? Or should we guess?
>
> Actually, please show us the complete console output.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>



-- 
Thanks & Regards
*Mohammed Sha Ebrahim*
VVDN Technologies Pvt.Ltd


More information about the ffmpeg-user mailing list