Log in

View Full Version : Extract used matrix from h.264 streams


McCauley
14th November 2007, 15:17
Hi,

i discussed this with another user already, but we haven't found a way to gather that information.
Is there a way to extract the used matrix out of a .h264 stream?
Since the matrix used is sometimes known (see here (http://forum.doom9.org/showthread.php?t=124755)), would it be possible to search for the matrix in the stream and use that information to look for the matrix in streams where it isn't known which one was used?.

Regards and thanks in advance
McCauley

talen9
15th November 2007, 11:57
Here (http://forum.doom9.org/showthread.php?t=123076) is a tool which analyzes multimedia files in general and is capable of reporting the matrix used in h.264 streams (if it's different than the default one, that is).

foxyshadis
15th November 2007, 11:58
h264_parse has that info, look in the scaling lists. h264Visa can detect the presence of the matrix, but doesn't display them; the creator might be willing to make a window showing those though.

Talen, I was checking for CQM information in the latest version of avinaptic, but they don't show up.

talen9
15th November 2007, 13:43
h264_parse has that info, look in the scaling lists. h264Visa can detect the presence of the matrix, but doesn't display them; the creator might be willing to make a window showing those though.

Talen, I was checking for CQM information in the latest version of avinaptic, but they don't show up.

Hmm that's strange ... i definitely remember fsinapsi saying that he was at least going to implement it, I was sure it was there ... fact is, i have actually never produced any h.264 stream using a CQM, so i never checked the report.


I checked just now with the changelog, it seems that AVC CQM support was added in March 25, 2007 version ... seems something i have to make fsinapsi aware ;)

talen9
15th November 2007, 21:39
Sorry for double posting.

I contacted fsinapsi about this bug; he's already found out what the problem was and, together with some other minor bugfixes, a new version will be out in a few days, I suppose.

With his consent, I'll report in short his assessment of the bug (I'll only translate from Italian, my comprehension of internal structure of AVC streams is pretty limited; any errors are mine anyway :p).


In the first revisions of the standard, any CQMs would be stored inside an SPS structure; in further revisions, it seems that FREXT (Fidelity Range Extensions) were added that allowed storing CQMs inside even in a PPS structure.

When fsinapsi initially coded the h.264 parser, he had access only to old source of the reference h264 encoder; the h.264 stream he tested the parser against was generated by the ATEME encoder, and it put the CQM description inside an SPS structure, so he thought the parser was correct.

Since he doesn't actually use x264, he didn't know until this afternoon that in fact x264 stores CQMs inside PPS structures (he is wondering why, btw :p).

That's all :)

To the original poster: my suggestion was, as it shows, pretty ill-advised, sorry about that!

Terranigma
15th November 2007, 23:11
h264_parse has that info, look in the scaling lists.
How do you do this?

Kurtnoise
16th November 2007, 09:35
h264_parse input.h264 > output.txt
and check the result in the text file. h264_parse is part of MPEG4IP package...

buzzqw
16th November 2007, 11:06
frank (developer of avinaptic) is working on this

and afaik have an already beta working version

BHH

drmpeg
16th November 2007, 11:17
How do you do this?
Just in case anyone needs the binary. Has my fixes for high bitrate and AVCHD files.

http://www.w6rz.net/h264_parse.zip

Ron

Terranigma
16th November 2007, 15:34
Thanks Kurtnoise13 for the example, and drmpeg for the binary. :)

buzzqw
18th November 2007, 15:41
fsinapsi have published the update to avinaptic , now is possible to view the matrix used

BHH

hristoff2
18th November 2007, 22:55
Great!

This is what I got out of ratatouille (pretty disappointing actually):
http://pastebin.ca/781445

13 Ghosts = Prestige Matrix