Jump to content

Transcoding MKV File Hangs the Server


Go to solution Solved by dyecast,

Recommended Posts

Posted
Hello,
 
I'm having crashing/transcoding issues with some newly added MKV files.  When I'm on WiFi or the LAN, they seems to do okay, but on 4g/5g, they transcode after 10-15 minutes or the entire server seems to hang and the connection is lost.  I'm attempting to transcode to 480p at 1Mbps.
 
Title480p MPEG2VIDEO
CodecMPEG2VIDEO
ProfileMain
Level8
Resolution720x480
Aspect Ratio853:480
InterlacedNo
Framerate29.97
Bitrate6 mbps
Bit Depth8 bit
Pixel Formatyuv420p
Reference Frames1
Posted

See attached.  The bulk of the transcoding issues occurred on the 14th.

I can attach a sample MKV file if necessary.

emby-logs.zip

Posted

I'm primarily using the iPhone app.  It's running the current version as is the Emby server itself.

  • 1 month later...
Posted

@dyecast

Quote

the entire server seems to hang

Can you please describe exactly what you mean by this? When this happens, are you able to use the web app directly on the server machine?

  • 1 month later...
Posted

My Emby is running on Synology so I cannot test that.  The problem has grown a bit since my initial posting though.

The issue now occurs on the LAN now intermittently too.  Ie.  If I try to watch a movie or TV show (like from original post), there will be a delay in the video running.  If I'm watching the Emby Admin Control Panel, I can see it is transcoding.  The video, however, never begins playing.  If I force close the app on my PC or iPhone (still more common on iPhone) and relaunch the Emby app, the app on the phone will commonly timeout as if the Emby server is entirely offline.  After 8-10 minutes, I can then reconnect to Emby and try again.  That is a summary of problem #1.

Along those same lines, I'm having issues playing music on my same iPhone when on 4g/5g.  Track 01 will not play and after 20-30 seconds, it will go to track 02.  Sometimes it will play and sometimes it won't.  The record is getting to track 5 before anything would play.  This bundle of fun is occurring with MULTIPLE mp3 albums.  There have also been moments where the first couple tracks of a previously troubled album would play, but the 4th-5th won't. 

I tried completely uninstalling Emby from my phone, restarting fully and re-installing.  I thought it was fixed, but nope...Same issues.  Same frequency.  No useful error messages in the app interface.

Posted

HI, can we please look at a specific example? Thanks.

Posted

Hi @dyecast

On 10/14/2024 at 7:27 PM, dyecast said:
Hello,
 
I'm having crashing/transcoding issues with some newly added MKV files.  When I'm on WiFi or the LAN, they seems to do okay, but on 4g/5g, they transcode after 10-15 minutes or the entire server seems to hang and the connection is lost.  I'm attempting to transcode to 480p at 1Mbps.

Looking at many if your ffmpeg logs I see user mattybob playing back on Emby for iOS 2.2.31.

I see 16 to 22 minutes or so transcoding taking place for most of the ffmpeg files. Example last few lines:

19:30:09.021 SegmentComplete=video:0 Index=424 Start=1273.272011 End=1276.275011 Duration=3.003000 offset_pts=0 start_pts=1273272011 Frames=90 filename=260A5B_424.ts
19:30:09.021 [segment @ 0x1c952c0] Opening '/var/packages/EmbyServer/var/transcoding-temp/260A5B/260A5B_425.ts.tmp' for writing
[segment @ 0x1c952c0] Opening '/var/packages/EmbyServer/var/transcoding-temp/260A5B/260A5B.m3u8.tmp' for writing
SegmentComplete=video:0 Index=425 Start=1276.275011 End=1277.109178 Duration=0.834167 offset_pts=0 start_pts=1276275011 Frames=25 filename=260A5B_425.ts
elapsed=00:01:11.52 frame=38275 fps=535 q=-0.0 Lsize=N/A time=00:21:16.83 bitrate=N/A dup=7655 drop=0 throttle=off speed=17.9x  

I found one that received a [Q]uit command  ffmpeg-remux-6cee1b85-b5ef-4ab9-8ffc-8356346ff174_1.txt around 23 minutes into the transcode.

20:59:03.183 SegmentComplete=video:0 Index=231 Start=1386.093000 End=1391.932000 Duration=5.839000 offset_pts=0 start_pts=1386093000 Frames=142 filename=ABF9EA_231.ts
20:59:03.183 [segment @ 0x16e2600] Opening '/var/packages/EmbyServer/var/transcoding-temp/ABF9EA/ABF9EA_232.ts.tmp' for writing
20:59:03.278 

[q] command received. Exiting.

[segment @ 0x16e2600] Opening '/var/packages/EmbyServer/var/transcoding-temp/ABF9EA/ABF9EA.m3u8.tmp' for writing
SegmentComplete=video:0 Index=232 Start=1392.016000 End=1393.058000 Duration=1.042000 offset_pts=0 start_pts=1392016000 Frames=27 filename=ABF9EA_232.ts
elapsed=00:03:04.73 frame=33400 fps=181 q=-1.0 Lsize=N/A time=00:23:06.15 bitrate=N/A throttle=off speed= 7.5x    
video:12

Are you saying this would have never started playing back on the iphone?

 

What we really need to have is set of clean logs where you restart the server, so it has a fresh log file.  Then connect with your iphone and reproduce the error.
Once you've reproduced an issue, grab the logs for that one issue and upload them here.  Along with the log files, tell us exactly what you did. 

While, connected to my wifi network on the same LAN as the Emby Server, I played X media file starting at 2:48pm. I saw server transcoding it on the server but had no media playback on the Y device.  I had a circle spinning on that device... Or saw it switch to the video player but the show/movie, never started to play.  After 3 minutes I terminate playback, grabbed the logs and uploaded them here. 

Something like the above makes it very clear what took place in your environment. So when we are looking at what took place according to the server logs, we also know without guessing what the outcome was on the device.
 

Carlo

Posted
12 hours ago, Carlo said:

Are you saying this would have never started playing back on the iphone?

 

Playback would start and then stop.

I'll try to generate some new logs today. I had problems with playing music again this morning.  Stand by.

  • Thanks 1
Posted

@Luke

@Carlo

It just happened again.  iPhone.  4g.  Watching a TV show.  The episode had just started then went black 8-10 seconds into it.  Never recovered.

I forced quit the iPhone app and tried to re-launch.  It timed out connecting to the server and brought me to the Server Selection screen.

The TV Show was Star Trek DS9 and Armageddon Game was the episode I started.  There shouldn't have been any heavy transcoding due to the already small size of the source video file.


The logs I attached are from almost immediately after the iPhone lockup and NO other media was accessed after the glitch.

2024-12-20_648pm_GMT-8.zip

  • 2 weeks later...
Posted (edited)

Another odd error on the LAN side.  If I click on a TV show that is for a specific episode I was watching earlier, it's taking me back to S1E1.  See attached.

 

Screenshot 2024-12-30 at 8.22.38 PM.png

Screenshot 2024-12-30 at 8.22.25 PM.png

Edited by dyecast
Posted

Clearing all browser cache has no impact.  The error appears to be server side.

Posted

LAN side.

iPhone.  Sooo weird

IMG_4580.png

Posted
3 minutes ago, dyecast said:

LAN side.

iPhone.  Sooo weird

IMG_4580.png

I would check that the Emby iOS app is being allowed local network permissions.

Posted (edited)
1 minute ago, Luke said:

I would check that the Emby iOS app is being allowed local network permissions.

It does because it can play other shows, music, etc.  It's an intermittent problem across all media.  I just happen to catch it on this one.  It's happened on the WAN side too, but this was a first on the LAN.

Edited by dyecast
Posted

Hi, please check it anyway and provide a screenshot of what you find. Thanks.

Posted
4 minutes ago, Luke said:

Hi, please check it anyway and provide a screenshot of what you find. Thanks.

 

IMG_4581.png

Posted
14 hours ago, Luke said:

I would check that the Emby iOS app is being allowed local network permissions.

I’m now getting that same error message on the same episode from the WAN side. iPhone.

Posted

Hi @dyecast

Hi, this only happens on certain files but not all media files, correct?

What I've found over the years, is that a resume that fails to start where you left off (or causes strange things) are corrupted or weren't created properly. Often, they can be played if transcoded or remuxed.

Try running any problem files through mkclean and see if this fixes the issue.

https://www.matroska.org/downloads/mkclean.html

Carlo
 

  • 4 weeks later...
Posted

I'm having a similar issue with another 4k video.

I'm trying to watch it on my 4k Roku.

Attached is a screenshot of the TV which never changes it's picture despite the timer in the server.  The server's ability to playback videos is becoming increasingly tiresome.

IMG_4618.jpeg

Posted
On 1/2/2025 at 4:24 PM, Carlo said:

Hi @dyecast

Hi, this only happens on certain files but not all media files, correct?

What I've found over the years, is that a resume that fails to start where you left off (or causes strange things) are corrupted or weren't created properly. Often, they can be played if transcoded or remuxed.

Try running any problem files through mkclean and see if this fixes the issue.

https://www.matroska.org/downloads/mkclean.html

Carlo
 

It happens with MP3s, MP4s, MKVs.

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