[FFmpeg-devel] FFMPEG for V4L2 M2M devices ?

Andriy Gelman andriy.gelman at gmail.com
Mon Jul 12 18:07:21 EEST 2021


On Mon, 12. Jul 11:02, Dave Stevenson wrote:
> On Sat, 10 Jul 2021 at 00:56, Brad Hards <bradh at frogmouth.net> wrote:
> >
> > On Saturday, 10 July 2021 8:53:27 AM AEST Andrii wrote:
> > > I am working on porting a Kodi player to an NVidia Jetson Nano device. I've
> > > been developing a decoder for quite some time now, and realized that the
> > > best approach would be to have it inside of ffmpeg, instead of embedding
> > > the decoder into Kodi as it heavily relies on FFMPEG. Just wondering if
> > > there is any effort in making FFMPEG suppring M2M V4L devices ?
> >
> > https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/HEAD:/libavcodec/v4l2_m2m.c[1]
> >
> > I guess that would be the basis for further work as required to meet your needs.
> 
> Do note that there are 2 V4L2 M2M decoder APIs - the stateful API[1] ,
> and the stateless API [2]. They differ in the amount of bitstream
> parsing and buffer management that the driver implements vs expecting
> the client to do.
> 
> The *_v4l2m2m drivers within FFMPEG support the stateful API (ie the
> kernel driver has bitstream parsing). For Raspberry Pi we use that to
> support the (older) H264 implementation, and FFMPEG master does that
> very well.
> 
> The Pi HEVC decoder uses the V4L2 stateless API. Stateless HEVC
> support hasn't been merged to the mainline kernel as yet, so there are
> downstream patches to support that.

> 
> A quick Google implies that NVidia already has a stateful V4L2 M2M
> driver in their vendor kernel. Other than the strange choice of device
> node name (/dev/nvhost-nvdec), the details at [3] make it look like a
> normal V4L2 M2M decoder that has a good chance of working against
> h264_v4l2m2m.

Some time ago I tried to set up the Jetson nano to work with our v4l2m2m code, 
but there were just too many problems. It wasn't properly spec compliant.

For reference here's link to Nvidia's patch to support decoding on the nano in
ffmpeg:
http://ffmpeg.org/pipermail/ffmpeg-devel/2020-June/263746.html

-- 
Andriy


More information about the ffmpeg-devel mailing list