FFmpeg icon indicating copy to clipboard operation
FFmpeg copied to clipboard

Support SEI - Mainly for Film Grain and Field Frame

Open QSXW opened this issue 1 year ago • 6 comments

use -vf tinterlace filter to generate the same yuv as VTM passed files: FIELD_A_Panasonic_4.bit FIELD_B_Panasonic_2.bit

VVCSoftware_VTM image

FFmpeg image

QSXW avatar Aug 06 '24 18:08 QSXW

Should we also move to verify picture hash to ff_h274_verify_decoded_picture_hash like ff_h274_apply_film_grain?

QSXW avatar Aug 27 '24 20:08 QSXW

Should we also move to verify picture hash to ff_h274_verify_decoded_picture_hash like ff_h274_apply_film_grain?

Yes, if a function is needed by all H.274 users, we should move it to h274.c

nuomi2021 avatar Aug 31 '24 13:08 nuomi2021

[https://res.cdn.office.net/assets/mail/file-icon/png/generic_16x16.png]LoveLetter_full.bithttps://1drv.ms/u/c/cc630cd99d392325/EZEwIWnCSQlBpdfPHtzhh2YBFTEOG6ITKfklSdbDnusBuw Hi Nuomi,

I've rebase the film grain and field frame features to the latest. Please use the following commands to test the filmgrain.

Apply Filmgrain ./ffmpeg -i LoveLetter_full.bit -y q 0 LoveLetter_film_grain.mp4

Export film grain to the frame side data ./ffmpeg -export_side_data +film_grain -i LoveLetter_full.bit -y q 0 LoveLetter_film_grain.mp4

To enable decoded picture hash, please add -err_detect +crccheck to the command line that used to test the VTM clips.

Thanks, Jianhua


发件人: Nuo Mi @.> 发送时间: 2024年12月21日 1:44 收件人: ffvvc/FFmpeg @.> 抄送: Wu Jianhua @.>; Mention @.> 主题: Re: [ffvvc/FFmpeg] Support SEI - Mainly for Film Grain and Field Frame (PR #257)

@nuomi2021 commented on this pull request.


In libavcodec/vvc/dec.chttps://github.com/ffvvc/FFmpeg/pull/257#discussion_r1894593299:

  •            i, checksum, fc->sei.picture_hash.checksum[i]);
    
  •        return AVERROR_INVALIDDATA;
    
  •    }
    
  • }
  • return 0; +}

+static int frame_end(VVCContext *s, VVCFrameContext *fc) +{

  • const AVFilmGrainParams *fgp;
  • int ret = 0;
  • if (fc->ref->needs_fg) {
  •    av_assert0(fc->ref->frame_grain->buf[0]);
    
  •    fgp = av_film_grain_params_select(fc->ref->frame);
    

@QSXWhttps://github.com/QSXW Let us work together to make this upstream in the following weeks. As the first step, could you help rebase it to the latest?

― Reply to this email directly, view it on GitHubhttps://github.com/ffvvc/FFmpeg/pull/257#discussion_r1894593299, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALH4Y36E6G3A7RXKLFGVN2T2GU2BHAVCNFSM6AAAAABMC34XQKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMJYGYYTSNBRGA. You are receiving this because you were mentioned.Message ID: @.***>

QSXW avatar Dec 23 '24 18:12 QSXW

thank you for the update. will check this weekend.

nuomi2021 avatar Mar 03 '25 13:03 nuomi2021

For buffer period sei. LoveLetter_FullSei.zip

QSXW avatar Mar 19 '25 13:03 QSXW

For buffer period sei. LoveLetter_FullSei.zip

Thank you for the clip. In the clip, the sh_picture_header_in_slice_header_flag is set to true, which means the PH header appears later than the prefix SEI. A better approach would be to skip the BP, BT, and DT parsers in CBS and let the decoder handle these. This way, the decoder will have access to all the necessary information.

nuomi2021 avatar Mar 19 '25 13:03 nuomi2021

merged as https://github.com/FFmpeg/FFmpeg/commit/a02e880e35926c37797c87a215a745245570f369, thank you Jianhua

nuomi2021 avatar May 31 '25 12:05 nuomi2021