mine260309 / ps3mediaserver

PS3 Media Server is a cross-platform DLNA-compliant UPnP Media Server. Originally written to support the PlayStation 3, PS3 Media Server has been expanded to support a range of other media renderers, including smartphones, televisions, music players and more.
http://www.ps3mediaserver.org/
GNU General Public License v2.0
0 stars 0 forks source link

Transcode does not work on PS4 #1

Open mine260309 opened 9 years ago

mine260309 commented 9 years ago

With a modified PS4.conf (based on PS3.conf), PMS is able to stream media files to PS4's Media Player app without encoding.

But to support media files that PS4 does not support, or to add subtitles into the video, PMS's transcoding shall be used.

However, PMS transcoding does not work with PS4, and I can confirm that it's not a problem for the container or A/V codec. PS4 supports MPEG-2 TS with MPEG2-Video and MPEG2-Audio. I manually dumped Mencoder and VLC transcoded stream to TS files and copied to a USB-stick, PS4 plays the TS files OK; I put the TS files on PC and force PMS not transcoding but just serving raw TS files, PS plays OK. But when PS4 plays PMS's transcoding streams, it fails.

Wireshark dump shows it's downloading the first a few parts of a media files for couple of times (7 times in my case), and I guess it's a problem for streaming, but OK for raw files. So a possible fix is to preserve the streaming buffer for the first requests.

mine260309 commented 9 years ago

PMS logs:

TRACE 2015-06-22 16:11:00.350 [New I/O server worker #2-1] Opened request handler on socket /192.168.1.10:59067
TRACE 2015-06-22 16:11:00.350 [New I/O server worker #2-1] Request: HTTP/1.1 : GET : get/0$7$17$1$2/thumbnail0000mencoder.ts
TRACE 2015-06-22 16:11:00.351 [New I/O server worker #2-1] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:00.351 [New I/O server worker #2-1] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:00.351 [New I/O server worker #2-1] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:00.352 [New I/O server worker #2-1] Received on socket: User-Agent: PS4Application libhttp/1.000 (PS4) libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:00.352 [New I/O server worker #2-1] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:00.353 [New I/O server worker #2-1] HTTP: get/0$7$17$1$2/thumbnail0000mencoder.ts / 0-0
TRACE 2015-06-22 16:11:00.353 [New I/O server worker #2-1] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:00.354 [New I/O server worker #2-1] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:00.354 [New I/O server worker #2-1] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:00.355 [New I/O server worker #2-1] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:00.355 [New I/O server worker #2-1] Available Content-Length: 10907
TRACE 2015-06-22 16:11:00.356 [New I/O server worker #2-1] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:00.356 [New I/O server worker #2-1] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:00.357 [New I/O server worker #2-1] Sent to socket: Content-Length: 10907
TRACE 2015-06-22 16:11:00.357 [New I/O server worker #2-1] Sent to socket: Content-Type: image/jpeg
TRACE 2015-06-22 16:11:00.357 [New I/O server worker #2-1] Sent to socket: Expires: Fri, 16 Oct 2015 01:57:40 GMT
TRACE 2015-06-22 16:11:00.358 [New I/O server worker #2-1] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:00.421 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:00.423 [New I/O server worker #2-2] Opened request handler on socket /192.168.1.10:51029
TRACE 2015-06-22 16:11:00.423 [New I/O server worker #2-2] Request: HTTP/1.1 : GET : get/0$7$17$1$1/thumbnail0000mencoder.ts
TRACE 2015-06-22 16:11:00.424 [New I/O server worker #2-2] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:00.424 [New I/O server worker #2-2] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:00.425 [New I/O server worker #2-2] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:00.425 [New I/O server worker #2-2] Received on socket: User-Agent: PS4Application libhttp/1.000 (PS4) libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:00.425 [New I/O server worker #2-2] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:00.426 [New I/O server worker #2-2] HTTP: get/0$7$17$1$1/thumbnail0000mencoder.ts / 0-0
TRACE 2015-06-22 16:11:00.426 [New I/O server worker #2-2] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:00.427 [New I/O server worker #2-2] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:00.427 [New I/O server worker #2-2] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:00.428 [New I/O server worker #2-2] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:00.428 [New I/O server worker #2-2] Available Content-Length: 10907
TRACE 2015-06-22 16:11:00.429 [New I/O server worker #2-2] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:00.429 [New I/O server worker #2-2] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:00.430 [New I/O server worker #2-2] Sent to socket: Content-Length: 10907
TRACE 2015-06-22 16:11:00.430 [New I/O server worker #2-2] Sent to socket: Content-Type: image/jpeg
TRACE 2015-06-22 16:11:00.431 [New I/O server worker #2-2] Sent to socket: Expires: Fri, 16 Oct 2015 01:57:40 GMT
TRACE 2015-06-22 16:11:00.431 [New I/O server worker #2-2] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:04.493 [UPNPHelper] Receiving a M-SEARCH from [192.168.1.99:1900]
TRACE 2015-06-22 16:11:04.493 [UPNPHelper] Receiving a M-SEARCH from [192.168.1.99:1900]
TRACE 2015-06-22 16:11:04.494 [UPNPHelper] Receiving a M-SEARCH from [192.168.1.99:1900]
TRACE 2015-06-22 16:11:04.494 [UPNPHelper] Receiving a M-SEARCH from [192.168.1.99:1900]
TRACE 2015-06-22 16:11:04.495 [UPNPHelper] Sending this reply [192.168.1.99:1900]: HTTP/1.1 200 OK<CRLF>CACHE-CONTROL: max-age=1200<CRLF>DATE: Mon, 22 Jun 2015 08:11:04 GMT<CRLF>LOCATION: http://192.168.1.99:5001/description/fetch<CRLF>SERVER: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1<CRLF>ST: upnp:rootdevice<CRLF>EXT: <CRLF>USN: uuid:ec3325ce-3f20-4c21-87d7-7483fcc067fa::upnp:rootdevice<CRLF>Content-Length: 0<CRLF><CRLF>
TRACE 2015-06-22 16:11:04.496 [UPNPHelper] Receiving a M-SEARCH from [192.168.1.99:1900]
TRACE 2015-06-22 16:11:04.496 [UPNPHelper] Sending this reply [192.168.1.99:1900]: HTTP/1.1 200 OK<CRLF>CACHE-CONTROL: max-age=1200<CRLF>DATE: Mon, 22 Jun 2015 08:11:04 GMT<CRLF>LOCATION: http://192.168.1.99:5001/description/fetch<CRLF>SERVER: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1<CRLF>ST: upnp:rootdevice<CRLF>EXT: <CRLF>USN: uuid:ec3325ce-3f20-4c21-87d7-7483fcc067fa::upnp:rootdevice<CRLF>Content-Length: 0<CRLF><CRLF>
TRACE 2015-06-22 16:11:06.968 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:06.970 [New I/O server worker #2-3] Opened request handler on socket /192.168.1.10:64455
TRACE 2015-06-22 16:11:06.970 [New I/O server worker #2-3] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:06.971 [New I/O server worker #2-3] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:06.971 [New I/O server worker #2-3] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:06.972 [New I/O server worker #2-3] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:06.972 [New I/O server worker #2-3] Received on socket: User-Agent: PS4Application libhttp/1.000 (PS4) libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:06.973 [New I/O server worker #2-3] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:06.973 [New I/O server worker #2-3] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:06.974 [New I/O server worker #2-3] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:06.974 [New I/O server worker #2-3] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:06.975 [New I/O server worker #2-3] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:06.975 [New I/O server worker #2-3] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:06.975 [New I/O server worker #2-3] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
INFO  2015-06-22 16:11:06.976 [StartPlaying Event] Started sending F:\mencoder.ts to PlayStation 3 on 192.168.1.10
TRACE 2015-06-22 16:11:06.977 [New I/O server worker #2-3] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:07.019 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:07.204 [New I/O server worker #2-3] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:07.208 [New I/O server worker #2-4] Opened request handler on socket /192.168.1.10:54711
TRACE 2015-06-22 16:11:07.209 [New I/O server worker #2-3] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:07.212 [New I/O server worker #2-4] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:07.215 [New I/O server worker #2-3] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:07.218 [New I/O server worker #2-4] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:07.222 [New I/O server worker #2-3] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:07.222 [New I/O server worker #2-4] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:07.223 [New I/O server worker #2-4] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:07.223 [New I/O server worker #2-4] Received on socket: User-Agent: libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:07.224 [New I/O server worker #2-4] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:07.224 [New I/O server worker #2-4] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:07.225 [New I/O server worker #2-4] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:07.225 [New I/O server worker #2-4] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:07.225 [New I/O server worker #2-4] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:07.226 [New I/O server worker #2-4] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:07.226 [New I/O server worker #2-4] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:07.228 [New I/O server worker #2-4] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:07.228 [New I/O server worker #2-4] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:07.229 [New I/O server worker #2-4] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:07.229 [New I/O server worker #2-4] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:07.230 [New I/O server worker #2-4] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:07.243 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:07.245 [New I/O server worker #2-5] Opened request handler on socket /192.168.1.10:52252
TRACE 2015-06-22 16:11:07.246 [New I/O server worker #2-5] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:07.246 [New I/O server worker #2-5] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:07.247 [New I/O server worker #2-5] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:07.247 [New I/O server worker #2-5] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:07.247 [New I/O server worker #2-5] Received on socket: User-Agent: libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:07.248 [New I/O server worker #2-5] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:07.248 [New I/O server worker #2-5] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:07.249 [New I/O server worker #2-5] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:07.249 [New I/O server worker #2-5] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:07.250 [New I/O server worker #2-5] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:07.250 [New I/O server worker #2-5] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:07.250 [New I/O server worker #2-5] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:07.252 [New I/O server worker #2-5] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:07.252 [New I/O server worker #2-5] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:07.253 [New I/O server worker #2-5] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:07.253 [New I/O server worker #2-5] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:07.254 [New I/O server worker #2-5] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:07.272 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:07.274 [New I/O server worker #2-6] Opened request handler on socket /192.168.1.10:51229
TRACE 2015-06-22 16:11:07.275 [New I/O server worker #2-6] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:07.275 [New I/O server worker #2-6] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:07.276 [New I/O server worker #2-6] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:07.276 [New I/O server worker #2-6] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:07.276 [New I/O server worker #2-6] Received on socket: User-Agent: libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:07.277 [New I/O server worker #2-6] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:07.277 [New I/O server worker #2-6] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:07.278 [New I/O server worker #2-6] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:07.278 [New I/O server worker #2-6] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:07.279 [New I/O server worker #2-6] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:07.279 [New I/O server worker #2-6] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:07.279 [New I/O server worker #2-6] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:07.281 [New I/O server worker #2-6] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:07.281 [New I/O server worker #2-6] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:07.282 [New I/O server worker #2-6] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:07.282 [New I/O server worker #2-6] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:07.282 [New I/O server worker #2-6] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:07.304 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:07.306 [New I/O server worker #2-7] Opened request handler on socket /192.168.1.10:62345
TRACE 2015-06-22 16:11:07.306 [New I/O server worker #2-7] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:07.307 [New I/O server worker #2-7] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:07.307 [New I/O server worker #2-7] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:07.308 [New I/O server worker #2-7] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:07.308 [New I/O server worker #2-7] Received on socket: User-Agent: libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:07.309 [New I/O server worker #2-7] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:07.309 [New I/O server worker #2-7] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:07.310 [New I/O server worker #2-7] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:07.310 [New I/O server worker #2-7] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:07.310 [New I/O server worker #2-7] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:07.311 [New I/O server worker #2-7] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:07.311 [New I/O server worker #2-7] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:07.312 [New I/O server worker #2-7] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:07.313 [New I/O server worker #2-7] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:07.313 [New I/O server worker #2-7] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:07.314 [New I/O server worker #2-7] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:07.314 [New I/O server worker #2-7] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:08.982 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:08.984 [New I/O server worker #2-8] Opened request handler on socket /192.168.1.10:62826
TRACE 2015-06-22 16:11:08.984 [New I/O server worker #2-8] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:08.985 [New I/O server worker #2-8] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:08.985 [New I/O server worker #2-8] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:08.986 [New I/O server worker #2-8] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:08.986 [New I/O server worker #2-8] Received on socket: User-Agent: PS4Application libhttp/1.000 (PS4) libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:08.987 [New I/O server worker #2-8] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:08.987 [New I/O server worker #2-8] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:08.988 [New I/O server worker #2-8] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:08.988 [New I/O server worker #2-8] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:08.989 [New I/O server worker #2-8] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:08.989 [New I/O server worker #2-8] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:08.990 [New I/O server worker #2-8] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:08.991 [New I/O server worker #2-8] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:08.992 [New I/O server worker #2-8] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:08.992 [New I/O server worker #2-8] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:08.993 [New I/O server worker #2-8] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:08.993 [New I/O server worker #2-8] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
TRACE 2015-06-22 16:11:09.018 [New I/O server boss #2 ([id: 0x0ef98a07, /192.168.1.99:5001])] Creating new pipeline
TRACE 2015-06-22 16:11:09.020 [New I/O server worker #2-9] Opened request handler on socket /192.168.1.10:61994
TRACE 2015-06-22 16:11:09.021 [New I/O server worker #2-9] Request: HTTP/1.1 : GET : get/0$7$17$1$2/mencoder.ts
TRACE 2015-06-22 16:11:09.021 [New I/O server worker #2-9] Matched media renderer "PlayStation 3" based on address /192.168.1.10
TRACE 2015-06-22 16:11:09.022 [New I/O server worker #2-9] Received on socket: Connection: Keep-Alive
TRACE 2015-06-22 16:11:09.022 [New I/O server worker #2-9] Received on socket: Host: 192.168.1.99:5001
TRACE 2015-06-22 16:11:09.023 [New I/O server worker #2-9] Received on socket: User-Agent: libhttp/2.51 (PlayStation 4)
TRACE 2015-06-22 16:11:09.023 [New I/O server worker #2-9] Recognized media renderer: PlayStation 3
TRACE 2015-06-22 16:11:09.024 [New I/O server worker #2-9] HTTP: get/0$7$17$1$2/mencoder.ts / 0-0
TRACE 2015-06-22 16:11:09.024 [New I/O server worker #2-9] discover 0 refresh forced: false
TRACE 2015-06-22 16:11:09.024 [New I/O server worker #2-9] discover 0$7 refresh forced: false
TRACE 2015-06-22 16:11:09.025 [New I/O server worker #2-9] discover 0$7$17 refresh forced: false
TRACE 2015-06-22 16:11:09.025 [New I/O server worker #2-9] discover 0$7$17$1 refresh forced: false
TRACE 2015-06-22 16:11:09.026 [New I/O server worker #2-9] Asked stream chunk : TimeRange [start=null, end=null] of mencoder.ts and player null
TRACE 2015-06-22 16:11:09.027 [New I/O server worker #2-9] Sent to socket: Accept-Ranges: bytes
TRACE 2015-06-22 16:11:09.027 [New I/O server worker #2-9] Sent to socket: Connection: keep-alive
TRACE 2015-06-22 16:11:09.028 [New I/O server worker #2-9] Sent to socket: Content-Length: 336573580
TRACE 2015-06-22 16:11:09.028 [New I/O server worker #2-9] Sent to socket: Content-Type: video/mpeg
TRACE 2015-06-22 16:11:09.029 [New I/O server worker #2-9] Sent to socket: Server: Windows_7-amd64-6.1, UPnP/1.0, PMS/1.90.1
INFO  2015-06-22 16:11:21.514 [StopPlaying Event] Stopped sending F:\mencoder.ts to PlayStation 3 on 192.168.1.10
DEBUG 2015-06-22 16:11:49.057 [UPNP-AliveMessageSender] Sending ALIVE...
TRACE 2015-06-22 16:11:49.216 [UPNP-AliveMessageSender] Sending message from multicast socket on network interface: name:0.0.0.0
TRACE 2015-06-22 16:11:49.217 [UPNP-AliveMessageSender] Multicast socket is on interface: /0.0.0.0
TRACE 2015-06-22 16:11:49.221 [UPNP-AliveMessageSender] Socket Timeout: 0
TRACE 2015-06-22 16:11:49.224 [UPNP-AliveMessageSender] Socket TTL: 32
ExSport commented 9 years ago

Have you tested latest UMS fork? It is heavily updated instead of PMS:-(

mine260309 commented 9 years ago

No, haven't heard about that... I'll google and see if it works

mine260309 commented 9 years ago

Well, I found UMS and have it tested, the behavior is the same as PMS, and the issue should be the same. I guess if this issue is fixed for PMS, it applies to UMS as well :)

ExSport commented 9 years ago

https://github.com/UniversalMediaServer/UniversalMediaServer/ http://www.universalmediaserver.com/forum/index.php It continues where PMS ended and still has very frequent release of new updates. I know in forum there is live debate about supporting PS4 with test versions. I think that info about working transcoded file when passed to renderer afterward works but real-time transcoding doesn't, it should be useful hint for SubJunk. What I read at last was there will be needed custom ffmpeg/mencoder build as Plex is using where transcoding works. But the idea was that original mencoder/ffmpeg generates incompatible file but as you said file works so there should be some glitch where transcoded file is streamed in real-time.

mine260309 commented 9 years ago

Thanks a lot for the information!

I made a modification to always terminate and restart the encoder when a request comes, this makes sure PS4 is receiving the stream from start when it requests, to simulate the case as raw-file playback. Unfortunately it still does not work. From the wireshark log (https://drive.google.com/open?id=0B9tz6cYMkkwMdVpiYW1CbVFhUDQ&authuser=0), the only difference is that response header Content-Length: xxx is available for raw-file, but it's not available for transcoding.

If that's the root cause, I guess Plex will set the Content-Length (or time range) and update it periodically.

@ExSport Do you have Plex for testing? If yes, please capture a wireshark log and see the response.

I will not have time to to test Plex until tomorrow...

ExSport commented 9 years ago

@mine260309 Sorry don't have Plex and also the renderer for test. Btw. you can try tune this in renderer conf file for PS4. E.g. "TranscodedVideoFileSize" sets "Content-Length":

# Set to true to use the DLNA feature seek-by-time instead of the default
# seek-by-byte method.
#
# Valid values:
#
#     true:
#
#         The renderer supports seek-by-time.
#
#     false:
#
#         The renderer doesn't support seek-by-time, so it should
#         only use the default seek-by-byte method.
#
#     exclusive:
#
#         While most renderers that support seek-by-time also support
#         seek-by-byte, some (e.g. the PS3 [1] and Panasonic TVs [2])
#         behave unreliably if both are permitted when transcoding files.
#         This option works around this by disabling seek-by-byte for
#         transcoded files when permitting seek-by-time.
#
# [1] Seeking via "Go To" with the PS3 (firmware 4.31) and MEncoder works with
#     "exclusive", but hangs or crashes with "true".
# [2] http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=15841
#
# Default: false
SeekByTime = 

# Whether the renderer has a short timeout delay and needs to receive transcoded
# video with minimal delay. If set to "false", UMS will take some time to buffer
# some of the transcoded video.
# Default: false
TranscodeFastStart = 

# The amount of transcoded data is unknown at the time of transcoding. Still,
# some renderers expect a size for the video file to be returned.
# Options:
#            0: No size is sent to the renderer.
# 100000000000: Fake size of 100 GB is sent to the renderer.
#           -1: Specific value that works perfect for the PS3. It is against
#               the DLNA spec though.
# Default: 0
TranscodedVideoFileSize = 

If you are using PMS or official UMS version, both have hardcoded hacks directly in code for PS3 which are unfortunately applied also to PS4. You should check snapshot builds of UMS: http://universalmediaserver-ci.hopto.org:9999/job/ums%20trunk/lastBuild/net.pms$ums/ As I am not programmer, it will be great to post your findings also to UMS forum and github so also other developers can share their and your findings together to findout the solution :+1:

creighton10 commented 9 years ago

Here's the topic on UMS' forums where we were trying to solve the issue. I'm going to link to this there because I think your findings are useful, mine260309.

http://www.universalmediaserver.com/forum/viewtopic.php?f=4&t=3521

mine260309 commented 9 years ago

I've got time to do some test. Previously I thought it is the Content-Length that cause PS4 not playing transcoding streams, so I hard-coded adding Content-Length header. However, it still does not work. So it's not the root cause.

Then I put a MKV and the transcoded ts stream in a same dir, use PS4 to browse and play both, and captured the wireshark log (https://drive.google.com/file/d/0B9tz6cYMkkwMWk03STU1LUxOQUU/view?usp=sharing) I hope I can compare the browse results to see what's the difference between a transcode stream and a raw TS stream.

ExSport commented 9 years ago

Meanwhile I think Subjunk found on another forum (or from own testing) right ffmpeg params which makes transcoded files playable on PS4 so check UMS forum and GitHub for new test versions :+1:

mine260309 commented 9 years ago

@ExSport Thanks. But I want to dig into the issue and see what's wrong.

The behavior is really weird to me.

ExSport commented 9 years ago

@mine260309 Check this discussion: http://www.universalmediaserver.com/forum/viewtopic.php?p=17074#p17074 Maybe false hope but testing it can avoid going by blind way that problem is on server side.

mine260309 commented 9 years ago

@ExSport Yes, I checked that but it is trying another transcode option and does not provide useful information in my case. But thanks anyway :)

ExSport commented 9 years ago

@mine260309 Not sure if I understand :-) ...but it is trying another transcode option... The info provided there is that when file is transcoded, PMS/UMS doesn't change extension of file so AVI transcoded to MPEG is sent as AVI and not as MPG. Some renderers can result by refusing such file. Testing changing this extension can avoid that PS4 is such renderer which doesn't like it. As discussion describes, same RAW file in different container FLV/MKV, one is played, other one not. It seems to me that FFmpeg generates different output in MPEG for same RAW file but for different container or that FFmpeg outputs similar playable data but with different extension. One with FLV is ok on PS4 but other one not (as MKV). It is only shot in the dark but worth to test it :+1:

mine260309 commented 9 years ago

Wait, I've got some good news! Now PS4 is playing transcoding stream by mencoder, from mkv to MPEG-TS with external ass subtitle. It's inspired by the discussion, that extension matters, at least for .ts and .mkv.

What I tried: based on previous observation, rename the file .mkv to .ts, and browse into Transcode folder, select mencoder. In this case, PMS knows the file is MKV because it actually parses the the file content, PS4 knows it's a TS file, and PMS is serving TS stream ---- bang, it works!

Conclusion: PS4 checks file extension and expect the file format. It's not dc:title but the URL. So UseSameExtension does not work.

So a workaround (or a hack) here is to append .ts to all transcoded contents' URL, and let PMS (or UMS) transcode to MPEG-TS with mencoder (I didn't test ffmpeg yet), it should work!

mine260309 commented 9 years ago

I probably will have time to make such changes tomorrow, @ExSport you guys can test my findings (append expect extension in URL) in UMS as well :)

Kimau commented 9 years ago

Which version of UMS should we be testing this with?

mine260309 commented 9 years ago

@Kimau I'm not sure, a simple summary of my changes to PMS are:

  1. In DLNAResource.java, let it always restart the transcode external process so that PS4 is receiving the whole data from the beginning every time it sends request;
  2. In config file, set TranscodedVideoFileSize to 100000000000, set SeekByTime to false

I'm not sure if both the changes are necessary or not, it requires more test.

ExSport commented 9 years ago

@mine260309 It is exactly what I recommended to test and it is creating URL link with specific extension. I expected that this behavior can be achieved without recompile by using:

UseSameExtension =flv

in renderer.conf file but it seems it changes extension only on display and not also in URL or that SubJunk incorrectly created patch for it in latest test snapshot published in forum as log says:

TRACE 10:26:30.351 [nioEventLoopGroup-3-16] Network debugger: "flv1.mkv.flv" http-get:*:video/x-matroska:DLNA.ORG_OP=01 size=134397271 duration=00:41:07.00 http://192.168.1.100:5001/get/32/flv1.mkv

FileName is changed but not in URL. Must test it by own how it behaves (I was sure it changes not only name on display but also URL):-) Anyway my thought was correct. PS4 is sensitive on extension of file which is sent to it :+1: Glad I helped:-)

ExSport commented 9 years ago

@mine260309 Btw. how now behaves PMS (without your changes)?

In DLNAResource.java, let it always restart the transcode external process so that PS4 is receiving the whole data from the beginning every time it sends request;

How this change is friendly with FF/RW etc.? I thought that PMS already did that, it sent transcoded stream from start as PS3 asked (chunked/non-chunked)

ExSport commented 9 years ago

Now tested (I don't have PS4) and I can confirm "UseSameExtension =" changes displayname only and not URL itself as I expected.

mine260309 commented 9 years ago

It turns out that the changes Always restart transcoder, TranscodedVideoFileSize and SeekByTime are all unnecessary. The key to make it work with PS4 is just the file extension.

I've made commits on branch dev-ps4, check the latest commit beb0f602, it works very well!

mine260309 commented 9 years ago

The next steps are:

  1. Transcode DTS to AC3
  2. Implement seek