[Ffmpeg-devel] [PATCH] AVISynth support

Michael Niedermayer michaelni
Fri Aug 18 09:57:40 CEST 2006


On Thu, Aug 17, 2006 at 11:22:03PM +0200, Steve Lhomme wrote:
> Michael Niedermayer wrote:
> >Hi
> >
> >On Thu, Aug 17, 2006 at 04:58:45PM +0200, Steve Lhomme wrote:
> >>Reimar D?ffinger wrote:
> >>>Hello,
> >>>On Thu, Aug 17, 2006 at 04:31:16PM +0200, Steve Lhomme wrote:
> >>>>I'm actually adding a small header in the raw virtual stream so that I 
> >>>>can add a probe to the demuxer. It's not that hard. But adding RIFF 
> >>>>headers is a lot more work. Especially since the virtual file is 
> >>>>usually much bigger than 4GB. I know it should be OpenDML but I don't 
> >>>>know how it's interleaved.
> >>>If you don't support seeking IIRC there is no point in using OpenDML, if
> >>>you want to support that I think that will be problematic anyway and
> >>>probably not possible while keeping the stream/demuxer split, since you
> >>>must give AVISynth the frame number you want but stream layer works with
> >>>byte position. Or am I missing something?
> >>Actually doing the header in the virtual stream is easy. But when I read 
> >>the packets I need to set the position at the right packet boundaries so 
> >>I have to access the virtual stream even more to do so... So I won't add 
> >>it in the end. It's an extra hack for no real life use.
> >>
> >>Yes, seeking is not only needed in the virtual stream (also called 
> >>protocol) but I don't think it would work otherwise with av_stream_info 
> >>and stuff like that. At first I just made a demuxer and no virtual 
> >>stream. It was working fine but url_ftell() was always wrong and that's 
> >>what we use in DrDivX to track progress in the encoding/analysis so I 
> >>added the virtual stream.
> >
> >hmm, implementing avisynth support purely in the demxuer without any
> >stream/protocol also sounds acceptable, do you still have that code?
> >the url_ftell() issue can maybe be solved by using AVPacket.pos or
> >using AVPacket.dts and AVstream.duration instead
> Here is a patch with the older version.
> Steve

[configure / Makefile part left to respective maintainers]


> +    avs->streams = av_malloc(info.dwStreams * sizeof(AVISynthStream));
> +    memset(avs->streams, 0, info.dwStreams * sizeof(AVISynthStream));



> +
> +    // little trick to make sure url_ftell doesn't report 0
> +    get_buffer(&s->pb, dummy, sizeof(dummy));

iam against such hacks


> +    stream = &avs->streams[avs->next_stream];
> +    avs->next_stream++;
> +    if (avs->next_stream == avs->nb_streams)
> +        avs->next_stream = 0;

avs->next_stream= (avs->next_stream+1) % avs->nb_streams;


except these minor issues, iam fine with the patch assuming it doesnt
break building on linux and mingw/cygwin
its also just half the size of the demuxer+stream avisync mess ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list