[FFmpeg-devel] [PATCH] lavf/avienc: New AVOption write_keyframe_palette
Mats Peterson
matsp888 at yahoo.com
Tue Mar 8 14:06:30 CET 2016
On 03/08/2016 02:06 PM, Ronald S. Bultje wrote:
> Hi,
>
> On Tue, Mar 8, 2016 at 7:48 AM, Mats Peterson <
> matsp888-at-yahoo.com at ffmpeg.org> wrote:
>
>> On 03/08/2016 01:44 PM, Mats Peterson wrote:
>>
>>> On 03/08/2016 01:43 PM, Ronald S. Bultje wrote:
>>>
>>>> Hi Mats,
>>>>
>>>> On Mon, Mar 7, 2016 at 8:59 PM, Mats Peterson <
>>>> matsp888-at-yahoo.com at ffmpeg.org> wrote:
>>>>
>>>> On 03/07/2016 07:48 PM, Mats Peterson wrote:
>>>>>
>>>>> On 03/07/2016 07:43 PM, Mats Peterson wrote:
>>>>>>
>>>>>> Here's a somewhat experimental patch with a new AVOption
>>>>>>> write_keyframe_palette that allows you to write the palette to every
>>>>>>> keyframe. It is disabled by default, but it is needed for any file
>>>>>>> that
>>>>>>> contains palette changes.
>>>>>>>
>>>>>>>
>>>>>>> It is needed in order to switch palette properly when seeking, that
>>>>>> is.
>>>>>>
>>>>>>
>>>>>> It's interesting to note that Windows Media Player doesn't need xxpc
>>>>> chunks at keyframes in order to seek properly in the following original
>>>>> file from Sierra's King's Quest VI. I have of course no idea how they
>>>>> solve
>>>>> that.
>>>>>
>>>>> This original file doesn't work properly in FFplay for some reason. It
>>>>> generates "stream_ptr out of bounds" messages at the locations of the
>>>>> xxpc
>>>>> chunks.
>>>>>
>>>>> File:
>>>>> https://drive.google.com/open?id=0B3_pEBoLs0faaFY0ME92SDA1VEU
>>>>>
>>>>
>>>>
>>>> Please don't wrote so many messages in response to yourself.
>>>>
>>>> If you want, I can look at the file. My assumption is that it either
>>>> indexes or otherwise caches the xxpc chunks so it knows what the last
>>>> xxpc
>>>> before-or-on each keyframe seekpoint is. That should be trivial to do in
>>>> our demuxer also.
>>>>
>>>> Ronald
>>>> _______________________________________________
>>>>
>>>
>>> It would be nice if you could have a look at it, Ronald, when you have
>>> the time for it. Yes, I suppose the xxpc chunks might perhaps be
>>> indexed. In any case, it currently won't play correctly in FFplay. I'll
>>> try to limit my messages (I have said it before, but I'm fully aware of
>>> this problem).
>>>
>>> Mats
>>>
>>> _______________________________________________
>>>
>>
>> The xxpc chunks are indexed alright. I checked the index in the file. Why
>> FFplay will barf on it is another question.
>
>
> It's probably simply not aware that such index chunks are valid. Check
> libavformat/avidec.c and add relevant code to index parsing (on
> read_header) and index usage (on seek) there.
>
> Ronald
> _______________________________________________
That was my thought too. It would probably be sensible to index xxpc
chunks in the muxer as well. Thanks, anyway.
Mats
More information about the ffmpeg-devel
mailing list