zcs
December 7, 2018, 10:02am
1
Hi,
We use the encoder in tegra_multimedia_api,when release the encoder, the encoder maybe blocking.
We modify 01_video_encode to reproduce this issue. Just let the it keep looping.
In video_encode_main.cpp.
int
main(int argc, char *argv )
{
context_t ctx;
int ret = 0;
int error = 0;
bool eos = false;
unsigned int input_frames_queued_count = 0;
run_again:
eos = false;
ret = 0;
input_frames_queued_count = 0;
…
…
if (error)
{
cout << “App run failed” << endl;
}
else
{
cout << “App run was successful frame cnt:” << input_frames_queued_count << endl;
}
goto run_again;
return -error;
}
And run
./video_encode /run/shm/3d_1920x1080_60_6000K_360.yuv 640 360 H264 out.264 -p high -rc vbr -hpt 4 -nbf 2 --copy-timestamp 0
When it is blocking, we see it block at release encoder.
Failed to query video capabilities: Inappropriate ioctl for device
NvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
[ERROR] (NvV4l2ElementPlane.cpp:496) Output Plane:STREAMON successful
[ERROR] (NvV4l2ElementPlane.cpp:496) Capture Plane:STREAMON successful
===== MSENC blits (mode: 1) into tiled surfaces =====
Could not read complete frame from input file
File read complete.
Thanks!
DaneLLL
December 10, 2018, 2:24am
2
Hi,
Are you on r28.2.1? Please share a patch on 01_video_encode so that we can reproduce the issue.
zcs
December 10, 2018, 7:52am
3
Hi, DaneLLL
Thank you for your reply.
We work at R28.1.0, and the reproduce method on top of this topic.
The yuv file is here, [url]http://120.77.3.207/3d_1920x1080_60_6000K_360.yuv[/url]
Thanks!
DaneLLL
December 10, 2018, 9:15am
4
Hi zcs,
‘–copy-timestamp 0’ is not in default r28.1 release. Can you try clean r28.1?
zcs
December 12, 2018, 7:23am
5
Hi, DaneLLL
I had tested it in clean r28.1, it still blocks.
DaneLLL
December 14, 2018, 4:27am
6
Hi zcs,
Does the issue happen if you run the command without any options?
./video_encode /run/shm/3d_1920x1080_60_6000K_360.yuv 640 360 H264 out.264
zcs
December 14, 2018, 6:12am
7
Hi, DaneLLL
I had tested it without any options, it still blocks.
DaneLLL
December 17, 2018, 6:50am
8
Hi,
Please try attachment. We don’t reproduce the issue you reported, but include a fix in attached libtegrav4l2.so. Hope it helps.
Also we suggest you migrate to latest release.
r28_1_libtegrav4l2.zip (60.8 KB)
zcs
December 17, 2018, 8:00am
9
Hi, DaneLLL
I had tested the attachment, but it still blocks.
Please open 8 sessions by ssh and run the command at the same time. that is very easy to reproduce this issue.
Thanks!
DaneLLL
December 18, 2018, 1:26am
10
Hi zcs,
Please try r28.2.1.
Multi-session encoding is not general case we have verified/tested in BSP release. It is more like customized usecase and we suggest you contact salesperson to get direct support.
zcs
December 18, 2018, 6:34am
11
Hi, DaneLLL
I had tested on r28.2.1, but I encounter the memory leak.
[ 6681.805725] Out of memory: Kill process 3882 (video_encode) score 20 or sacrifice child
[ 6681.813759] Killed process 3882 (video_encode) total-vm:2119080kB, anon-rss:1688kB, file-rss:155988kB
Thanks!
DaneLLL
December 18, 2018, 8:02am
12
Please try
https://elinux.org/Jetson_TX2/28.2.1_patches
[MMAPI]Cannot run NvVideoDecoder in loop/Memory leak in NvVideoEncoder
zcs
December 18, 2018, 9:00am
13
Hi, DaneLLL
Thank you for your reply.
I see the patch is for TX1, is suitable for TX2?
Multimedia
[MMAPI]Cannot run NvVideoDecoder in loop/Memory leak in NvVideoEncoder
patch link
https://devtalk.nvidia.com/default/topic/1043548/jetson-tx1/-mmapi-please-merge-two-libtegrav4l2-so-that-modify-different-issues/post/5294104/#5294104
DaneLLL
December 18, 2018, 9:22am
14
Yes, it is good for both TX1 and TX2.
zcs
December 19, 2018, 5:33am
15
Hi, DaneLLL
Thank you for your patch.
It seems to have fixed the memory leaks issue. I will test the blocking issue for a long time on r28.2.1.
In addition, I find the deocder also have the blocking issue, I create a new topic to report it.
[url]https://devtalk.nvidia.com/default/topic/1045455/jetson-tx2/blocking-issue-with-decoder/[/url]
Thank you for the help.