[FFmpeg-devel] [RFC][PATCH] Windows Television (WTV) file system handling

Peter Ross pross
Sun Jan 9 07:21:20 CET 2011


Hi,

The Windows Television (WTV) file format is a more complex beast than
initially imagined.

WTV is best viewed as a file system. Metadata, seek index tables, and
chunked data are stored in separate files within. The fileystem uses
a simple hierarchical file allocation table, with standard (4k) and big
(256k) sector sizes. Standard FAT concepts apply, like fragmentation
and the existence of slack space.

The current WTV demuxer is not aware of the file system, and therefore
only works on smalls wtv samples (<600MiB) where the files are not
fragmented. Most WTV recordings are much larger. e.g. a 3hr HD recording
of the tennis results in a 24GiB file and lots of fragmentation.

Due to the complexity, I would really appreciate comments on the patch,
especially my use of ByteIOContext.

0003-wtv-file-system-implementation.patch
* wtvfile_open()/wtvfile_close() are used to open files and access
  content through ByteIOContext interface.

* Demuxer now parses the index tables, and constructs an AVIndexEntry[]
  table.  Because our table refers to positions within in the chunked data
  file (and not the actual wtv file), it is necessary to turn off the
  generic seek functionality found in av_seek_frame(). The generic seeking
  routines assume that AVIndexEntry->pos is an absolute address.

* I have removed AVSEEK_FLAG_BYTE support, as this is no longer really
   practical
  (or useful) with the file system abstraction.

* Meta data is parsed. While it is able to extract a thumbnail image, I
  have ifdef'd this out, as ffmpeg forbids image attachments using 
  AVMEDIA_TYPE_ATTACHMENT.

0002-add-AVFMT_NOGENERICSEEK-flag.patch
* adds AVFMT_NOGENERICSEEK flag, which should be self explanatory.

0001-make-unicode-string-reader-accessible-to-other-modu.patch
* the metadata format uses unicode structures similar, but not identical,
  to ASF/DRV-MS.

Cheers,

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-make-unicode-string-reader-accessible-to-other-modu.patch
Type: text/x-diff
Size: 3956 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110109/22640028/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-add-AVFMT_NOGENERICSEEK-flag.patch
Type: text/x-diff
Size: 1688 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110109/22640028/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-wtv-file-system-implementation.patch
Type: text/x-diff
Size: 25520 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110109/22640028/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110109/22640028/attachment.pgp>



More information about the ffmpeg-devel mailing list