From: Jonas Karlman <jonas@kwiboo.se>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
mchehab@kernel.org, ezequiel@vanguardiasur.com.ar
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rockchip@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH v4 0/2] Enumerate all pixels formats
Date: Fri, 19 Jul 2024 23:59:16 +0200 [thread overview]
Message-ID: <d060ec49-9d48-44a3-8f90-5cee5fe29b75@kwiboo.se> (raw)
In-Reply-To: <dc423e4144e1c9ea32f6adbaa8319e38f1443896.camel@ndufresne.ca>
Hi,
On 2024-07-19 17:36, Nicolas Dufresne wrote:
> Hi,
>
> Le vendredi 19 juillet 2024 à 15:47 +0200, Benjamin Gaignard a écrit :
>>> What exactly is the problem you want to solve? A real-life problem, not a theoretical
>>> one :-)
>>
>> On real-life: on a board with 2 different stateless decoders being able to detect the
>> one which can decode 10 bits bitstreams without testing all codec-dependent controls.
>
> That leans toward giving an answer for the selected bitstream format though,
> since the same driver may do 10bit HEVC without 10bit AV1.
>
> For the use case, both Chromium and GStreamer have a need to categorized
> decoders so that we avoid trying to use decoder that can't do that task. More
> platforms are getting multiple decoders, and we also need to take into account
> the available software decoders.
>
> Just looking at the codec specific profile is insufficient since we need two
> conditions to be met.
>
> 1. The driver must support 10bit for the specific CODEC (for most codec this is
> profile visible)
> 2. The produced 10bit color format must be supported by userspace
>
> In today's implementation, in order to test this, we'd need to simulate a 10bit
> header control, so that when enumerating the formats we get a list of 10bit
> (optionally 8bit too, since some decoder can downscale colors) and finally
> verify that these pixel formats are know by userspace. This is not impossible,
> but very tedious, this proposal we to try and make this easier.
I have also been wondering what the use-case of this would be, and if it
is something to consider before a FFmpeg v4l2-request hwaccel submission.
I am guessing GStreamer may need to decide what decoder to use prior to
bitstream parsing/decoding has started?
For my re-worked FFmpeg v4l2-request hwaccel series, should hit
ffmpeg-devel list any day now, we try to probe each video device one
by one trying to identify if it will be capable to decode current stream
into a known/supported capture format [1], this typically happen when
header for first slice/frame has been parsed and is used to let driver
select its preferred/optimal capture format. The first device where all
test passes will be used and if none works FFmpeg video players will
typically fallback to use software decoding.
This type of probing may be a little bit limiting and depend too heavy
on the M2M Stateless Video Decoder Interface "It is suggested that the
driver chooses the preferred/optimal format for the current
configuration.".
Would you suggest I change how this probing is happening to make some
more clever detection of what media+video device should be used for a
specific stream with help of this new flag?
[1] https://github.com/Kwiboo/FFmpeg/blob/v4l2request-2024-v2/libavcodec/v4l2_request_probe.c#L373-L424
Regards,
Jonas
>
> Nicolas
>
>
next prev parent reply other threads:[~2024-07-19 22:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 13:14 Benjamin Gaignard
2024-07-17 13:14 ` [PATCH v4 1/2] media: videodev2: Add flags to unconditionnaly enumerate " Benjamin Gaignard
2024-07-17 13:20 ` Jacopo Mondi
2024-07-17 13:44 ` Benjamin Gaignard
2024-07-17 14:04 ` Jacopo Mondi
2024-07-17 17:50 ` Nicolas Dufresne
2024-07-18 7:04 ` Benjamin Gaignard
2024-07-18 13:56 ` Nicolas Dufresne
2024-07-18 14:02 ` Nicolas Dufresne
2024-07-18 14:43 ` Benjamin Gaignard
2024-07-18 16:46 ` Nicolas Dufresne
2024-07-17 14:42 ` Sebastian Fricke
2024-07-18 14:59 ` Hans Verkuil
2024-07-19 13:15 ` Hans Verkuil
2024-07-20 8:40 ` Hans Verkuil
2024-07-17 13:14 ` [PATCH v4 2/2] media: verisilicon: Use V4L2_FMT_FLAG_ENUM_ALL_FORMATS flag Benjamin Gaignard
2024-07-19 12:57 ` [PATCH v4 0/2] Enumerate all pixels formats Hans Verkuil
2024-07-19 13:15 ` Benjamin Gaignard
2024-07-19 13:37 ` Hans Verkuil
2024-07-19 13:47 ` Benjamin Gaignard
2024-07-19 15:36 ` Nicolas Dufresne
2024-07-19 21:59 ` Jonas Karlman [this message]
2024-07-23 19:23 ` Nicolas Dufresne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d060ec49-9d48-44a3-8f90-5cee5fe29b75@kwiboo.se \
--to=jonas@kwiboo.se \
--cc=benjamin.gaignard@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®