On Tue, Mar 04, 2008 at 01:53:10AM +0100, Xawotihs wrote:
> Hello ffmpeg gurus,
> 
> I've written a directshow splitter somehow working based on
> libavformat, now I've decided to write a muxer.
> 
> So, Directshow gives me some compressed "mediasamples" with a
> timestart and timestop in what they call REFERENCE_TIME (1/10000000
> second since the beginning of the stream).
> Now, I've got that and I need to fill libavformat AVStream structures
> and also the AVPacket structure for each mediasample. So, because I'm
> lazy I thought I would just hardcode the AVStream.time_base for all my
> streams to 1/10000000 and just use the real duration of my packets
> (timestop-timestart) for each packet as the AVPacket.duration ... big
> mistake :)
> 
> Actually it works for audio on the small wav file I produced, but for
> video, my windows explorer freezes completly each time I open the
> directory containing my produced .avi file ... When I open the
> produced file in virtualdub, it tells me my files uses a framerate of
> 10000000 fps and contains 99.1% overhead =)
> 
> So, I looked at the code a bit and I noticed AVStream.duration is not
> used at all in the AVI muxer, it's barelly used in the MOV muxer, and
> kinda used in the MKV muxer...
> Am I doomed to guess a constant framerate from my video stream and set
> that as AVStream.time_base ? 

AVStream.time_base is not supposed to be written to by the user. You can
set AVCodecContext.time_base.
AVI has some overhead problems with large timebases, but the fact that
MS can generate avis shows the API must provide a frame rate.


> What about variable framerate ?

That is variable frame rate. You are confused. The rate of frames per second
can change, the timebase in which they are specified can not.


> is that
> seriously supported ?

Yes


> cause it seems OK in the MKV muxer but not realy
> in the MOV muxer and not at all in the AVI muxer ...

You are changing internal variables which you shouldnt touch, its to be
expected that random things would fail ...

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus

Attachment: signature.asc
Description: Digital signature

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to