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 148993 - Gstreamer fails to play Faac created aac file
Gstreamer fails to play Faac created aac file
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.4
Other Linux
: Normal normal
: 0.8.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-01 13:22 UTC by ismail dönmez
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
Problematic aac file (7.71 KB, audio/aac)
2004-08-01 13:23 UTC, ismail dönmez
  Details
Allows playing .aac files (6.49 KB, patch)
2004-09-22 15:20 UTC, Sebastien Cote
none Details | Review
patch to play .aac files (6.13 KB, patch)
2004-09-29 18:27 UTC, Sebastien Cote
none Details | Review

Description ismail dönmez 2004-08-01 13:22:22 UTC
I created a simple aac file using faac. But gstreamer fails to play it : 
 
 
cartman@southpark:~$ gst-launch filesrc location=excellent.aac ! spider ! audioconvert ! audioscale! 
artsdsink 
RUNNING pipeline ... 
artsdsink: closed connection 
ERROR: from element /pipeline0/spider0/sink_ident: Could not determine type of stream. 
Execution ended after 2 iterations (sum 1420951000 ns, average 710475500 ns, min 301000 ns, max 
1420650000 ns). 
artsdsink: closed connection
Comment 1 ismail dönmez 2004-08-01 13:23:28 UTC
Created attachment 30137 [details]
Problematic aac file

File to reproduce problem
Comment 2 Ronald Bultje 2004-08-01 18:46:45 UTC
We don't have an AAC parser or typefind function, we only playback AAC-in-Quicktime.
Comment 3 hans-jürgen 2004-08-30 10:01:43 UTC
Hi, just found this thread with Google...  this is what the file properties in 
foobar2000 tell about your AAC file:

bitrate = 52
channels = 2
samplerate = 22050
aac_profile = AAC LC
aac_header_type = ADTS
codec = AAC
 ---------- 
26624 samples @ 22050Hz
File size: 7 899 bytes
Length: 0:01.207

It plays fine (sounding distorted though), and due to its short length the 
bitrate might not be displayed correct. Anyhow, if you want to encode an input 
file or bitstream directly to the MP4 format with FAAC, you would have to use 
either the -w or the -o switch (with *.mp4 as file extension) on the command 
line. This only works if FAAC has been compiled with libmp4v2 support, the 
MPEG4IP library for writing MP4 files. See also 
http://www.audiocoding.com/modules/wiki/?page=FAAC

On the other hand I think that gstreamer should be able to decode plain AAC 
files with an AAC parser (maybe without), because they use FAAD2 for playback, 
the open source AAC decoder from Audiocoding.com that can also understand these 
files, even if they don't have any headers (= raw), but then with additional 
input switches supplying the missing info about used profile etc.
Comment 4 Sebastien Cote 2004-09-22 15:20:26 UTC
Created attachment 31835 [details] [review]
Allows playing .aac files

This patch adds buffer management to the FAAD filter so it can play .aac files
(no typefinding though). With this patch, I can play your file with the
following command:

  gst-launch-0.8 filesrc location=test.aac ! faad ! audioconvert ! audioscale !
esdsink

I also removed the source pad renegotiation in gst_faad_sinkconnect() since it
caused the following assertion when using spider after qtdemux:

  (process:8868): GStreamer-CRITICAL **: file gstpad.c: line 1434
(gst_pad_renegotiate): assertion `GST_PAD_LINK_SINK (pad)' failed
Comment 5 Sebastien Cote 2004-09-23 18:27:42 UTC
typefinding for .aac is already included in gst-plugins-0.8.4 (I'm still using
0.8.2). So "faad" can be replaced by "spider" to decode .aac files.
Comment 6 Ronald Bultje 2004-09-25 14:45:20 UTC
You use a static buffer + size member in the GstFaad struct. Can you change that
to use gst_buffer_merge() and gst_buffer_create_sub()? I don't like the static
array because it allows for overflows.
Comment 7 Sebastien Cote 2004-09-29 18:27:36 UTC
Created attachment 32077 [details] [review]
patch to play .aac files

This one uses a GstBuffer instead of a char array.
Comment 8 Ronald Bultje 2004-09-30 12:05:03 UTC
Good going! Now you actually need a gst_buffer_unref () for both input buffers
after the _join() (yes, that's ugly, but it changes interface so we will only
fix that in 0.9). Apart from that, I'd say just commit this.
Comment 9 Sebastien Cote 2004-09-30 12:45:54 UTC
Are you sure I need to unref the buffers? Running `gst-launch --trace` doesn't
show me any live buffer at the end and the documentation says that the buffers
are unreffed for join() but not for merge().

GstBuffer *
gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2)
{
  GstBuffer *result;

  /* we're just a specific case of the more general gst_buffer_span() */
  result = gst_buffer_span (buf1, 0, buf2, buf1->size + buf2->size);

  gst_buffer_unref (buf1);
  gst_buffer_unref (buf2);

  return result;
}
Comment 10 Ronald Bultje 2004-10-01 08:45:18 UTC
Oops, I don't even know my own API. Yes, you're correct, sorry.
Comment 11 Ronald Bultje 2004-10-01 13:00:46 UTC
Lovely, works fine. Applied, thanks a lot!