UMS and nvenc

Developers forum for Univeral Media Server-related development (only for programmers)
Post Reply
supp
Posts: 6
Joined: Fri Jan 22, 2016 6:50 am

UMS and nvenc

Post by supp »

hello guys, i've compiled my version of FFMPEG to add nvenc support and I've built a UMS version with some mods to use it, everithing went fine in the compiles

when I'm running UMS to transcode from h265 to h264 (i've samsung ue40h5303 that doesn't supports x265) it starts ok but then i get this:

Code: Select all

DEBUG 2016-03-23 23:16:18.827 [ffmpeg64.exe-12-2] frame=  677 fps=135 q=18.0 size=    8495kB time=00:00:28.73 bitrate=2422.1kbits/s speed=5.71x    
DEBUG 2016-03-23 23:16:19.336 [ffmpeg64.exe-12-2] frame=  748 fps=135 q=19.0 size=    9730kB time=00:00:31.67 bitrate=2516.6kbits/s speed=5.73x    
DEBUG 2016-03-23 23:16:19.837 [ffmpeg64.exe-12-2] frame=  817 fps=135 q=19.0 size=   10897kB time=00:00:34.52 bitrate=2585.8kbits/s speed=5.72x    
DEBUG 2016-03-23 23:16:20.574 [ffmpeg64.exe-12-2] frame=  886 fps=136 q=20.0 size=   11966kB time=00:00:37.49 bitrate=2614.2kbits/s speed=5.74x    
TRACE 2016-03-23 23:16:20.813 [ffmpeg64.exe-12-Timer] buffered: 13.000.000 bytes / inputs: 1
DEBUG 2016-03-23 23:16:20.848 [ffmpeg64.exe-12-2] frame=  953 fps=135 q=20.0 size=   13003kB time=00:00:40.21 bitrate=2648.5kbits/s speed=5.71x    
TRACE 2016-03-23 23:16:21.074 [New I/O worker #4] Resume Read: readCount=0 / writeCount=13500000
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: Content-Type: video/mpeg
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: Content-Range: bytes 0-2499999/*
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: ContentFeatures.DLNA.ORG: DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: Accept-Ranges: bytes
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: Connection: keep-alive
TRACE 2016-03-23 23:16:21.075 [New I/O worker #4] Sent to socket: Server: Windows_8.1-amd64-6.3, UPnP/1.0, UMS/6.2.1-SNAPSHOT
DEBUG 2016-03-23 23:16:21.348 [ffmpeg64.exe-12-2] frame= 1028 fps=136 q=20.0 size=   14157kB time=00:00:43.29 bitrate=2678.9kbits/s speed=5.74x    
DEBUG 2016-03-23 23:16:21.626 [New I/O worker #4] Connection error: java.io.IOException: An existing connection was forcibly closed by the remote host
DEBUG 2016-03-23 23:16:21.626 [New I/O worker #4] Premature end, stopping...
built on java 8 running on the same, the ffmpeg command alone works ok.

any hint? thx for your amazing work
User avatar
valib
Developer
Posts: 699
Joined: Fri Feb 08, 2013 3:11 am

Re: UMS and nvenc

Post by valib »

It is impossible to answer you when we don't know whose changes you made in the UMS. You can make a Pull Request which show us the differences. The other question is why do you want to use it when it is implemented in the FFMpeg only for decoding the video. Decoding is the easy part of the process. Encoding is more CPU demanding part.
supp
Posts: 6
Joined: Fri Jan 22, 2016 6:50 am

Re: UMS and nvenc

Post by supp »

Hi valib, thanks for you answer.

Starting with your question: I've built FFMPEG with nvenc because it allows me to use my 670gtx to do the heavy part of the encoding (nvenc enables h264 and hevc encoding). I need it cause my old cpu doesn't have hardware support for that.

I don't know why you are saying that "it's implemented only for decoding the video", can u please clarify that? thanks. (maybe u're talkin about nvcuvid?)


Back to my main problem:
I've tried with untouched builds (stock ffmpeg, no mods) 6.2.1, 6.2.2 on java 8 and I've the same problem: whenever I try to transcode from hevc to h264, I get that java error.
I'm gonna do some more testing with others renderers

edit: I think it's something related to my renderer (samsung ue40h5303)... everytime I try to transcode (any format) I get that error, sometimes after 10 sec others after more than 30, and not just from hevc --> h264 but with other combinations too.
Tried with other profiles (eg. samsung-notCD, h4500, eh5300) with same results.
Tried with chromecast, forced transcoding, everything works, no java exception... even using my nvenc modded version works :D

I'll try to mess around with the renderer conf.
User avatar
valib
Developer
Posts: 699
Joined: Fri Feb 08, 2013 3:11 am

Re: UMS and nvenc

Post by valib »

supp wrote: I don't know why you are saying that "it's implemented only for decoding the video", can u please clarify that? thanks. (maybe u're talkin about nvcuvid?)
Sorry my bad. I mixed up decoding and encoding. You are right that nvenc is used for encoding.
The

Code: Select all

DEBUG 2016-03-23 23:16:21.626 [New I/O worker #4] Connection error: java.io.IOException: An existing connection was forcibly closed by the remote host
means that TV disconnected itself but the question is what is the reason for that. Maybe a wrong format is used for transcoding. What is the reason you transcode to h264 when all Samsung confs use the standard transcoding to MPEG-PS format. There should be a reason for that but I don't have a Samsung TV so I can't confirm it.
supp
Posts: 6
Joined: Fri Jan 22, 2016 6:50 am

Re: UMS and nvenc

Post by supp »

The reason I was using h264 was to achieve more quality.

Anyway the same error happens on mpegps or mpegts, after some seconds of play I get that error. Simply put Transcoding means TV disconnect itself after a short while.
I've done some testing changing various renderer configs (mpegts,ps,ac3,acc,h264, TranscodedVideoFileSize, bitrate) to no avail, even using the default samsung-notcd doesn't change the pattern.

Maybe it's just this specific model that is flawed.
I'll do some more testing on renderer config and keep u posted if I succeed

edit: did some packet capturing with wireshark and seems something related to the receiver's tcp window size remaining at zero for some time, then it sends a RST ACK and this error appears. Gonna investigate more...
Post Reply