[EXT] Re: v4l2 video encoder
Bing Song
bing.song at nxp.com
Thu Feb 25 02:55:25 UTC 2021
Can you share patch to me to test it on our platform.
Regards,
Bing
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of Nicolas Dufresne
Sent: 2021年2月24日 21:02
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: [EXT] Re: v4l2 video encoder
Caution: EXT Email
Le mer. 24 févr. 2021 04 h 45, Bing Song <bing.song at nxp.com<mailto:bing.song at nxp.com>> a écrit :
Hi,
Gst-transcoding will use v4l2videodec and v4l2videoenc. The default of v4l2videoenc input is MMAP mode. It cause video frame copy in v4l2videoenc input. How to avoid the video frame buffer copy?
This needs to be fixed inside v4l2videoenc class. Currently the import is not using the new try_import calls, so it is unsafe as it does not communicate padding and strides to the driver. I have a partial solution to this that I made last week, I need to cleanup and make an MR.
Now, it's partial as it only validate the very first buffer, it should keep validating in case something changes.
The next Todo before actually making it try to import by default is to figure out how we will handle copy fallback. We could reset the encoder and reallocate, but this method would not be reversible, and would produce a spurious keyframe (meaning the gops might not always be as requested). We need to decide if that would be good enough, in real app, we do hope we will not have to fallback. The alternative would be to have scratch buffers on the side as backup buffers, but the would use a big chunk of memory.
Meanwhile, one can always track the encoder being added to the pipeline (deep-element-added signal, or state transition message) and set the output-io-mode to dmabuf-import mode, and hope that buffers are properly aligned.
Regards,
Bing
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fgstreamer-devel&data=04%7C01%7Cbing.song%40nxp.com%7C0b317c186722435d0f5d08d8d8c46db1%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637497685462573907%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7Sb4ojwM9UAVZOoUnUt8S0zREatlSw%2F80%2Fnx0cLi%2FfQ%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210225/f228cadc/attachment-0001.htm>
More information about the gstreamer-devel
mailing list