vaapi-fits icon indicating copy to clipboard operation
vaapi-fits copied to clipboard

[ffmpeg-qsv] add string api support

Open FocusLuo opened this issue 9 months ago • 9 comments

add string api support for ffmpeg-qsv 1, enable on DG2 fistly 2, the patch comments will update later after some times reviews done

FocusLuo avatar May 14 '24 10:05 FocusLuo

ffmpeg-qsv cmdline: ./smoke run test/ffmpeg-qsv/encode --pl DG2 --context=sanity --device=/dev/dri/renderD129 -vv ./smoke run test/ffmpeg-qsv/encode --pl DG2 --context=sanity --device=/dev/dri/renderD129 --stringapi 0 -vv ./smoke run test/ffmpeg-qsv/encode --pl DG2 --context=sanity --device=/dev/dri/renderD129 --stringapi 1 -vv ./smoke run test/ffmpeg-qsv/encode --pl DG2 --context=sanity --device=/dev/dri/renderD129 --stringapi 2 -vv stringapi = 0 and others, will use traditional ffmpeg encode cmdline option stringapi = 1, will use string api ffmpeg encode cmdline option stringapi = 2, random to use traditional or string api ffmpeg encode cmdline option

FocusLuo avatar Jun 03 '24 07:06 FocusLuo

@mengker33 please help to review

Bin-CI avatar Jun 03 '24 08:06 Bin-CI

This is not a full review...

I'm not convinced we should modify the base qsv encoder. It seems we could introduce a new qsv string encoder class or something. Let me think about the design some more and we can discuss later...

Cool! thanks a lot Artie on supporting this. BTW, gst-vpl will also support stringAPI in Q3, so please also think about gst-vpl part.

FocusLuo avatar Jun 04 '24 05:06 FocusLuo

This is not a full review... I'm not convinced we should modify the base qsv encoder. It seems we could introduce a new qsv string encoder class or something. Let me think about the design some more and we can discuss later...

Cool! thanks a lot Artie on supporting this. BTW, gst-vpl will also support stringAPI in Q3, so please also think about gst-vpl part.

@FocusLuo please have a look at https://github.com/uartie/vaapi-fits/commit/714ea0621a74c1b946e118134a16c3741bf05001 It uses multi-inheritance techniques to "mixin" the string api encoder overrides. It isn't a complete solution, yet, so I figure you may be able to finish some of the details (e.g. additional property overrides, mappings, etc.). Note, at the end of the file is a quick example of usage. We may need to think about if we want to reuse existing user config spec variants or add a new variant. If we reuse, then we will essentially double the encode cases, which may not be desirable.

uartie avatar Jun 05 '24 17:06 uartie

This is not a full review... I'm not convinced we should modify the base qsv encoder. It seems we could introduce a new qsv string encoder class or something. Let me think about the design some more and we can discuss later...

Cool! thanks a lot Artie on supporting this. BTW, gst-vpl will also support stringAPI in Q3, so please also think about gst-vpl part.

@FocusLuo please have a look at uartie@714ea06 It uses multi-inheritance techniques to "mixin" the string api encoder overrides. It isn't a complete solution, yet, so I figure you may be able to finish some of the details (e.g. additional property overrides, mappings, etc.). Note, at the end of the file is a quick example of usage. We may need to think about if we want to reuse existing user config spec variants or add a new variant. If we reuse, then we will essentially double the encode cases, which may not be desirable.

Thanks Artie, by re-used the https://github.com/uartie/vaapi-fits/commit/714ea0621a74c1b946e118134a16c3741bf05001, re-submitted the patches, how do you think?

  1. only enabled the avc/hevc/av1 encode firstly
  2. there will be some failed cases on cbr and vbr, especailly for hevc and av1 encode, how to control the CI regression test report? do you have any idea?

FocusLuo avatar Jun 14 '24 07:06 FocusLuo

New test cases cmdlines: for avc/hevc/av1 encode ./smoke run test/ffmpeg-qsv/encode/hevc.py:cqp.test_strapi --pl ADL --context=sanity --device=/dev/dri/renderD128 -vv ./smoke run test/ffmpeg-qsv/encode/hevc.py:cqp_lp.test_strapi --pl DG2--context=sanity --device=/dev/dri/renderD129 -vv ./smoke run test/ffmpeg-qsv/encode/hevc.py:cbr.test_strapi --pl ADL --context=sanity --device=/dev/dri/renderD128 -vv ./smoke run test/ffmpeg-qsv/encode/hevc.py:cbr_lp.test_strapi --pl DG2--context=sanity --device=/dev/dri/renderD129 -vv ./smoke run test/ffmpeg-qsv/encode/hevc.py:vbr.test_strapi --pl ADL --context=sanity --device=/dev/dri/renderD128 -vv ./smoke run test/ffmpeg-qsv/encode/hevc.py:vbr_lp.test_strapi --pl DG2--context=sanity --device=/dev/dri/renderD129 -vv

FocusLuo avatar Jun 14 '24 07:06 FocusLuo

This is not a full review... I'm not convinced we should modify the base qsv encoder. It seems we could introduce a new qsv string encoder class or something. Let me think about the design some more and we can discuss later...

Cool! thanks a lot Artie on supporting this. BTW, gst-vpl will also support stringAPI in Q3, so please also think about gst-vpl part.

@FocusLuo please have a look at uartie@714ea06 It uses multi-inheritance techniques to "mixin" the string api encoder overrides. It isn't a complete solution, yet, so I figure you may be able to finish some of the details (e.g. additional property overrides, mappings, etc.). Note, at the end of the file is a quick example of usage. We may need to think about if we want to reuse existing user config spec variants or add a new variant. If we reuse, then we will essentially double the encode cases, which may not be desirable.

Thanks Artie, by re-used the uartie@714ea06, re-submitted the patches, how do you think?

  1. only enabled the avc/hevc/av1 encode firstly
  2. there will be some failed cases on cbr and vbr, especailly for hevc and av1 encode, how to control the CI regression test report? do you have any idea?

My patch wasn't a completed solution... please finish the TODO's and other details (missing some property definitions and mappings).

uartie avatar Jun 18 '24 18:06 uartie

@uartie do you think it is good to merge this PR firstly? then let me to submit another PR for your other comments such as

  1. move map_level/rate/profile to the enum class as lookup;
  2. to use new gen functions for string (there will have avc gen cqp/cbr/vbr, hevc gen functions, av1 gen functions and also have lp and non-lp), and definitely you will have other comments input in future. how do you think? this will help me decrease my local update/comment maintain effort, and also help wenqing to do some issue testing on finding issue among different platforms or integrate into CI issue firstly thanks Focus

FocusLuo avatar Jul 01 '24 02:07 FocusLuo

@uartie do you think it is good to merge this PR firstly? then let me to submit another PR for your other comments such as

  1. move map_level/rate/profile to the enum class as lookup;
  2. to use new gen functions for string (there will have avc gen cqp/cbr/vbr, hevc gen functions, av1 gen functions and also have lp and non-lp), and definitely you will have other comments input in future. how do you think? this will help me decrease my local update/comment maintain effort, and also help wenqing to do some issue testing on finding issue among different platforms or integrate into CI issue firstly thanks Focus

The issue I have is it automatically doubles the cases as mentioned in https://github.com/intel/vaapi-fits/pull/651#discussion_r1644879125. For full tests, it would add an additional 2-3 hours depending on platform.

uartie avatar Jul 10 '24 00:07 uartie

@uartie do you think it is good to merge this PR firstly? then let me to submit another PR for your other comments such as

  1. move map_level/rate/profile to the enum class as lookup;
  2. to use new gen functions for string (there will have avc gen cqp/cbr/vbr, hevc gen functions, av1 gen functions and also have lp and non-lp), and definitely you will have other comments input in future. how do you think? this will help me decrease my local update/comment maintain effort, and also help wenqing to do some issue testing on finding issue among different platforms or integrate into CI issue firstly thanks Focus

The issue I have is it automatically doubles the cases as mentioned in #651 (comment). For full tests, it would add an additional 2-3 hours depending on platform.

Ok, will submit new patch to use dedicated gen functions for string api, thanks

FocusLuo avatar Jul 11 '24 14:07 FocusLuo

@uartie is the latest new update version good to you?

FocusLuo avatar Aug 13 '24 05:08 FocusLuo

The end result looks good to me.

However, please squash your commits into a few logically organized commits, as appropriate. There should not be any intermediate commits that only address the reviews. Those changes should be applied to the originals.

thanks Artie, updated

FocusLuo avatar Aug 22 '24 02:08 FocusLuo