Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* video decoding on imx8mq vpu via v4l2
@ 2020-02-14 11:46 Martin Kepplinger
  2020-02-14 13:50 ` Philipp Zabel
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Kepplinger @ 2020-02-14 11:46 UTC (permalink / raw)
  To: ezequiel, mchehab, Shawn Guo, s.hauer, p.zabel; +Cc: linux-media

Hi,

I'd like to test decoding an mpeg2 or h264 video file on imx8mq, using
its vpu:

I use Philipp's changes for imx8m from
https://git.pengutronix.de/cgit/pza/linux/log/?h=hantro/imx8m-wip in my
tree:

https://source.puri.sm/martin.kepplinger/linux-next/commits/5.6-rc1/librem5__integration

and play around with gstreamer, taking notes at
https://source.puri.sm/Librem5/linux-next/issues/74

The driver probes fine and v4l2 appearently sees the MEM2MEM decoder:

$ v4l2-ctl --list-devices
nxp,imx8mq-vpu-dec (platform: hantro-vpu):
	/dev/video0


AFAIK gstreamer should provide a "v4l2videodec" element which it doesn't:

$ gst-inspect-1.0|grep -i v4l
video4linux2:  v4l2deviceprovider (GstDeviceProviderFactory)
video4linux2:  v4l2radio: Radio (video4linux2) Tuner
video4linux2:  v4l2sink: Video (video4linux2) Sink
video4linux2:  v4l2src: Video (video4linux2) Source


First: Philipp, do you plan to continue working on supporting hantro for
imx8m upstream?

Then: What codec would be appropriate to test decoding now? It seems
like h264 is supposed to be implemented. How do you test?

And finally: What could be missing here? I use debian's gstreamer
package, but in this case it can't really be a config/build issue in
gstreamer, right?

thanks,

                                martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: video decoding on imx8mq vpu via v4l2
  2020-02-14 11:46 video decoding on imx8mq vpu via v4l2 Martin Kepplinger
@ 2020-02-14 13:50 ` Philipp Zabel
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2020-02-14 13:50 UTC (permalink / raw)
  To: Martin Kepplinger, ezequiel, mchehab, Shawn Guo, s.hauer,
	Nicolas Dufresne
  Cc: linux-media

Hi Martin,

On Fri, 2020-02-14 at 12:46 +0100, Martin Kepplinger wrote:
> Hi,
> 
> I'd like to test decoding an mpeg2 or h264 video file on imx8mq, using
> its vpu:
> 
> I use Philipp's changes for imx8m from
> https://git.pengutronix.de/cgit/pza/linux/log/?h=hantro/imx8m-wip in my
> tree:
> 
> https://source.puri.sm/martin.kepplinger/linux-next/commits/5.6-rc1/librem5__integration
> 
> and play around with gstreamer, taking notes at
> https://source.puri.sm/Librem5/linux-next/issues/74
> 
> The driver probes fine and v4l2 appearently sees the MEM2MEM decoder:
> 
> $ v4l2-ctl --list-devices
> nxp,imx8mq-vpu-dec (platform: hantro-vpu):
> 	/dev/video0
> 
> 
> AFAIK gstreamer should provide a "v4l2videodec" element which it doesn't:

The GStreamer V4L2 decoder elements are only implemented for the
stateful codec API [1] so far.

[1] https://linuxtv.org/downloads/v4l-dvb-apis-new/uapi/v4l/dev-decoder.html

There are plans to add direct support for stateless codecs [2] to
GStreamer, but that will still be a bit of work as far as I understand.

[added Nicolas to Cc:]

[2] https://linuxtv.org/downloads/v4l-dvb-apis-new/uapi/v4l/dev-stateless-decoder.html

In the interim, I have plugged together a GStreamer VA-API stack based
on Bootlin's libva-v4l2-request backend. See below.

> $ gst-inspect-1.0|grep -i v4l
> video4linux2:  v4l2deviceprovider (GstDeviceProviderFactory)
> video4linux2:  v4l2radio: Radio (video4linux2) Tuner
> video4linux2:  v4l2sink: Video (video4linux2) Sink
> video4linux2:  v4l2src: Video (video4linux2) Source
> 
> First: Philipp, do you plan to continue working on supporting hantro for
> imx8m upstream?

Yes. We need to sort out the i.MX8MM power domain bindings / drivers,
and I have to test that the Hantro G1 kernel patches work on i.MX8MM as
well, to make sure we got the DT bindings right. I'll then resend the
series for both i.MX8MQ and i.MX8MM.

> Then: What codec would be appropriate to test decoding now? It seems
> like h264 is supposed to be implemented. How do you test?

There is a patched FFmpeg floating around that can drive the Hantro
driver. I'm using a patched libva-v4l2-request [3] / libva [4] /
GStreamer VA-API [5,6] stack to test.

[3] https://github.com/bootlin/libva-v4l2-request/pull/29
[4] https://github.com/intel/libva/pull/332
[5] https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/729
[6] https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/merge_requests/171

> And finally: What could be missing here? I use debian's gstreamer
> package, but in this case it can't really be a config/build issue in
> gstreamer, right?

None of this was merged in 1.16.2. The GStreamer VA-API changes depend
on API changes in libva, which currently add Hantro-specifics to a
generic API, and all this is based on a still unstable kernel API.

regards
Philipp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 11:46 video decoding on imx8mq vpu via v4l2 Martin Kepplinger
2020-02-14 13:50 ` Philipp Zabel

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git