GNOME Bugzilla – Bug 153434
[PATCH] faac filter cannot create .aac files
Last modified: 2005-01-07 10:15:04 UTC
The AAC encoder filter (faac) doesn't generate ADTS so it cannot create .aac files. In the code, there's a comment about autodetecting if we need it or not (use ADTS if connecting to the filesink, not when connecting to a qtmux). For this to work correctly, I think that faac should default to using ADTS and use raw AAC when its requested in the caps. Another solution would be to let the user choose what kind of output he wants by using properties.
Created attachment 31831 [details] [review] Quick fix Adds the "outputformat" property to let the user choose between ADTS and raw.
You're supposed to use it in combination with a qtmux or matroskamux element. faad doesn't play ADTS/raw files either, so the resulting file would be useless nonetheless.
Oh, wait, I didn't see your update to 148993. If you add a typefind function, I'm fine with this.
In fact, FAAD2 can decode .aac (ADTS) files so you could decode the file without GStreamer. I'll look into adding a typefind function to the decoder, I have no idea how that works.
For typefinding, look at gst-plugins/gst/typefind/gsttypefindfunctions.c
typefinding for .aac is already included in gst-plugins-0.8.4
I kind of dislike this patch. I hope you don't mind me disliking it. ;). HEre's some random thoughts on what we could do to fix this properly. First, what do we want? Imo, we'd like the detection of "raw frames or write headers" to be automated. Raw frames will always be placed in a container, which expects a caps with a specific mimetype, e.g. audio/mpeg,mpegversion=(int)4. So what you could do is to make the src template have two caps: audio/mpeg,mpegversion=(int)4 and application/x-adts-m4a. The ADTS mimetype should come first, else it won't work! Autofixation will see if the peer pad accepts either. Container will only accept the second. Filesink will accept both and thus it'll fixate to the first. Then, in a link function, simply check the mimetype of the selected (fixated) caps and write headers based on that. Sorry, long story, but it'll make this automatic and I kind of like that idea.
I agree with you and that's why my patch was named quick fix. (The patch is almost smaller than your explanation for the perfect solution ;-) I really don't mind if you don't apply the patch, but I don't think I'll have the time to create the perfect fix soon. In the meantime, I can still generate .aac files with this patch.
Ronald what should we do here? Should we apply this patch or not?
Feel free to apply. It's not necessarily right, though.
It might be better not to apply the patch if we want the problem to be fixed correctly (and leave the bug open). In the meantime, people who want to create .aac files can always get the patch here.
Since the correct solution will take a while, I've applied it. We don't have a qtmux element anyway.