Open mviereck opened 4 years ago
Thanks for the bug report. There is surely something wrong here. I looks like it has something to do with the rotations and the different channels (color vs gray).
I found that I can avoid the bug if I split the video into .png images and generate a new video from the .png files:
ffmpeg -y -hide_banner -nostdin -i align.source.mp4 sourceimg%04d.png
ffmpeg -y -hide_banner -nostdin -f image2 -start_number 1 -i sourceimg%04d.png -safe 0 -vframes 1000 -vcodec libx264 -crf 25 -pix_fmt yuv420p align.source2.mp4
Using vidstab with align.source2.mp4
instead of align.source.mp4
does not show gray areas.
If I calculate rotation and distortion from global_motions.trf
and apply the values with imagemagick, the result is slightly different from vid.stab. The alignment seems to be slightly better with imagemagick.
I assume there is some imprecision in the distortion of vid.stab that also might cause the difference between image and grey area as described above.
Coming from #78 :
Stabilizing a video can lead to grey areas at the border of the frames. I've used this video generated from a series of captures: vidstab.greyborder.source.mp4.zip
This affects many frames, I'll show the last one as an example:![alignimg0060 tif](https://user-images.githubusercontent.com/14821372/66840230-03267500-ef68-11e9-822f-7e94c03430e3.png)
ffmpeg/vidstab commands I've used:
Extracting angle and offsets from![preview_0060 jpg](https://user-images.githubusercontent.com/14821372/66840340-323ce680-ef68-11e9-8b21-36df0ef35fc7.png)
global_motions.trf
and applying them withimagemagick
, I get this result:Comparing the two images shows:
imagemagick
.