[FFmpeg-user] remap filter gives only black and white output

Michael Koch astroelectronic at t-online.de
Wed Nov 22 10:54:58 EET 2017


 > That should not be necessary, assuming you are not on aixor sparc64. 
Is something wrong with the Zeranoe builds?

The latest version from Zeranoe (downloaded today) has the same problem, black and white output if used without the format filter.

F:\xxx\xxx>c:/ffmpeg/ffmpeg -i in.mp4 -i xmap_1000.pgm
  -i ymap_1000.pgm -lavfi "remap" -c:v mpeg4 -q:v 2 -y out.mp4
ffmpeg version N-89127-g8f4702a93f Copyright (c) 2000-2017 the FFmpeg developers


I've uploaded the map files again, and also two smaller versions:

http://www.astro-electronic.de/xmap_1000.pgm
http://www.astro-electronic.de/ymap_1000.pgm
http://www.astro-electronic.de/xmap_500.pgm
http://www.astro-electronic.de/ymap_500.pgm


Here is my C# source code for making these files:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace ffmpeg_remap
{
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }

         private void button1_Click(object sender, EventArgs e)
         {
             button1.BackColor = Color.Red;
             button1.Refresh();
             int a = (int)numericUpDown1.Value;   // get the size of the quadratic map
             int b = a/2;
             double xx, yy;

             TextWriter xmap = File.CreateText("xmap_" + a.ToString() + ".pgm");
             xmap.Write("P2\n");
             xmap.Write("# Xmap file for fulldome remap \n");
             xmap.Write(a.ToString() + " " + a.ToString() + " \n");
             xmap.Write("65535\n");

             TextWriter ymap = File.CreateText("ymap_" + a.ToString() + ".pgm");
             ymap.Write("P2\n");
             ymap.Write("# Ymap file for fulldome remap \n");
             ymap.Write(a.ToString() + " " + a.ToString() + " \n");
             ymap.Write("65535\n");

             for (int y = 0; y < a; y++)
             {
                 for (int x = 0; x < a; x++)
                 {
                     if(y > 4*b)    // 4*b means the formulas are never used, the result will be "identity" map
                     {
                         xx = b + b * Math.Atan((double)(x - b) / (double)(y - b));
                         yy = (double)b + Math.Sqrt((x - b) * (x - b) + (y - b) * (y - b));
                         if (xx < 0) xx = 0;
                         if (yy < 0) yy = 0;
                         if (xx > a - 1) xx = a - 1;
                         if (yy > a - 1) yy = a - 1;
                     }
                     else
                     {
                         xx = x;
                         yy = y;
                     }
                     xmap.Write((int)xx + " ");
                     ymap.Write((int)yy + " ");
                 }
                 xmap.Write("\n");
                 ymap.Write("\n");
             }
             xmap.Write("\n");
             ymap.Write("\n");
             xmap.Close();
             ymap.Close();
             button1.BackColor = Color.Green;
         }
     }
}


  




More information about the ffmpeg-user mailing list