I am attempting to transcode an mp4 file into a standard format. The video seems ok but the audio is choppy (and out of sync with the video).
My test input file has the following properties:
Stream #0:1(eng), 0, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, 2 channels, 129 kb/s (default)
and I'm outputing to:
Stream #0:1, 0, 1/44100: Audio: aac (libfaac) (Main), 44100 Hz, stereo, s16, 128 kb/s
When I construct the audio filter graph I get the following debug output:
[in @ 0x103954380] Setting 'time_base' to value '1/48000'
[in @ 0x103954380] Setting 'sample_rate' to value '48000'
[in @ 0x103954380] Setting 'sample_fmt' to value 'fltp'
[in @ 0x103954380] Setting 'channel_layout' to value '0x3'
[in @ 0x103954380] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format @ 0x10390b3e0] Setting 'sample_fmts' to value 's16'
[format @ 0x10390b3e0] Setting 'sample_rates' to value '44100'
[format @ 0x10390b3e0] Setting 'channel_layouts' to value '0x3'
[format @ 0x10390b3e0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'in' and the filter 'format'
[AVFilterGraph @ 0x101f21b80] query_formats: 3 queried, 3 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x103952bc0] ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
This looks correct to me but I'm getting a lot of the following messages when I process the file...
[libfaac @ 0x102063a00] Trying to remove 80 more samples than there are in the queue
...and the audio is choppy. Also I'm seeing that the sample format is the same as the original file (from ffprobe):
Stream #0:1(und): Audio: aac (Main) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
i.e. it hasn't done the conversion from AV_SAMPLE_FMT_FLT to AV_SAMPLE_FMT_S16.
I'm wondering if the bitrate is the cause of the problem but I can't see any way to transform the input bitrate to the output bitrate. Any thoughts?