Opened 3 years ago

Last modified 3 years ago

#9410 reopened defect

Problem in vidstabtransform

Reported by: Michael Koch Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

It seems in the "vidstabtransform" filter the option "crop=black" doesn't work. Can be reproduced as follows:

rem Make a video with vertical jitter:
ffmpeg -f lavfi -i testsrc2=d=10 -lavfi sendcmd=f=cmd.txt,rgbashift=rv=0:gv=0:bv=0 -y shaky.mp4

The file cmd.txt contains these 3 lines:
0 [expr] rgbashift rv 'mod(3*N,10)';
0 [expr] rgbashift gv 'mod(3*N,10)';
0 [expr] rgbashift bv 'mod(3*N,10)';

rem Stabilize the video:
ffmpeg -i shaky.mp4 -lavfi vidstabdetect -y dummy.mp4
ffmpeg -i shaky.mp4 -lavfi vidstabtransform=crop=black:optzoom=0 -y out.mp4

I would expect sometimes to see black borders.
Either these areas are filled with other colors, or a zoom is active, which shouldn't be the case with optzoom=0.

Attachments (1)

ski.mkv (519.9 KB ) - added by arifd 3 years ago.

Download all attachments as: .zip

Change History (5)

by arifd, 3 years ago

Attachment: ski.mkv added

comment:1 by arifd, 3 years ago

Resolution: invalid
Status: newclosed

Hi Michael,

Whilst I cannot explain why we don't get a black border with your input video. If we stabilize the attached video with crop=black:optzoom=0, then we do get the results as expected. In fact, we get the same results as the source of the algorithm: http://public.hronopik.de/vid.stab/features.php?lang=en

Also, if you set optzoom=1 on your input video, then a zoom does occur.

As such, I think we can safely assume there isn't a bug here.

Regards,
Arif Driessen

comment:2 by Michael Koch, 3 years ago

Resolution: invalid
Status: closedreopened

In my opinion it's not the expected result. I would expect to see black borders, if "crop=black" is used. If this option isn't doing anything, then it can be removed.

comment:3 by Michael Koch, 3 years ago

I saw that with the ski.mkv there are indeed black borders visible after stabilizing. Why aren't the black borders visible with my test video?

comment:4 by Michael Koch, 3 years ago

With the ski.mkv video the no-data borders are also filled with the color of the border of the data area. That can be shown by drawing a red border around the frame, before applying vidstabtransform=crop=black. Black borders appear only when the shift is very large.

ffmpeg -i ski.mkv -lavfi vidstabdetect -y dummy.mp4
ffmpeg -i ski.mkv -lavfi drawbox=w=iw:h=ih:c=red,vidstabtransform=crop=black:optzoom=0 -y out.mp4

Note: See TracTickets for help on using tickets.