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 film grain #253

Open
6ws opened this issue Jul 27, 2024 · 17 comments
Open

Support film grain #253

6ws opened this issue Jul 27, 2024 · 17 comments
Assignees
Milestone

Comments

@6ws
Copy link

6ws commented Jul 27, 2024

VVenC is now capable of producing bitstreams with FGC SEI messaging.

@nuomi2021
Copy link
Member

@6ws, could you provide a command line or clips for this?
@QSXW, could you help implement SEI functions? We can start with this and implement all SEIs similarly to HEVC.

@6ws
Copy link
Author

6ws commented Jul 27, 2024

When compiled from the master branch, it can be enabled via vvencapp by --fga, or when linked against FFmpeg, by -vvenc-params "FGA=1".

station2_1080p25_VVC_FGA.mp4

@QSXW
Copy link
Collaborator

QSXW commented Jul 27, 2024

@6ws, could you provide a command line or clips for this? @QSXW, could you help implement SEI functions? We can start with this and implement all SEIs similarly to HEVC.

Sure. I will help support this.

@QSXW
Copy link
Collaborator

QSXW commented Jul 27, 2024

When compiled from the master branch, it can be enabled via vvencapp by --fga, or when linked against FFmpeg, by -vvenc-params "FGA=1".

station2_1080p25_VVC_FGA.mp4

Hi. I cannot open the link. Can you help a check?

@6ws
Copy link
Author

6ws commented Jul 27, 2024

Try right clicking the link and "Save as". If that doesn't work, I uploaded the raw VVC stream instead.

station2_1080p25_VVC_FGA.266

@nuomi2021 nuomi2021 added this to the FFmpeg7.1 milestone Jul 29, 2024
@QSXW
Copy link
Collaborator

QSXW commented Jul 30, 2024

Hi @6ws. I've added the ability to decode film grain characteristic SEI NAL for VVC. The final thing is to verify if it works like HEVC. Do you also have a sample of the HEVC clip with film grain SEI?

@6ws
Copy link
Author

6ws commented Jul 31, 2024

Maybe @nuomi2021 has conformance clips? HEVC with FGC is new and I am unaware of a way to generate streams outside the reference encoder.

@nuomi2021
Copy link
Member

not sure too. maybe you can refer to av1, I guess AV1 has this feature too

@QSXW
Copy link
Collaborator

QSXW commented Aug 2, 2024

Hi, @nuomi2021. Where is the best location to apply the film grain filter, which should be used on the frame decoded? The hevc and h264 apply it when the frame end, but looks like we don't have a frame end.

@nuomi2021
Copy link
Member

in submit_frame before ff_vvc_frame_submit. is a good place.
I guess hw codec will add some code there just like hevc.

@QSXW
Copy link
Collaborator

QSXW commented Aug 5, 2024

in submit_frame before ff_vvc_frame_submit. is a good place. I guess hw codec will add some code there just like hevc.

Maybe not? It needs the frame that has been decoded. I tried and it doesn't work.

@QSXW
Copy link
Collaborator

QSXW commented Aug 6, 2024

Hi @6ws. I've added the support for film grain !257 here. Would you have a try and help review the changes?

@6ws
Copy link
Author

6ws commented Aug 8, 2024

@QSXW I am getting build errors. Can you rebase against upstream FFmpeg? Thanks.

@QSXW
Copy link
Collaborator

QSXW commented Aug 8, 2024

@6ws . Sure. Done!

@6ws
Copy link
Author

6ws commented Aug 9, 2024

[vvc @ 000001fb955b06c0] Unsupported film grain parameters. Ignoring film grain.
The film grain is still applied despite the warning. Unfortunately, the hashing of the decoded data does not match.

@QSXW
Copy link
Collaborator

QSXW commented Aug 10, 2024

Hi @6ws. I've added the breakpoint and tried to decode station2_1080p25_VVC_FGA.mp4 and the film grain by decoder doesn't seem to be applied. Can you check again?

Unfortunately, the hashing of the decoded data does not match.
Do you use the md5 to generate the hash? Is the hash generated after the film grain stage or before?

@nuomi2021
Copy link
Member

The film grain is still applied despite the warning. Unfortunately, the hashing of the decoded data does not match.

Film grain, much like a filter, is usually not defined in the spec. As a result, different implementations may produce varying outputs.

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

3 participants