Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 10+bit transformations #123

Open
kdm9 opened this issue May 2, 2023 · 0 comments
Open

Support for 10+bit transformations #123

kdm9 opened this issue May 2, 2023 · 0 comments

Comments

@kdm9
Copy link

kdm9 commented May 2, 2023

Hello,

Thanks for vidstab, it's a super useful tool.

Is there any way to transform 10bit footage (e.g. yuv422p10le) without losing the dynamic range in the 10bit footage? I looked at the supported list of pixfmts in the vid.stab source (e.g. in https://github.com/georgmartius/vid.stab/blob/master/src/frameinfo.h#L32), and they all seem to be 8 bits per pixel per channel, and I see unsigned char *s are used to store pixel data in a few places in the code.

I therefore assume this would be a pretty big undertaking, but I'd like to request it anyway in case it's a reasonably straightforward change.

As a simpler case, would supporting only little endian types with full-byte depths (i.e. 8bit, 16bit eg yuv444p16le) be more feasible? IIUC, FFmpeg can trivially up-convert e.g. 10bit to 16bit, then scale back to 10bpp in an almost-lossless fashion, correct? So running a vidstabtransform filter in the middle of that filter pipeline should be possible, and would keep the implementation much simpler.

And I'd imagine that only the transform filter would absolutely need this support -- I'd guess that motion detection using footage down-sampled to 8-bit formats would work more or less identically to higher bit depths (modulo some very minor changes obviously). Is that intuition correct?

So in an ideal world it would look something like...

ffmpeg -i 10bit422.MP4 -vf 'format=yuv422p,vidstabdetect=...' -
ffmpeg -i 10bit422.MP4 -vf 'format=yuv444p16le,vidstabtransform=...,format=yuv422p10le' -c:v x265 ... stable10bit422.mkv

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant