After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636621 - flvdemux: doesn't set the right sample rate for aac audio
flvdemux: doesn't set the right sample rate for aac audio
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.26
Other All
: Normal normal
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-06 17:53 UTC by Fabien Lebaillif - Delamare
Modified: 2010-12-07 12:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
512k of data (512.00 KB, video/x-flv)
2010-12-06 17:53 UTC, Fabien Lebaillif - Delamare
  Details
Adjust sample rate if necessary when AAC audio is detected (1.40 KB, patch)
2010-12-06 17:57 UTC, Fabien Lebaillif - Delamare
none Details | Review
AAC sample rate adjustment using gst_codec_utils (1.24 KB, patch)
2010-12-06 19:52 UTC, Fabien Lebaillif - Delamare
none Details | Review

Description Fabien Lebaillif - Delamare 2010-12-06 17:53:04 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
Comment 1 Fabien Lebaillif - Delamare 2010-12-06 17:57:38 UTC
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.
Comment 2 Edward Hervey 2010-12-06 19:23:40 UTC
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
Comment 3 Fabien Lebaillif - Delamare 2010-12-06 19:52:28 UTC
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
Comment 4 Mark Nauwelaerts 2010-12-07 12:15:05 UTC
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.