|
|
| chinleong |
| Posted: Feb 23 2006, 02:32 AM |
 |
|
Unregistered

|
Anyone know what does the chunk ID "7FXX" in the idx1 chunk of an AVI file represents? Thanks for the help. |
 |
| phaeron |
| Posted: Feb 23 2006, 08:08 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
Presumably it indexes a 7FXX chunk in the main data segment, which theoretically should correspond to stream 127 within the file. Somehow, I doubt the file has 128 streams, though. |
 |
| stephanV |
| Posted: Feb 23 2006, 08:48 AM |
 |
|
Spam killer ;)
  
Group: Moderators
Posts: 4347
Member No.: 8917
Joined: 18-February 04

|
Are stream numbers hex? I thought they were decimal...
-------------------- useful links: VirtualDub, Input plugins and filters, AviSynth, AVI-Mux GUI, AC3ACM by fcchandler, VirtualDub FAQ |
 |
| phaeron |
| Posted: Feb 24 2006, 04:30 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
Nope, they're hex. From the AVI section in vfw.h:
| CODE | /* ** Useful macros ** ** Warning: These are nasty macro, and MS C 6.0 compiles some of them ** incorrectly if optimizations are on. Ack. */
/* Macro to get stream number out of a FOURCC ckid */ #define FromHex(n) (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0')) #define StreamFromFOURCC(fcc) ((WORD) ((FromHex(LOBYTE(LOWORD(fcc))) << 4) + \ (FromHex(HIBYTE(LOWORD(fcc))))))
/* Macro to get TWOCC chunk type out of a FOURCC ckid */ #define TWOCCFromFOURCC(fcc) HIWORD(fcc)
/* Macro to make a ckid for a chunk out of a TWOCC and a stream number ** from 0-255. */ #define ToHex(n) ((BYTE) (((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0'))) #define MAKEAVICKID(tcc, stream) \ MAKELONG((ToHex((stream) & 0x0f) << 8) | \ (ToHex(((stream) & 0xf0) >> 4)), tcc)
|
|
 |
| chinleong |
| Posted: Mar 1 2006, 04:15 AM |
 |
|
Unregistered

|
The 'xx' in '7fxx' is the actual alphabet 'x'. I am not using the 'xx' to represent the db, dc or wb.
Is did not see any '7fxx' stream in the 'movi' list. |
 |
| phaeron |
| Posted: Mar 1 2006, 04:19 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
Stream chunks can use other TWOCC codes besides db, dc, or wb. If you look at some old Indeo AVIs you'll find 00iv chunks instead for the video stream.
As for what the 7fxx chunk refers to, though, I still have no idea. |
 |
| Moitah |
| Posted: Mar 1 2006, 05:56 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 210
Member No.: 8955
Joined: 20-February 04

|
Maybe it has to do with the delay frames used by codecs such as DivX/XviD. These delay frames consist of a single byte, 0x7F. They should be removed by the encoding application, but maybe some strange application wrote a '7FXX' index entry in an attempt to get players to skip over these frames. Just a guess . |
 |
| alexnoe |
Posted: May 1 2006, 08:53 AM |
 |
|
Unregistered

|
Does that file have an OpenDML index as well? Since in open-dml you define the stream number of a stream in its super index, you could have a file with streams #17, #23 and #7F ...
Besides that, every specification I've found says the stream number is "2 digits". I haven't found any saying what kind of digits, I also assumed it was BCD. Well, I just tried the DShow AVI Mux filter, and it uses hex as well |
 |
| phaeron |
| Posted: May 2 2006, 04:12 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
I'm not sure if you can actually renumber streams that way. It certainly seems like a way to unnecessarily introduce compatibility. AVI is poorly documented. 
In any case, this might explain why some people were reporting a while back that DirectShow's AVI Splitter only seems to support 10 streams. |
 |
| alexnoe |
| Posted: May 2 2006, 06:55 AM |
 |
|
Unregistered

|
Microsoft's AVI splitter understands weird numbering with Open-DML, at least last time I tried. Since you now know that I thought the stream numbers were BCD, you probably guess that AVI-Mux GUI creates stream numbers like ... 08, 09, 10, 11, ...
When you said that those stream numbers were hex, I suddenly understood why that splitter played AVI-Mux GUI's files with >10 streams only when they were Open-DML |
 |
| phaeron |
| Posted: May 2 2006, 07:09 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
That makes sense. With the compatibility index, the stream number is the only way to associate chunks with the stream headers, because all of the chunks are placed in the same index. The OpenDML indices are per-stream, so this is not necessary.
Which makes me wonder if the stream IDs actually have to match the chunks at all, since in theory they're redundant as long as you have the indices.
I'll have to check my parser to see if it is affected by this. I don't believe the mainline path would care, since it simply parses each index along with the stream header and reads the byte ranges indicated by the index. The index recovery code may not be able to cope with non-sequential stream IDs, though. |
 |
| alexnoe |
Posted: May 2 2006, 07:15 AM |
 |
|
Unregistered

|
For Open-DML, I'd guess they are not required to match, because Microsoft's splitter even plays files where most chunk headers don't even exist ( -> low overhead mode ). |
 |