GNOME Bugzilla – Bug 636621
flvdemux: doesn't set the right sample rate for aac audio
Last modified: 2010-12-07 12:28:36 UTC
Created attachment 175944 [details] 512k of data Youtube doesn't seem to set the right sample rate for format 34 and 35 (http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs) GST_DEBUG="flv*:5" gst-launch-0.10 playbin2 uri="file:///cobra_partial.flv" Original file is at http://www.youtube.com/watch?v=RnSyHEx8EWw flvdemux demux detect an audio sample rate of 44100 when the AAC really is 22050 0:00:01.733280253 14566 0x1e79a20 LOG flvdemux gstflvdemux.c:693:gst_flv_demux_parse_tag_audio:<flvdemux0> pts bytes 00 05 FD 00 0:00:01.733293936 14566 0x1e79a20 LOG flvdemux gstflvdemux.c:748:gst_flv_demux_parse_tag_audio:<flvdemux0> audio tag with 2 channels, 44100Hz sampling rate, 16 bits width, codec tag 10 (flags AF) 0:00:01.733309810 14566 0x1e79a20 LOG flvdemux gstflvdemux.c:858:gst_flv_demux_parse_tag_audio:<flvdemux0> got a raw AAC audio packet 0:00:01.733323336 14566 0x1e79a20 LOG flvdemux gstflvdemux.c:919:gst_flv_demux_parse_tag_audio:<flvdemux0> pushing 518 bytes buffer at pts 0:00:01.533000000 with duration 99:99:99.999999999, offset 33
Created attachment 175946 [details] [review] Adjust sample rate if necessary when AAC audio is detected Additionally call gst_flv_demux_audio_negotiate() for raw aac when rate has been ajusted.
Can you try adjusting the code to use gst_codec_utils_aac_get_sample_rate_from_index() from gst-plugins-base ? http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstpbutilscodecutils.html Otherwise looks good
Created attachment 175950 [details] [review] AAC sample rate adjustment using gst_codec_utils Adjust AAC sample rate when possible using gst_codec_utils_aac_get_sample_rate_from_index
Thanks, committed a modified version (mainly to avoid repeated caps re-setting): commit 6f8ce30c207ed0b0402e6c0f6727f5b2c31c4e10 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Tue Dec 7 13:11:48 2010 +0100 flvdemux: use aac codec-data to adjust samplerate if needed Based on patch by Fabien Lebaillif-Delamare <fabien@arq-media.com> Fixes #636621.