Jump to content

Transcoding causes Emby server restart - Memory Leak


henriquefer
Go to solution Solved by henriquefer,

Recommended Posts

henriquefer

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

Link to comment
Share on other sites

embyciado

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

Link to comment
Share on other sites

henriquefer

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. 

Link to comment
Share on other sites

henriquefer

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. :)

Link to comment
Share on other sites

henriquefer

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.

Link to comment
Share on other sites

  • 3 months later...
  • 4 weeks later...
henriquefer

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?

Link to comment
Share on other sites

henriquefer

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

Link to comment
Share on other sites

  • Solution
henriquefer

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
Link to comment
Share on other sites

amyhimesama

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
Link to comment
Share on other sites

henriquefer

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
Link to comment
Share on other sites

henriquefer

@@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. 

Link to comment
Share on other sites

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...