Jump to content

Transcoding causes Emby server restart - Memory Leak


Go to solution Solved by henriquefer,

Recommended Posts

henriquefer
Posted

Hi,

 

I have my Emby server on Shield TV, and everything works fine unless I want to transcode files bigger than ~2GB. The transcoding process causes the Shield to run out of memory (RAM) and it restarts the Emby Server. No error is displayed on logs since the restart is caused by the lack of memory (I checked that trough adb access to my Shield).

This problem occurs during conversion (sync) or transcoding during playback. 

 

I have already tried the following Emby versions:
4.1.1.0

4.2.0.18

4.2.0.19

4.2.0.20

 

You can check the transcoding log in attachment. 

 

Tips for developers: I don't know, but the -rtbufsize keyword for ffmpeg could limit the amount of RAM used in the process. Could this trick be an easy way to overcome this issue?

 

Thank you very much.

ffmpeg-transcode-.txt

embyciado
Posted

A mi me sucede con archivos de menos de 1GB, teniendo una tvbox generica de 2GB de Ram a 1.5 Ghz de procesador

henriquefer
Posted

I figured out the issue. The machine runs out of memory, and the server restarts. I rooted my Shield TV to increase swap, and now I am able to transcode with no issues. 

Posted

Thanks for the feedback, although you shouldn't have to do that. @@softworkz will be looking into this.

henriquefer
Posted

Thanks for the feedback, although you shouldn't have to do that. @@softworkz will be looking into this.

I know, but I tried some stuff on this weekend, and I was lucky increasing the available swap memory to avoid the server crash. I hope you can fix it soon. :)

Posted

@@henriquefer - Are you sure that it's ffmpeg consuming a high amount of memory? Have you used any tool to verify this?

henriquefer
Posted

Hi. I think so because I checked it with top command on adb shell. The thing os that Shield has already few amount of free RAM, and 1GB of RAM required by the ffmpeg leads to Shield run out of memory. Moreover, I overcome the issue increasing swap to like 6GB.

  • 3 months later...
Posted

@@henriquefer are you still running into this? Our 4.3 beta has an updated ffmpeg build if you'd like to try that. Thanks !

  • 4 weeks later...
henriquefer
Posted

I'm gonna try it. I let you know if it works, Thanks

henriquefer
Posted

Hey. The conversion works perfectly now.

However I am having another issue now. When I started any episode or movie, the playback freezes every 10-15 seconds.

My setup is a Nvidia Shield as server accessing files from a RPi4 (through samba) where I have mounted a rclone Google Drive drive.

Do you know some options that can be used to overcome this issue?

Posted

We'd have to go over an example in detail. Thanks for the feedback.

henriquefer
Posted

Hi,

 

You can find log files in attachment.

I am trying to watch the following file "/storage/DIETPI/Plexserver/TVShows/Legacies/Season 2/Legacies.S02E03.You.Remind.Me.of.Someone.I.Used.to.Know.REPACK.1080p.AMZN.WEB-DL.DDP5.1.H.264-KiNGS-iNC0GNiTO.mkv"

 

In this particular case, the playback does not freeze but it jumps several minutes. 

 

Thank you

 

Best regards

embyserver.txt

ffmpeg.zip

Posted

What do you mean by that exactly?

henriquefer
Posted

The episode is playing normally (during 18 minutes), and then, suddenly, it goes to minute 25 or something. 

Posted

Is it consistent at the same spot each time?

  • Solution
henriquefer
Posted

It seems that the issue was caused by internal network latency between my RPi4 and Nvidia Shield. So, now I have all machines connected through a good switch, and the connection is working faster and no issue so far.

 

Thank you for your attention.

I am going to perform further tests during the next days. I let you know if anything goes wrong. 

  • Like 1
Posted

Thanks for the feedback !

amyhimesama
Posted (edited)

Hi,

 

I have my Emby server on Shield TV, and everything works fine unless I want to transcode files bigger than ~2GB. The transcoding process causes the Shield to run out of memory (RAM) and it restarts the Emby Server. No error is displayed on logs since the restart is caused by the lack of memory (I checked that trough adb access to my Shield).

This problem occurs during conversion (sync) or transcoding during playback. 

 

I have already tried the following Emby versions:

4.1.1.0

4.2.0.18

4.2.0.19

4.2.0.20

 

You can check the transcoding log in attachment. 

 

Tips for developers: I don't know, but the -rtbufsize keyword for ffmpeg could limit the amount of RAM used in the process. Could this trick be an easy way to overcome this issue?

 

Thank you very much.

 

 

 Tutuapp 9Apps ShowBox

I think so because I checked it with top command on adb shell. The thing os that Shield has already few amount of free RAM, and 1GB of RAM required by the ffmpeg leads to Shield run out of memory. Moreover, I overcome the issue increasing swap to like 6GB.

Edited by amyhimesama
henriquefer
Posted

Hi,

 

In fact, I also have 5 GB of swap in my Shield. It helps me to get a more fluid experience using Shield. Now, it works perfectly. 

This is the memory of my Shield at this moment, transcoding one file:

 

total        used        free      shared     buffers

Mem:             2.8G        2.8G         31M         47M        7.3M
-/+ buffers/cache:           2.8G         38M
Swap:            5.0G        1.1G        3.8G
Posted

That's great info, thanks !

henriquefer
Posted

@@amyhimesama @@henriquefer

 

How does the memory usage evolve over time?

Is it constantly rising? Or going high quickly?

 

Usually, Shield does not have a lot of free memory (3 GB is insufficient and even that, Nvidia release a new model with the same amount of RAM), but when I am running a media server with a big library, the issue becomes bigger. 

 

Usually the memory does not increase quickly. It progressively increases over time. During transcoding activities, the amount of memory required increases, and without SWAP, Shield runs out of memory and stops the transcoding or the interface becomes completely laggy. 

Posted

I am reluctant to root my Shield. Will simply expand the internal storage help in this matter?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...