[FFmpeg-devel] Changing media formats mid stream

Roger Pack rogerdpack2 at gmail.com
Mon Aug 8 22:09:20 EEST 2016


On 8/24/15, Michael Niedermayer <michael at niedermayer.cc> wrote:
> On Mon, Aug 24, 2015 at 10:55:07PM +0200, Máté Sebők wrote:
>> Oops, forgot to mention, in dshow_pin.c the libAVPin_QueryAccept() have
>> to
>> be edited to almost the same as libAVPin_ReceiveConnection() just without
>> the pin management.
>
> maybe roger or others can help, i dont have a windows box here nor
> do i really know dshow

For followers, we ended up working around this by sending a "raw
stream" (like URLProtocol) to FFmpeg, that way the stream itself
describes the video formats, and they never change.  The weird dshow
way of doing this is that you set up the graph 'as if" it were always
mpeg2video, then when you "start" the graph, it calls for a
renegotiation. Weird.


>>
>> On Mon, Aug 24, 2015 at 10:44 PM, Máté Sebők <smfinc.org at gmail.com>
>> wrote:
>>
>> > I did a dirty little hack to attempt to fix it.
>> > Don't call the dshow_add_device() just in build time, but run the graph
>> > and sleep() a bit, then call dshow_add_device() at the end of the
>> > dshow_read_header().
>> >
>> > Sadly, it does not work, it does not goes beyond the dshow "chit-chat"
>> > between filters/pins.
>> >
>> > After ctrl+c however the right codec stats are displayed...
>> >
>> > Regards,
>> > Máté
>> >
>> >
>> > On Mon, Aug 24, 2015 at 10:29 PM, Michael Niedermayer <
>> > michael at niedermayer.cc> wrote:
>> >
>> >> On Mon, Aug 24, 2015 at 02:09:28PM -0600, Roger Pack wrote:
>> >> > I've run into the case today where (if we understand it correctly)
>> >> > you
>> >> > setup a directshow graph, it advertises media types, then when you
>> >> > "start" the graph, it actually calls through and says "here's your
>> >> > *real* media type".
>> >> > Does ffmpeg internals have any concept of or support for a "changing
>> >> > media type" at runtime? (any other suggestions for how to handle
>> >> > this
>> >> > if it doesn't?)
>> >>
>> >> do i understand correctly that the type at read_header() stage is
>> >> wrong but the type later at read_packet() stage is correct ?
>> >> if that is the case, you can just wait with setting the type till it
>> >> is reliably known.
>> >>
>> >> [...]
>> >> --
>> >> Michael     GnuPG fingerprint:
>> >> 9FF2128B147EF6730BADF133611EC787040B0FAB
>> >>
>> >> I have never wished to cater to the crowd; for what I know they do not
>> >> approve, and what they approve I do not know. -- Epicurus
>> >>
>> >> _______________________________________________
>> >> ffmpeg-devel mailing list
>> >> ffmpeg-devel at ffmpeg.org
>> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> >>
>> >>
>> >
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
>


More information about the ffmpeg-devel mailing list