[Libav-user] AAC decode problems

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] AAC decode problems

Info || Non-Lethal Applications
Hi guys,

I just received a movie file with AAC audio which doesn't play correctly in my player using the ffmpeg libraries.
It sounded “robotic” and the audio ran out of sync rather quickly.

Ffprobe output:

ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/wetransfer-6ec47f/IQT Capture 170911 Unity Round1.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.66.102
  Duration: 00:07:58.81, start: 0.000000, bitrate: 2672 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 162 kb/s (default)
    Metadata:
      handler_name    : DataHandler

By examining the file I found out that the packet durations of the AAC stream were not 1024 as they are with all the other files I have but rather either 1000 or 1100.
While this by itself would not be a problem, it’s very confusing that the AAC decoder outputs AVFrames with a duration of 1024.

So now I’m a bit stuck as I really don’t know what to do.
If the packets were all 1000 I would try discarding the last 24 samples of each AVFrame but as the frame apparently only holds 1024 samples although the packet says it contains 1100 samples, I’m stuck.
I tried sending a NULL packet in the case of longer packets hoping to get the remains 76 samples out of the decoder but I got this error message:

[aac @ 0x10539da00] Got unexpected packet size after a partial decode

The file plays fine in both QuickTime and VLC so there must be a correct way of handling these kind of files..

I’d be very grateful for any insight anyone of you might have!

Thanks and best,

Flo

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: AAC decode problems

Anton Shekhovtsov


2017-09-14 14:06 GMT+03:00 Info || Non-Lethal Applications <[hidden email]>:
Hi guys,

I just received a movie file with AAC audio which doesn't play correctly in my player using the ffmpeg libraries.
It sounded “robotic” and the audio ran out of sync rather quickly.

Ffprobe output:

ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/wetransfer-6ec47f/IQT Capture 170911 Unity Round1.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.66.102
  Duration: 00:07:58.81, start: 0.000000, bitrate: 2672 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 162 kb/s (default)
    Metadata:
      handler_name    : DataHandler

By examining the file I found out that the packet durations of the AAC stream were not 1024 as they are with all the other files I have but rather either 1000 or 1100.
While this by itself would not be a problem, it’s very confusing that the AAC decoder outputs AVFrames with a duration of 1024.

So now I’m a bit stuck as I really don’t know what to do.
If the packets were all 1000 I would try discarding the last 24 samples of each AVFrame but as the frame apparently only holds 1024 samples although the packet says it contains 1100 samples, I’m stuck.
I tried sending a NULL packet in the case of longer packets hoping to get the remains 76 samples out of the decoder but I got this error message:

[aac @ 0x10539da00] Got unexpected packet size after a partial decode

The file plays fine in both QuickTime and VLC so there must be a correct way of handling these kind of files..

I’d be very grateful for any insight anyone of you might have!

Thanks and best,

Flo

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


What do you mean "packet contains 1100 samples", how is that specified? AVPacket->duration is in time_base units, not in samples.

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: AAC decode problems

Power Pan
is that VBR ? sampling rate changed during play ?
BTW, how we could get current play time ?

On Thu, Sep 14, 2017 at 7:22 PM, Anton Shekhovtsov <[hidden email]> wrote:


2017-09-14 14:06 GMT+03:00 Info || Non-Lethal Applications <[hidden email]>:
Hi guys,

I just received a movie file with AAC audio which doesn't play correctly in my player using the ffmpeg libraries.
It sounded “robotic” and the audio ran out of sync rather quickly.

Ffprobe output:

ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/wetransfer-6ec47f/IQT Capture 170911 Unity Round1.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.66.102
  Duration: 00:07:58.81, start: 0.000000, bitrate: 2672 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 162 kb/s (default)
    Metadata:
      handler_name    : DataHandler

By examining the file I found out that the packet durations of the AAC stream were not 1024 as they are with all the other files I have but rather either 1000 or 1100.
While this by itself would not be a problem, it’s very confusing that the AAC decoder outputs AVFrames with a duration of 1024.

So now I’m a bit stuck as I really don’t know what to do.
If the packets were all 1000 I would try discarding the last 24 samples of each AVFrame but as the frame apparently only holds 1024 samples although the packet says it contains 1100 samples, I’m stuck.
I tried sending a NULL packet in the case of longer packets hoping to get the remains 76 samples out of the decoder but I got this error message:

[aac @ 0x10539da00] Got unexpected packet size after a partial decode

The file plays fine in both QuickTime and VLC so there must be a correct way of handling these kind of files..

I’d be very grateful for any insight anyone of you might have!

Thanks and best,

Flo

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


What do you mean "packet contains 1100 samples", how is that specified? AVPacket->duration is in time_base units, not in samples.

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user



_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: AAC decode problems

Info || Non-Lethal Applications
In reply to this post by Anton Shekhovtsov

On 14. Sep 2017, at 13:22, Anton Shekhovtsov <[hidden email]> wrote:



2017-09-14 14:06 GMT+03:00 Info || Non-Lethal Applications <[hidden email]>:
Hi guys,

I just received a movie file with AAC audio which doesn't play correctly in my player using the ffmpeg libraries.
It sounded “robotic” and the audio ran out of sync rather quickly.

Ffprobe output:

ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/wetransfer-6ec47f/IQT Capture 170911 Unity Round1.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.66.102
  Duration: 00:07:58.81, start: 0.000000, bitrate: 2672 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 162 kb/s (default)
    Metadata:
      handler_name    : DataHandler

By examining the file I found out that the packet durations of the AAC stream were not 1024 as they are with all the other files I have but rather either 1000 or 1100.
While this by itself would not be a problem, it’s very confusing that the AAC decoder outputs AVFrames with a duration of 1024.

So now I’m a bit stuck as I really don’t know what to do.
If the packets were all 1000 I would try discarding the last 24 samples of each AVFrame but as the frame apparently only holds 1024 samples although the packet says it contains 1100 samples, I’m stuck.
I tried sending a NULL packet in the case of longer packets hoping to get the remains 76 samples out of the decoder but I got this error message:

[aac @ 0x10539da00] Got unexpected packet size after a partial decode

The file plays fine in both QuickTime and VLC so there must be a correct way of handling these kind of files..

I’d be very grateful for any insight anyone of you might have!

Thanks and best,

Flo

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


What do you mean "packet contains 1100 samples", how is that specified? AVPacket->duration is in time_base units, not in samples.

The audio stream has a time_base of 1/48000. So does the audio codec context.
That’s what I find so weird.


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: AAC decode problems

Anton Shekhovtsov


2017-09-14 14:34 GMT+03:00 Info || Non-Lethal Applications <[hidden email]>:

On 14. Sep 2017, at 13:22, Anton Shekhovtsov <[hidden email]> wrote:



2017-09-14 14:06 GMT+03:00 Info || Non-Lethal Applications <[hidden email]>:
Hi guys,

I just received a movie file with AAC audio which doesn't play correctly in my player using the ffmpeg libraries.
It sounded “robotic” and the audio ran out of sync rather quickly.

Ffprobe output:

ffprobe version 3.3.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/wetransfer-6ec47f/IQT Capture 170911 Unity Round1.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.66.102
  Duration: 00:07:58.81, start: 0.000000, bitrate: 2672 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2499 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 162 kb/s (default)
    Metadata:
      handler_name    : DataHandler

By examining the file I found out that the packet durations of the AAC stream were not 1024 as they are with all the other files I have but rather either 1000 or 1100.
While this by itself would not be a problem, it’s very confusing that the AAC decoder outputs AVFrames with a duration of 1024.

So now I’m a bit stuck as I really don’t know what to do.
If the packets were all 1000 I would try discarding the last 24 samples of each AVFrame but as the frame apparently only holds 1024 samples although the packet says it contains 1100 samples, I’m stuck.
I tried sending a NULL packet in the case of longer packets hoping to get the remains 76 samples out of the decoder but I got this error message:

[aac @ 0x10539da00] Got unexpected packet size after a partial decode

The file plays fine in both QuickTime and VLC so there must be a correct way of handling these kind of files..

I’d be very grateful for any insight anyone of you might have!

Thanks and best,

Flo

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


What do you mean "packet contains 1100 samples", how is that specified? AVPacket->duration is in time_base units, not in samples.

The audio stream has a time_base of 1/48000. So does the audio codec context.
That’s what I find so weird.


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


In that case I am out of ideas, sorry. But I`d like to see the sample video.

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: AAC decode problems

Carl Eugen Hoyos-2
In reply to this post by Info || Non-Lethal Applications
2017-09-14 13:06 GMT+02:00 Info || Non-Lethal Applications
<[hidden email]>:

> The file plays fine in both QuickTime and VLC

What about ffplay and ffmpeg -i input out.wav?

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user