# Can deepsteram5.0 encode the selected frames into files?

**URL:** <https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136>\
**Category:** DeepStream SDK\
**Created:** [August 17, 2020, 7:22am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136 "2020-08-17T07:22:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![horacehxw](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@horacehxw](https://forums.developer.nvidia.com/u/horacehxw)\
**Post date:** [August 17, 2020, 7:22am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/1 "2020-08-17T07:22:13Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)** Tesla T4  
**• DeepStream Version** 5.0  
**• JetPack Version (valid for Jetson only)** No  
**• TensorRT Version** save as deepstream:5.0-dp-20.04-devel  
**• NVIDIA GPU Driver Version (valid for GPU only)** 10.2

I want to encode the decoded video frames in the buffer into jpeg format, and save it into files. I found that “deepstream\_image\_meta\_test” sample application supports save corped objects into image files. Can Nvidia provide some api to encode the whole frame or open source the “nvds\_obj\_enc\_process” implementation so that I can do it myself?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [August 17, 2020, 7:48am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/3 "2020-08-17T07:48:39Z")

</div>

The nvds\_obj\_enc\_process API can also be used to encode the whole frame, just set your own object meta as the whole picture then the whole picture will be encoded to picture.

[https://docs.nvidia.com/metropolis/deepstream/dev-guide/DeepStream\_Development\_Guide/baggage/group\_\_ee\_\_object\_\_encoder.html](https://docs.nvidia.com/metropolis/deepstream/dev-guide/DeepStream_Development_Guide/baggage/group __ee__ object__encoder.html)

---

<div class="post-metadata">

**Author:** ![horacehxw](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@horacehxw](https://forums.developer.nvidia.com/u/horacehxw)\
**Post date:** [August 18, 2020, 4:42am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/4 "2020-08-18T04:42:00Z")

</div>

Could you please offer me a simple demo of this? I am stucked here…

Do I need to acquire an object\_meta from pool, set it’s class id, rect\_params, and then add it to frame\_meta before calling "nvds\_obj\_enc\_process " API?

---

<div class="post-metadata">

**Author:** ![horacehxw](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@horacehxw](https://forums.developer.nvidia.com/u/horacehxw)\
**Post date:** [August 18, 2020, 4:43am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/5 "2020-08-18T04:43:59Z")

</div>

What is the purpose of “save\_img” and “attach\_user\_meta” in NvDsObjEncUsrArgs? What will the nvds\_obj\_enc\_process API behave if I set them to FALSE?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [August 20, 2020, 2:51am UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/6 "2020-08-20T02:51:02Z")

</div>

There is no sample codes, but it is OK to acquire an object\_meta from pool and set only one object for the whole image with the new object meta.

“save\_img” is to enable save the object as image file, “attach\_user\_meta” is to enable attaching the image to the user meta and attaching the user meta to the object meta. [NVIDIA DeepStream SDK Developer Guide — DeepStream 6.1.1 Release documentation](https://docs.nvidia.com/metropolis/deepstream/dev-guide/DeepStream_Development_Guide/baggage/struct__NvDsObjEncUsrArgs.html)

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:16pm UTC](https://forums.developer.nvidia.com/t/can-deepsteram5-0-encode-the-selected-frames-into-files/147136/8 "2021-10-12T16:16:51Z")

</div>

Closed on October 12, 2021, 4:16pm UTC


