[01:21] *** Whoopie_ has joined #linux-media [01:26] *** Whoopie has quit IRC (Ping timeout: 480 seconds) [01:26] *** Whoopie_ is now known as Whoopie [01:49] *** camus has joined #linux-media [01:49] *** camus1 has quit IRC (Remote host closed the connection) [02:05] *** camus1 has joined #linux-media [02:10] *** camus has quit IRC (Ping timeout: 480 seconds) [03:00] *** camus has joined #linux-media [03:05] *** camus1 has quit IRC (Ping timeout: 480 seconds) [04:17] *** pratyush has joined #linux-media [05:26] *** jm_h has joined #linux-media [05:30] *** NiksDev has quit IRC (Remote host closed the connection) [05:30] *** NiksDev has joined #linux-media [05:39] *** NiksDev has quit IRC (Remote host closed the connection) [05:40] *** NiksDev has joined #linux-media [05:40] *** miqztee has joined #linux-media [05:40] *** miqztee has quit IRC () [05:42] *** miqztee has joined #linux-media [06:11] *** Whoopie_ has joined #linux-media [06:16] *** Whoopie has quit IRC (Ping timeout: 480 seconds) [06:16] *** Whoopie_ is now known as Whoopie [07:01] *** camus1 has joined #linux-media [07:07] *** camus has quit IRC (Ping timeout: 480 seconds) [07:32] *** ao2 has joined #linux-media [07:41] *** camus has joined #linux-media [07:43] *** svarbanov has joined #linux-media [07:44] *** camus1 has quit IRC (Ping timeout: 480 seconds) [07:56] *** NiksDev has quit IRC (Ping timeout: 480 seconds) [08:58] *** miqztee has quit IRC (Quit: Leaving) [08:59] <neg> hverkuil: Should I try to bother you or Greg with picking up this staging driver https://patchwork.linuxtv.org/project/linux-media/patch/20210614170606.1619868-1-niklas.soderlund+renesas@ragnatech.se/ ? :-) [09:01] <hverkuil> sailus: that's more your domain, I think. ^^^^ [09:01] <hverkuil> sailus: I can take it as well, if you are OK with that. [09:03] <neg> thanks, I now know it should go thru the media tree :-) [09:04] <pinchartl> I think all drivers/staging/media/ patches go through the media tree [09:09] *** camus1 has joined #linux-media [09:09] *** djrscally has joined #linux-media [09:12] <hverkuil> neg: yes, drivers/staging/media goes through us. [09:14] <neg> pinchartl: hverkuil: I suspected as much, thanks for confirming. [09:14] *** camus has quit IRC (Ping timeout: 480 seconds) [09:17] *** roxlu has joined #linux-media [09:17] <roxlu> hi! [09:18] <roxlu> I'm looking into h264 encoding using hardware acceleration via the v4l2 api. Atm I'm gathering some information about the possibilities, but I was wondering if someone maybe knows a good article/doc which details the encoding features of v4l2? [09:19] <hverkuil> roxlu: https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/dev-mem2mem.html [09:19] <hverkuil> Currently only the API for stateful encoders is defined. There are no stateless encoders at the moment. [09:20] <roxlu> Thanks hans! Do you maybe also know if there is a v4l2-ctl command that I can use if my system has support for hw-encoding? [09:20] <roxlu> hverkuil: ok thanks, I read some about the differences between statefull/stateless and it seems that stateless is the preferred solution but I'm wondering why? Is this because of memory usage? [09:26] <hverkuil> It just depends on the hardware, there is stateful hardware and stateless hardware. With a stateful encoder you just pass in the raw frames and out comes the compressed stream, all the state is stored inside the hardware/firmware. For stateless encoders the hardware/firmware doesn't keep track of the state of the encoder, you need to pass that to the hardware together with the raw frames. [09:27] <hverkuil> But we do not have enough experience with such encoders, which is why there is no stateless encoder API defined yet. [09:27] <hverkuil> I think some people are/have been/will be working on this, but decoder support is prioritized at the moment. [09:30] <roxlu> I see, thanks! it's great that you/people are working on this. [09:30] <roxlu> I've implemented omx a while ago (on RPI) which wasn't much fun... and not really reusable [09:31] <hverkuil> ezequielg and/or ndufresne probably know more about stateless encoders. [09:32] <hverkuil> Stateful encoders are fully supported, though. Not sure which type your hardware has. [09:32] <roxlu> ok thanks, so first I have to figure out if the encoder is stateless/statefull ? [09:32] <roxlu> it's a bcm2835-codec-decode (from `v4l2-ctl --list-devices`) [09:32] <roxlu> i think it's statefull [09:33] *** fleebs has quit IRC (Quit: fleebs) [09:42] <roxlu> is there somewhere an example encoder? [09:46] <hverkuil> coda driver, allegro-dvt, mtk-vcodec. Possibly more. [09:51] <roxlu> oh sorry I meant like a .c example implementation that shows how to write the code to make use of the encoder api [09:54] *** fleebs has joined #linux-media [09:58] *** jmondi has quit IRC (Ping timeout: 480 seconds) [09:58] <hverkuil> roxlu: v4l2-ctl supports it, but it is not the easiest code to read. gstreamer also supports encoders AFAIK. But basically you just pass raw frames to the m2m device and get back the compressed stream. [10:00] <roxlu> Ok, going to read up and do some experiments. [10:19] *** NiksDev has joined #linux-media [10:29] *** jmondi has joined #linux-media [10:58] *** sailus has quit IRC (Ping timeout: 480 seconds) [11:01] *** sailus has joined #linux-media [11:23] *** camus1 has quit IRC (Ping timeout: 480 seconds) [11:52] <neg> mchehab: Is the workflow of how and when patches graduate from media_stage to media_tree and/or media_next ? [11:53] <neg> s/ ?/ documented somewhere ?/ [11:53] *** camus has joined #linux-media [11:59] <roxlu> I'm making myself a bit more comfortable with v4l2/linux and just read up on `ioctl`. Is it correct that all commands/requests you pass into `ioctl(fd, request, ..)` are created using the _IOR, _IOW and _IORW macros? And if so does that mean that e.g. `V4L2_CID_MPEG_VIDEO_H264_PROFILE` is created like this too? [12:00] <pinchartl> roxlu: V4L2_CID_MPEG_VIDEO_H264_PROFILE isn't an ioctl, it's a V4L2 control [12:01] <pinchartl> used with the VIDIOC_[GS]_CTRL or VIDIOC_[GS]_EXT_CTRLS ioctls [12:01] <roxlu> ok sry, I knew I was going to ask some stupid questions :# [12:01] <roxlu> Ah, thanks! [12:02] <roxlu> So when reading this page: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-codec.html how do I figure out how to use those? For example let's say I want to know what h264 profile a device is using currently [12:04] <roxlu> Ah, so I use them with https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/vidioc-g-ctrl.html [12:39] *** BrianG61UK has quit IRC (Read error: Connection reset by peer) [13:00] <roxlu> Why does `struct v4l2_fmtdesc` has a member `pixelformat` and `struct v4l2_frmsizeenum` a member called `pixel_format`? Maybe there is a good reason? [13:03] <pinchartl> it's called "history" I think [13:03] <pinchartl> if you're looking for incoherencies in the API, you'll have a full time job until the end of the year ;-) [13:04] <roxlu> lol no, I was just curious to get a better understanding. but "history" makes sense [13:04] <roxlu> what's the preferred syntax nowadays? pixel_format? [13:05] <pinchartl> I'm not sure there's an official preference [13:05] <roxlu> ah ok [13:06] <roxlu> I'm taking small steps and I'm querying some things of the encoder [13:06] <roxlu> I wanted to get the framesizes that are supported [13:07] <roxlu> I've used the VIDIOC_ENUM_FRAMESIZES which wants a pixelformat [13:08] <pinchartl> (which should have been named VIDIOC_ENUM_FRAME_SIZES I suppose :-)) [13:08] <roxlu> so I queried the supported pixel formats, but I had to use `V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE` [13:08] <roxlu> oh hehe [13:08] <roxlu> but first I tried just the `_OUTPUT` [13:10] <roxlu> is that the standard format you use to query encoder output types? [13:11] *** camus1 has joined #linux-media [13:12] <pinchartl> it depends what the device support, you can use VIDIOC_QUERYCAP to check if it uses the MPLANE API or the older API [13:13] *** camus has quit IRC (Remote host closed the connection) [13:15] <roxlu> ok thanks, going to read up on those [13:23] *** camus1 has quit IRC () [13:31] *** camus has joined #linux-media [13:32] *** camus has quit IRC (Remote host closed the connection) [13:50] <roxlu> ok did a bit more reading and this page https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/dev-encoder.html?highlight=encoding is starting to make sense [13:51] <roxlu> what I was having a bit of trouble understanding is that you have the set e.g. a H264 type (that you want to produce) for CAPTURE and the image format e.g. YUV for OUTPUT. (maybe I'm using the wrong terminology here) [13:52] <roxlu> to me (as a newb) I want to "output" H264 and use (aka "capture") YUV . [13:54] <pinchartl> capture refers (historically) to capturing frames from the device, while output refers to TV output. when encoding, you output YUV (from system to encoder) and capture H.264 (from encoder to system) [13:54] <pinchartl> those terms are also historical, and are one of the biggest source of confusion in V4L2 [13:55] <roxlu> ah with that explanation it makes sense, thanks [14:17] <ezequielg> roxlu: you should ask the libreelec people, they have some slack channel. the rpi people can be found over there. [14:18] <ezequielg> hverkuil: if you have room for fixes next week https://patchwork.linuxtv.org/project/linux-media/patch/20210805190416.332563-1-jernej.skrabec@gmail.com/ [14:18] <ezequielg> it's a oneliner :) [14:22] <roxlu> thanks ezequielg [14:25] <hverkuil> ezequielg: delegated to me. [14:26] *** gouchi has joined #linux-media [14:30] <roxlu> I just found this implementation: https://github.com/raspberrypi/libcamera-apps/blob/main/encoder/h264_encoder.cpp [14:31] <roxlu> that one looks pretty clean to me. I only have to read up a bit on how to manage the buffers correctly [14:31] <roxlu> one thing which I'm not entirely sure of is how read back the encoded data; that link uses poll() with a timeout, but that doesn't seem optimal [14:33] <roxlu> oh nice it seems like RPI coorp released those examples very recently [14:35] <pinchartl> roxlu: I have no experience with their video encoder, but if you want to use the camera on the RPi, you're welcome in the #libcamera IRC channel :-) [14:37] <roxlu> thanks! I'll join, great to hang out in channels about these interesting topics [15:06] *** xroumegue has joined #linux-media [15:26] *** BrianG61UK has joined #linux-media [16:28] *** camus has joined #linux-media [16:57] *** sailus has quit IRC (Remote host closed the connection) [16:58] *** sailus has joined #linux-media [18:12] *** gouchi has quit IRC (Remote host closed the connection) [19:40] *** NiksDev has quit IRC (Ping timeout: 480 seconds) [19:42] *** camus has quit IRC () [21:02] *** ao2 has quit IRC (Quit: Leaving) [21:12] *** svarbanov has quit IRC (Ping timeout: 480 seconds) [21:21] *** gouchi has joined #linux-media [21:22] *** gouchi has quit IRC (Remote host closed the connection) [21:24] *** gouchi has joined #linux-media [21:52] *** jm_h has quit IRC (Quit: Leaving) [22:53] *** gouchi has quit IRC (Remote host closed the connection) [23:15] *** djrscally has quit IRC (Ping timeout: 480 seconds)