Monday, November 11, 2019

warping on Linux - initial ffmpeg trials without a final solution

I still use the tool made in 2014 to pre-warp fulldome planetarium shows for our planetarium's Blu-ray-player-based playout system. But that tool's main limitation seems to be that it works only on Windows XP. It does not seem to work even on Windows 7 - I tested with RS's laptop.

In the search for alternatives for future-proofing, I had a look at ffmpeg's Remap filter. If a suitable map is made, it should be possible to use this filter to do the warping in a platform independent way.
ffmpeg -i /path/input.mp4 -i front_kodak_sp360_1440_xmap.pgm -i front_kodak_sp360_1440_ymap.pgm -lavfi remap out.mp4

Preliminary test went at around 8 fps, 1 minute video took 4 minutes to encode.

out.mp4 was of a similar format to input file, but not exactly.

mediainfo out.mp4

Testing to see if opengl will be faster, tried with just re-encoding to divx,
ffmpeg -i /path/input.mp4 -c:v libxvid out.mp4
did the 1 minute video in 2 minutes, but quite low quality for the highly changing scenes. That would be 15 fps.

ffmpeg -i /path/input.mp4 -c:v libxvid -qscale:v 100 out.mp4
did not make much of a difference.


Some info about OpenGL filters with ffmpeg
Piping to screen works, albeit not in realtime, 0.25x perhaps.
ffmpeg -i /path/input.mp4 -i front_kodak_sp360_1440_xmap.pgm -i front_kodak_sp360_1440_ymap.pgm -lavfi remap -f matroska - | ffplay -

inspired by

Using rawvideo, (raw RGB is not supported in matroshka, so using NUT), went to 0.68x, but in black and white!
ffmpeg -i /path/input.mp4 -i front_kodak_sp360_1440_xmap.pgm -i front_kodak_sp360_1440_ymap.pgm -lavfi remap -c:v rawvideo -f NUT - | ffplay -

with AVI instead of NUT, colours are mismatched and not antialiased?!

Later, went to try avisynth instead. That is described in another post.




No comments:

Post a Comment