Jump to content

High CPU when server configured to convert Live TV to MP4


nominion

Recommended Posts

nominion

Hello!

 

Over the past two days, I've been having problems with the server where the CPU goes to nearly 100% utilization when recording live TV.  At that point, the clients can no longer watch live TV or playback recorded video (TV or movies).  

 

I'm running server version 3.0.8300.0 on Windows 10.  Under the Live TV settings, I have it set to automatically convert recordings to MP4.  TV Tuner is an HDHomeRun Prime.  Clients are NVIDIA Shields running latest Emby clients.  

 

During troubleshooting, I saw a dozen ffmpeg.exe processes running under MediaBrowser.ServerApplication.exe for two shows that were recording.  Each recording was being split in to multiple files with the approximately size of 248 MB. 

 

I disabled the feature to convert TV recordings to MP4, restarted the server and CPU has returned to a normal level.  I'm pretty sure I can replicate the problem on demand, if necessary.  

 

Attached are the server and transcode logs that I was able to grab.  You can see in the transcode log that it doesn't like something:

 

[mpeg2video @ 00000000024388e0] Invalid frame dimensions 0x0.

    Last message repeated 13 times

[mpegts @ 0000000002412cc0] Could not find codec parameters for stream 3 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec

Consider increasing the value for the 'analyzeduration' and 'probesize' options

 

I didn't see this problem with version 3.0.7300.0.  

 

Anyone have any thoughts on what is going on? 

 

Thanks in advance for the help!

 

record-transcode-6859431b-f18f-4d68-af35-d062047c2fa6.txt

 

server-63612732986.txt

Edited by nominion
Link to comment
Share on other sites

nominion

The server has not had any issues with high CPU utilization since disabling the conversion of TV recordings to MP4.

 

I did not notice that for some of the recordings, I end up with a .ts and a .mp4.  In some cases, there are also 4 or 5 versions of the same file with the naming convention:  filename-1.mp4 through filename-5.mp4.  Very weird...

Link to comment
Share on other sites

puithove

Convert to MP4/MKV is also transcoding to h.264 - which is a CPU intensive operation.  The fact that you're seeing high CPU when doing so is therefore totally expected.  How well this functions is dependent on your CPU's capability.

 

As for the multiple files per recording... if you restart the server in the middle of a recording, when it continues the recording, it does so with a new file.

Link to comment
Share on other sites

nominion

What is odd is that this worked fine before in version 3.0.7300 of the server.  

 

Perhaps this is an issue with the firmware on the HDHomeRun Prime?  I'm running version 20160630atest2 according to the main menu on the HDHomeRun Prime.  

 

I restarted the server and my HDHomeRun Prime this morning.  Enabled the convert to MP4 feature.  CPU is OK (35%).  When recording Live TV, in this case Teen Titans Go!, I get 4 copies of the same file.  I've summarized the logs below.  They are also attached.

 

Transcode Log:

 

[mpeg2video @ 00000000009c5f20] Invalid frame dimensions 0x0.
    Last message repeated 28 times
[mpegts @ 00000000009c2cc0] Could not find codec parameters for stream 4 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
  Duration: N/A, start: 23034.777867, bitrate: N/A
  Program 2 
    Stream #0:0[0xf91](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:1[0xf92](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0xf93](por): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s (visual impaired)
    Stream #0:3[0xf94]: Video: mpeg2video (Main) ([128][0][0][0] / 0x0080), yuv420p(tv), 1920x1080 [sAR 1:1 DAR 16:9], Closed Captions, max. 20000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:4[0xf95]: Unknown: none ([134][0][0][0] / 0x0086)
[mp4 @ 0000000002b67000] track 1: codec frame size is not set
Output #0, mp4, to 'D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-2.mp4':
  Metadata:
    encoder         : Lavf57.32.100
    Stream #0:0: Video: mpeg2video (a[0][0][0] / 0x0061), yuv420p, 1920x1080 [sAR 1:1 DAR 16:9], q=2-31, max. 20000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, 5.1(side), 448 kb/s
Stream mapping:
  Stream #0:3 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
 
Server Log:
 
2016-10-23 09:00:56.6865 Info App: Beginning recording. Will record for 14.0552243783333 minutes.
2016-10-23 09:00:56.6865 Info App: Writing file to path: D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty.mp4
2016-10-23 09:00:56.6865 Info App: Opening recording stream from tuner provider
2016-10-23 09:00:56.7021 Info App: C:\Users\sysadm\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -fflags +genpts -async 1 -vsync -1 -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8d62e010b6004162ad881f7837eb1133/stream.ts"-t 00:14:03.313 -sn -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty.mp4"
2016-10-23 09:00:56.7334 Info HttpServer: HTTP GET http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8d62e010b6004162ad881f7837eb1133/stream.ts. UserAgent: Lavf/57.32.100
2016-10-23 09:00:56.7334 Info App: Loading live tv data from C:\Users\sysadm\AppData\Roaming\Emby-Server\data\livetv\seriestimers
2016-10-23 09:00:56.7490 Info App: ffmpeg recording process started for D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty.mp4
2016-10-23 09:00:56.7802 Info App: Beginning recording. Will record for 14.05366174 minutes.
2016-10-23 09:00:56.7802 Info App: Writing file to path: D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-1.mp4
2016-10-23 09:00:56.7802 Info App: Opening recording stream from tuner provider
2016-10-23 09:00:56.7802 Info App: C:\Users\sysadm\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -fflags +genpts -async 1 -vsync -1 -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8d62e010b6004162ad881f7837eb1133/stream.ts"-t 00:14:03.219 -sn -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-1.mp4"
2016-10-23 09:00:56.8115 Info HttpServer: HTTP GET http://127.0.0.1:8096/LiveTv/LiveStreamFiles/8d62e010b6004162ad881f7837eb1133/stream.ts. UserAgent: Lavf/57.32.100
2016-10-23 09:00:56.8115 Info App: ffmpeg recording process started for D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-1.mp4
2016-10-23 09:00:57.0615 Info App: Opened HDHR stream from http://192.168.11.125:5004/auto/v142
2016-10-23 09:00:57.0615 Info App: Beginning multicastStream.CopyUntilCancelled
2016-10-23 09:00:57.0615 Info App: Returning mediasource streamId 4f999fe8d57f44dbac4b3522330cbc63native_d5742da38439a044e89416d1620c9f14, mediaSource.Id 92248ae68bac438497681ed3eb98b984_native_d5742da38439a044e89416d1620c9f14, mediaSource.LiveStreamId 
2016-10-23 09:00:57.0615 Info App: Beginning recording. Will record for 14.04897384 minutes.
2016-10-23 09:00:57.0615 Info App: Writing file to path: D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-2.mp4
2016-10-23 09:00:57.0615 Info App: Opening recording stream from tuner provider
2016-10-23 09:00:57.0615 Info App: Live stream 4f999fe8d57f44dbac4b3522330cbc63native_d5742da38439a044e89416d1620c9f14 consumer count is now 2
2016-10-23 09:00:57.0615 Info App: C:\Users\sysadm\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -fflags +genpts -async 1 -vsync -1 -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/d7babcb9dc3a4626a5858ebd5c2f7454/stream.ts"-t 00:14:02.938 -sn -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-2.mp4"
2016-10-23 09:00:57.0615 Info App: Beginning recording. Will record for 14.04897384 minutes.
2016-10-23 09:00:57.0615 Info App: Writing file to path: D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-3.mp4
2016-10-23 09:00:57.0615 Info App: Opening recording stream from tuner provider
2016-10-23 09:00:57.0615 Info App: C:\Users\sysadm\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -fflags +genpts -async 1 -vsync -1 -i "http://127.0.0.1:8096/LiveTv/LiveStreamFiles/d7babcb9dc3a4626a5858ebd5c2f7454/stream.ts"-t 00:14:02.938 -sn -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-3.mp4"
2016-10-23 09:00:57.0928 Info App: ffmpeg recording process started for D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-2.mp4
2016-10-23 09:00:57.0928 Info HttpServer: HTTP GET http://127.0.0.1:8096/LiveTv/LiveStreamFiles/d7babcb9dc3a4626a5858ebd5c2f7454/stream.ts. UserAgent: Lavf/57.32.100
2016-10-23 09:00:57.0928 Info HttpServer: HTTP GET http://127.0.0.1:8096/LiveTv/LiveStreamFiles/d7babcb9dc3a4626a5858ebd5c2f7454/stream.ts. UserAgent: Lavf/57.32.100
2016-10-23 09:00:57.1084 Info App: ffmpeg recording process started for D:\Recorded TV\Teen Titans Go!\Season 3\Teen Titans Go! S03E45 Booty Scooty-3.mp4
20

 

record-transcode-4a26435f-4ecb-483a-bf91-a13f4f4ac42a.txt

record-transcode-eccadfce-703b-4c96-865c-10917afdeffe.txt

record-transcode-fb03325f-3b9c-455d-8725-67ac87eec58c.txt

record-transcode-ff611f89-3571-4561-8de5-706a8b328d45.txt

server-63612810050.txt

Edited by nominion
Link to comment
Share on other sites

nominion

I belive I may have figured out why I'm getting multiple recordings of the same show. The same series recording was scheduled 3 times and 2 were set to record on any channel. I fixed that.

 

Feature request: Add a check to prevent multiple series recordings of the same show.

 

I'm still seeing multiple ffmpeg.exe processes running wild recording. 38 last time I looked.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, in a future update to Emby Server we'll be adding a recording option to preserve original video, this will bring the cpu utilization down to a negligible amount.

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