[FFmpeg-devel] [patch][GSoC]WTV muxer (2_wtvenc.patch, 3_add_wtv_muxer.patch)

Peter Ross pross at xvid.org
Tue Aug 23 12:04:12 CEST 2011


On Tue, Aug 23, 2011 at 11:40:15AM +0800, zhentan feng wrote:
> Hi,
> 
> Thanks your reviewing.
> 
> On Sat, Aug 20, 2011 at 11:20 PM, Peter Ross <pross at xvid.org> wrote:
> 
> > Hi. Comments against 2_wtvenc.patch and 3_add_wtv_muxer.patch
> >
> > [...]
> > > +// table 2
> > > +static void write_table_entries_events(AVFormatContext *s)
> > > +{
> > > +    AVIOContext *pb = s->pb;
> > > +    //WtvContext *wctx = s->priv_data;
> > > +
> > > +    //FIXME: output frame_nb, position pairs
> > > +    //avio_wl64(pb, 0x2);   avio_wl64(pb, 0xc0);
> > > +    avio_wl64(pb, 0x2);   avio_wl64(pb, 0x170);
> >
> > I thought this single-entry had to be present for WMC to playback the file
> > _and_ that
> > it had to point to the a chunk.
> >
> > 0x170 is the file-offset (aka position) within the timeline file. 0x170 was
> > just
> > hard-coded for testing. Should this be caclulated from write_headers()?
> >
> >
> 
> Here is the sample data from sample WTV files:
> 02 00 00 00 00 00 00 00 c0 00 00 00 00 00 00 00
> 32 00 00 00 00 00 00 00 50 ab 00 00 00 00 00 00
> 64 00 00 00 00 00 00 00 30 2a 07 00 00 00 00 00
> 96 00 00 00 00 00 00 00 e8 41 0b 00 00 00 00 00
> c8 00 00 00 00 00 00 00 e8 bd 10 00 00 00 00 00
> fa 00 00 00 00 00 00 00 68 75 16 00 00 00 00 00
> 
> I thought:
> 1) the first 8 bytes is the frame_nb
> 2) the last 8 bytes is the position of the frame_nb in the timeline file.
> I implemented this, but the file can't work with WMC.
> 
> I checked it again and I think you were right before we discussed on MSN:
> 
> for the last 8 bytes of the each line, it is the position in timeline
> file pointing to the sync_chunk.
> I don't know the first 8 bytes' meaning.
> However, it seems that the first syn_chunk is always 0x02.

The first 8 bytes refers to the 'chunk serial number'. I think originally we
called this frame_nb. Files created using Windows Media Center always have
a 'sync_chunk' as the second chunk, hence why its 0x02.

> So, I'll add only one entry here, and calculated the position for the first
> sync_chunk.
> The field is critical for WMC palyback.

It is. There needs to be at least one sync chunk to enable playback. In earlier
testing I found that it doesnt matter where the sync chunk is (i.e. it can be
the third chunk), so long as there is at least one entry outputed by
write_table_entries_events().

Cheers,

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110823/ebf8ed71/attachment.asc>


More information about the ffmpeg-devel mailing list