[FFmpeg-devel] Corrupt duration in packet while encoding to WMA

Michael Niedermayer michaelni
Tue Dec 4 00:46:07 CET 2007


On Mon, Dec 03, 2007 at 06:18:07PM -0500, Ronen Mizrahi wrote:
> Michael Niedermayer wrote:
> > On Mon, Dec 03, 2007 at 01:56:56AM -0500, Ronen Mizrahi wrote:
> >   
> >> Hello,
> >>
> >> While using ffmpeg to encode to WMA we noticed that when the call below
> >> is made in asf-enc.c, packet_timestamp_end is smaller than
> >> packet_timestamp_start and hence a negative duration is written to the
> >> packet. While Windows Media Player did not seem to care about it,
> >> Windows Media Player CE (the one used in Pocket PC and Windows Mobile)
> >> exhibited an odd behavior (such as skipping several seconds slightly
> >> after starting playback). Changing the order between the start and the
> >> end below, seems to fix the problem, however I am not certain it is the
> >> correct thing to do, and would very much appreciate some feedback from
> >> the maintainer of asf-enc.c
> >>
> >> This is the call where we believe there is a bug:
> >> put_payload_parsing_info(
> >>                             s,
> >>                             asf->packet_timestamp_start,
> >>                             asf->packet_timestamp_end -
> >> asf->packet_timestamp_start,
> >>                             asf->packet_nb_payloads,
> >>                             asf->packet_size_left
> >>                         );
> >>     
> >
> > thanks for the info
> > i think ive fixed it in svn, please check!
> >
> > [...]
> >   
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at mplayerhq.hu
> > http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> 
> Thank you I did check it and it seems to do the trick. There are still
> cases where the end is equal to the start but I suspect these are valid
> cases.

well i dont know, maybe they are, maybe they are not, asf is not a properly
documented container, only MS knows what is correct
the small amount of public docs are highly inaccuarte

we could attempt to set the start/end by interpolating based on the byte pos
and AVPacket->dts, AVPacket->dts+AVPacket->duration

a patch for that would be welcome if it works better ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071204/dcf0d3bf/attachment.pgp>



More information about the ffmpeg-devel mailing list