[FFmpeg-user] remap filter, unmapped pixels

Michael Koch astroelectronic at t-online.de
Thu Feb 20 14:56:49 EET 2020


Am 20.02.2020 um 13:47 schrieb Paul B Mahol:
> On 2/20/20, Michael Koch <astroelectronic at t-online.de> wrote:
>> Am 20.02.2020 um 12:49 schrieb Paul B Mahol:
>>> On 2/20/20, Michael Koch <astroelectronic at t-online.de> wrote:
>>>> Am 20.02.2020 um 11:07 schrieb Paul B Mahol:
>>>>> On 2/20/20, Michael Koch <astroelectronic at t-online.de> wrote:
>>>>>> I'd like to understand how the new "fill" option in the remap filter
>>>>>> works.
>>>>>> What is an "unmapped pixel"? How is it possible that pixels are
>>>>>> unmapped, if the xmap and ymap files have the same size as the output
>>>>>> image? Is a pixel "unmapped" if it has invalid coordinates (negative or
>>>>>> too big) in the xmap or ymap files?
>>>>> Previously all unmapped pixels were set to black for rgba or dark
>>>>> green for y420p.
>>>>> It is very obvious to understand even for every little kid in the block.
>>>> Finally I got it working. A pixel can be declared as "unmapped" by
>>>> setting the values to 65535 in the xmap and ymap files. However using a
>>>> negative value (for example -1) doesn't work. In this case the pixel is
>>>> mapped to the top left pixel of the input image.
>>>> This behaviour might be obvious for little kids, but not for me. Should
>>>> be added to documentation.
>>> Nope. Documentation does not need trivial information.
>>> Obviously by having even limited programming experience one would
>>> found out that remaps are unsigned short, thus can not be negative.
>> I that case I did make the PGM file with C# code and some coordinates
>> were set to -1. Obviously I shouldn't have done that because the PGM
>> specification doesn't allow negative values. But FFmpeg did not report
>> any errors when reading this file. May be a warning should be added if
>> negative values are found.
> Negative values can not be represented in PGM, they are cast to some
> other positive value depending on implementation.

You are right when you are talking about BINARY PGM (P5) files. But I 
did make an ASCII PGM (P2) file, because it's easier to make, and it can 
be checked with a text editor. FFmpeg can also read P2 files.

Michael



More information about the ffmpeg-user mailing list