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 149158 - [qtdemux/faad] MP4 file encoded Nero AAC Codec 2.6.2.0 is not played
[qtdemux/faad] MP4 file encoded Nero AAC Codec 2.6.2.0 is not played
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.4
Other Linux
: Normal normal
: 0.8.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 138435
 
 
Reported: 2004-08-03 14:54 UTC by ismail dönmez
Modified: 2005-03-10 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix. (3.70 KB, patch)
2005-02-21 18:46 UTC, Maciej Katafiasz
committed Details | Review
faad "fix" (831 bytes, patch)
2005-03-03 12:17 UTC, Ronald Bultje
none Details | Review
qtdemux patch (1000 bytes, patch)
2005-03-03 15:33 UTC, Ronald Bultje
none Details | Review

Description ismail dönmez 2004-08-03 14:54:30 UTC
The file is 30mb so I attached 1MB start of it as BBB requested.
Comment 1 ismail dönmez 2004-08-03 15:02:57 UTC
Couldn't upload but this url has the file http://www.laaxo.pp.fi/TeeSummerTranceMix2004.mp4 
Comment 2 Stephane Loeuillet 2004-08-03 15:50:56 UTC
running this file with latest CVS for everything gives me :

ERROR (0x8109fe8 - 303207:43:44.030271000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type iods
ERROR (0x8109fe8 - 303207:43:44.030568000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type ctts
ERROR (0x8109fe8 - 303207:43:44.030637000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type nmhd
ERROR (0x8109fe8 - 303207:43:44.030693000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mp4s
ERROR (0x8109fe8 - 303207:43:44.030748000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mpod
ERROR (0x8109fe8 - 303207:43:44.030817000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type nmhd
ERROR (0x8109fe8 - 303207:43:44.030872000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mp4s
ERROR (0x8109fe8 - 303207:43:44.030968000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type iods
ERROR (0x8109fe8 - 303207:43:44.031045000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type ctts
ERROR (0x8109fe8 - 303207:43:44.031109000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type nmhd
ERROR (0x8109fe8 - 303207:43:44.031165000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mp4s
ERROR (0x8109fe8 - 303207:43:44.031220000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mpod
ERROR (0x8109fe8 - 303207:43:44.031275000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type nmhd
ERROR (0x8109fe8 - 303207:43:44.031330000)         qtdemux( 2981)
qtdemux.c(1318):qtdemux_type_get: unknown QuickTime node type mp4s
ERROR (0x85905c0 - 303207:43:44.474263000)         default( 2981) 

gstfaad.c(371):gst_faad_chain:<faad0> Failed to decode buffer: Maximum number of
scalefactor bands exceeded

codec not in qtdemux codec list ?
Comment 3 ismail dönmez 2004-08-03 15:54:36 UTC
Faad2 ( version 2.0 ) can correctly decodes this to wav with : 
faad -d TeeSummerTranceMix2004.mp4  
 
Also mplayer plays the file fine. 
Comment 4 Ronald Bultje 2004-08-03 23:51:36 UTC
The error indicates that the decoderspecificdata (what's in codec_data in the
caps) was not provided correctly.

Maybe that's what mp4s is? The audio tag is supposed to be called mp4a, no?
Comment 5 Stephane Loeuillet 2004-08-04 11:14:55 UTC
yes, it's supposed to be mp4a for audio and mp4v for video

could this be a MPEG system stream ? (even if they aren't supposed to be
versionned ?)
i must say i'm lost between all the different MPEG stream types that exists
(program, transport, elementary, video, audio, ...)

mplayer says that about this file :

Playing TeeSummerTranceMix2004.mp4.
Cache fill:  0,00% (0 bytes)    ISO: File Type Major Brand: ISO/IEC 14496-1
(MPEG-4 system) v2
QuickTime/MOV file format detected.
--------------
MOV track #0: 4428 chunks, 97397 samples
Audio bits: 16  chans: 2  rate: 44100
MOV: Found MPEG4 audio Elementary Stream Descriptor atom (54)!
Fourcc: mp4a
--------------
MOV track #1: 1 chunks, 0 samples
Generic track - not completely understood! (id: 1)
--------------
MOV track #2: 1 chunks, 0 samples
Generic track - not completely understood! (id: 2)
--------------
MOV: longest streams: A: #0 (97397 samples)  V: #-1 (0 samples)
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 16000->176400 (128,0 kbit)
Selected audio codec: [faad] afm:faad (FAAD AAC (MPEG2/MPEG4 Audio) decoder)

as a side note, i am unable to play any of the MOV files i have, and it looks
like qtdemux has a lot a problems reading zlib compressed headers (not the case
for this particular bug, for which headers aren't compressed at all)
Comment 6 Ronald Bultje 2004-12-03 23:05:54 UTC
Can you please re-provide the file?
Comment 7 ismail dönmez 2004-12-13 08:09:53 UTC
I longer have this file. Sorry. 
Comment 8 Stephane Loeuillet 2004-12-18 11:40:30 UTC
find plenty of samples there :
http://www.nerodigital.com/eng/Trailers.html
Comment 9 Stephane Loeuillet 2004-12-18 12:11:39 UTC
with those 'trailers', i've got this error : (and no video/audio)

HDTV :
ERROR (0x84e9608 - 306492:06:31.582992000)         default(29329)
gstfaad.c(604):gst_faad_chain:<faad0> Failed to decode buffer: Maximum number of
bitstream elements exceeded

or this one :

Mobile :
ERROR (0x84e9630 - 306492:08:05.122819000)         default(29333)
gstfaad.c(604):gst_faad_chain:<faad0> Failed to decode buffer: Negative
scalefactor found, should be impossible

Cinema/Portabe : play, but sound is choppy
Standard : plays ok, video and audio
Comment 10 Stephane Loeuillet 2004-12-18 12:52:32 UTC
found the original TeeSummerTransMix2004.mp4 file, putting it in your ftp
account, in /ISO_mp4/
Comment 11 Greg Dennis 2004-12-21 22:06:55 UTC
I am experiencing a similar error with m4a files encoded with iTunes. I'm using
Fedora Core 3 and latest freshrpms version of everything:

ERROR (0x9b59a98 - 306573:52:12.253468000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type disk
ERROR (0x9b59a98 - 306573:52:12.253916000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type \uffffday
ERROR (0x9b59a98 - 306573:52:12.254058000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type mean
ERROR (0x9b59a98 - 306573:52:12.254161000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type name
ERROR (0x9b59a98 - 306573:52:12.254262000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type mean
ERROR (0x9b59a98 - 306573:52:12.254360000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type name
ERROR (0x9b59a98 - 306573:52:12.254578000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type disk
ERROR (0x9b59a98 - 306573:52:12.254744000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type \uffffday
ERROR (0x9b59a98 - 306573:52:12.267662000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type mean
ERROR (0x9b59a98 - 306573:52:12.267729000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type name
ERROR (0x9b59a98 - 306573:52:12.267768000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type mean
ERROR (0x9b59a98 - 306573:52:12.267805000)         qtdemux( 7501) qtdemux.c(1396
):qtdemux_type_get: unknown QuickTime node type name
rhythmbox: symbol lookup error: /usr/lib/gstreamer-0.8/libgstfaad.so: undefined
symbol: NeAACDecOpen
Comment 12 Ronald Bultje 2004-12-22 09:16:32 UTC
Recompile the faad plugin with -lfaad. It's unrelated to this bug.
Comment 13 Greg Dennis 2005-01-05 21:31:04 UTC
I'm kind of new to this. do you think you could give me more detailed comments
as to how to do that exactly?
Comment 14 Ronald Bultje 2005-01-05 21:56:11 UTC
Re-run ./configure in gst-plugins and make sure that it detects the FAAD library
correctly. Ask on IRC if you need more help, bugzilla isn't exactly suited for
this kind of stuff. ;).
Comment 15 Nicholas Miell 2005-02-03 01:17:22 UTC
I get

"Could not decode stream. Additional debug info: gstfaad.c(397): gst_faad_chain:
/work_thread/autoplugger/faad0: Failed to decode buffer: Maximum number of
scalefactor bands exceeded"" 

from gst-player when attempting to play
http://64.202.105.38/videos/cash_h.mp4

I don't know how stable that URL is, it's the video embedded in
http://www.markromanek.com/video/14_video.html
Comment 16 Maciej Katafiasz 2005-02-10 18:36:39 UTC
FWIW, I have very similar thing in MKV:
http://mathrick.org/files/Arc%20the%20Lad%20-%20(01)%20%5bax%5d%5bsub%5d.mkv .
MPlayer plays it fine, but so far I wasn't able to track any differences in the
way we initialise FAAD compared to mplayer, nor in the way we pass data. I'm
currently debugging it, I hope to come up with fix soon, if it's indeed the same
issue it should also fix qtdemux.
Comment 17 Maciej Katafiasz 2005-02-16 02:30:13 UTC
If I'm not mistaken, I have found the cause of this bug, and it's gonna get
ugly. The reason is as follows: sometimes, there will be something like 210
bytes of data in muxed stream, but only 209 of this will get consumed by faad.
Now here's the problem: we will save that byte (in fact, we won't even know
about it, it'll look like the rest of buffer) and pass it to faad, while in fact
it's spurious NULL[0] value, which will distort real data and cause faad to
barf. We have no way to know about that, as all we get is single contigous 4K
buffer, not series of 200-something byte chunks. 

MPlayer gets around this because they're tangled mess, and explicitly call
demuxer from inside decoder, which is supposed to know about every possible
codec, and then return *packetised* (as it's inside container) AAC data in nice
chunks. So, they also pass 210 bytes of which 209 is consumed and spurious NULL
appended, but they don't even notice that because next decode will operate on
next pulled chunk, which again starts with real data and so NULLs are simply
skipped. It's cheap for them to get chunk-by-chunk, as it's only 3 or 4 nested
simple funcalls.

However, we don't operate this way. Our decoders don't call directly into
demuxers, so getting data exactly when needed is not that easy. So the solution
would be to either somehow know beforehand which bytes in buffer are "fake",
which I don't think is possible for demuxer, as it's, uh, the decoder's job to
interpret the data, and demuxer only passes what *is* in stream[1]; or to pass
around ridiculously small buffers, sized of single 200 bytes chunk, but that's
going to generate insane amounts of context switches. Dunno what's be good way
out here.

[0] In fact I don't know if it's necessarily NULL, I only worked on that mkv I
linked above, where it is NULL indeed.

[1] I'd like to know why the hell it's there, the spurious NULL. If it's
supposed to be some padding, then it doesn't work so hot... Maybe there is some
info about those bytes which would allow us to strip them off before inserting
into outbuffer, that would be perfect.
Comment 18 Maciej Katafiasz 2005-02-16 02:36:22 UTC
Also, I'll try to poke around tomorrow, and test with other files to confirm
explanation. But in case of my MKV, the cause of failure is certainly presence
of byte that's not supposed to be decoded, despite being in stream for some reason.
Comment 19 Maciej Katafiasz 2005-02-21 18:46:26 UTC
Created attachment 37749 [details] [review]
Proposed fix.

This patch fixes mkv case. Please test with qt to see if it's indeed the same
issue
Comment 20 Maciej Katafiasz 2005-02-21 18:53:28 UTC
Ok, so qt still bails out. Will debug more, commiting MKV fix for now.
Comment 21 Maciej Katafiasz 2005-02-22 08:31:18 UTC
It seems that qt fails because AFAICS it doesn't pass codec_data, code to do
that is #if 0'd (d'oh). I'll look around and see why exactly it was disabled
(simply uncommenting it doesn't make it work yet, qt is processed in rather
magic way :)
Comment 22 Ronald Bultje 2005-02-22 10:09:15 UTC
Like I said in one of my first comments, the qt file has mp4s atoms instead of
mp4a atoms for its esds data. It should be easy to add but I did not do that yet.
Comment 23 Ronald Bultje 2005-03-03 12:17:37 UTC
Created attachment 38199 [details] [review]
faad "fix"

This is part one of a fix. It should probably not be committed because it's not
right, but with this you will be able to play it back using "gst-launch filesrc
location=~/Media/bugs/TeeSummerTranceMix2004.mp4 ! ffdemux_mov_mp4_m4a_3gp !
faad ! audioconvert ! audioscale ! alsasink device=dmix". The time=0 is always
output on MPEG-4 audio by ffmpeg. That needs fixing in there, hence the hack.

Now, for the real fix, qtdemux never passes codec_data. Never. Ever. I've
tested all my files, nada. Nothing. Once we fix that, those files will work.
Dave?
Comment 24 Ronald Bultje 2005-03-03 15:33:11 UTC
Created attachment 38206 [details] [review]
qtdemux patch

This seems to work for this specific file. Not sure if version 0x00010000 needs
+0x34 anyway. Dave, please reply.
Comment 25 Ronald Bultje 2005-03-10 15:29:53 UTC
Fixed.