georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
842 stars 108 forks source link

How to use this filter with 2-pass encoding (ex: vp9)? #76

Open touste opened 5 years ago

touste commented 5 years ago

I would like to use this filter with 2-pass encoding with the VP9 encoder: ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M -pass 1 -an -f webm /dev/null ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 2M -pass 2 -c:a libopus output.webm

How am I supposed to use the filter in this case? Should I use vidstabdetect during the first pass and vidstabtransform during the second? However in this case the first pass of the vp9 encoder will run on the shaky video, though it should be run on the stabilized video really.

Should I do three passes then? First one for vidstabdetect, second one for vidstabtransform and -pass 1 of vp9 and third one for -pass 2 of vp9?

Thanks!

georgmartius commented 5 years ago

Ideally, three passes are correct in this case because I expect the stabilization can change the compression rate quite a bit. (Disclaimer: I don't know what the VP9 encoder is doing in its passes)

touste commented 5 years ago

Thanks, that makes sense!

On Mon, Jul 22, 2019 at 6:16 PM Georg Martius notifications@github.com wrote:

Ideally, three passes are correct in this case because I expect the stabilization can change the compression rate quite a bit. (Disclaimer: I don't know what the VP9 encoder is doing in its passes)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/georgmartius/vid.stab/issues/76?email_source=notifications&email_token=AAWLXEEPTNKLQ6PS2OOHJ6LQAXMMJA5CNFSM4IFZ6HMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2QMAAA#issuecomment-513851392, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWLXEDEOYD3W2FB43ELM5DQAXMMJANCNFSM4IFZ6HMA .