PS4 now support DLNA!

For help and support with Universal Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
User avatar
SubJunk
Lead Developer
Posts: 3238
Joined: Sun May 27, 2012 4:12 pm

Re: PS4 now support DLNA!

Post by SubJunk » Tue Jul 07, 2015 5:58 pm

creighton wrote:
SubJunk wrote:Thanks for the logs :) I'm very confused now since it seems to me that we are doing the exact same thing in both cases, but the PS4 only likes one. I've made a new build with extra logging to try to uncover what the difference is. Can you please try both files the same way with this version?
http://www.spirton.com/uploads/UMS/UMS-3b723fa.exe
Tried both under forced transcoding with FFmpeg, the .flv worked and the .mkv failed as expected.

From taking a peek into the log, it seems the command for the .mkv is missing some pipe information? Obviously I know nothing about the underlying code here, just taking a stab in the dark.

Code: Select all

C:\Program Files (x86)\Universal Media Server\win32\ffmpeg.exe -fflags +genpts -y -loglevel info -i Z:\test\flv1.flv -ab 384k -c:a ac3 -c:v copy -bsf:v h264_mp4toannexb -f mpegts \\.\pipe\ffmpegvideo_48_1436194527665

C:\Program Files (x86)\Universal Media Server\win32\ffmpeg.exe -i Z:\test\flv1.mkv -vframes 1 -c:v copy -f h264 -bsf h264_mp4toannexb -an -y pipe:
Hi Creighton,
That second FFmpeg command isn't the transcoding one; they are identical. I've copied the following info from the debug log hoping that there would be a difference but there isn't, so I guess there is some other change we aren't logging or I'm not looking at:

flv1.mkv:

Code: Select all

<item id="68" parentID="31" restricted="true">
	<dc:title>
		[FFmpeg] {Audio: AAC ()}
	</dc:title>
	<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AC3_ISO;DLNA.ORG_OP=10" duration="00:41:07.00" resolution="432x240" bitrate="54474" nrAudioChannels="2" sampleFrequency="44100">
		http://192.168.1.100:5001/get/65/flv1.mkv
	</res>
	<upnp:albumArtURI xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" dlna:profileID="JPEG_TN">
		http://192.168.1.100:5001/get/65/thumbnail0000flv1.mkv
	</upnp:albumArtURI>
	<upnp:albumArtURI xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" dlna:profileID="JPEG_SM">
		http://192.168.1.100:5001/get/65/thumbnail0000flv1.mkv
	</upnp:albumArtURI>
	<dc:date>2015-07-05T13:15:48</dc:date>
	<upnp:class>object.item.videoItem</upnp:class>
</item>
Starting C:\Program Files (x86)\Universal Media Server\win32\ffmpeg.exe -fflags +genpts -y -loglevel info -i Z:\test\flv1.mkv -ab 384k -c:a ac3 -c:v copy -bsf:v h264_mp4toannexb -f mpegts \\.\pipe\ffmpegvideo_45_1436194571972
flv1.flv:

Code: Select all

<item id="69" parentID="28" restricted="true">
	<dc:title>
		[FFmpeg] {Audio: AAC ()}
	</dc:title>
	<res xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" protocolInfo="http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_MP_HD_AC3_ISO;DLNA.ORG_OP=10" duration="00:41:07.00" resolution="432x240" bitrate="55207" nrAudioChannels="2" sampleFrequency="44100">
		http://192.168.1.100:5001/get/66/flv1.flv
	</res>
	<upnp:albumArtURI xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" dlna:profileID="JPEG_TN">
		http://192.168.1.100:5001/get/66/thumbnail0000flv1.flv
	</upnp:albumArtURI>
	<upnp:albumArtURI xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" dlna:profileID="JPEG_SM">
		http://192.168.1.100:5001/get/66/thumbnail0000flv1.flv
	</upnp:albumArtURI>
	<dc:date>2014-11-10T19:12:53</dc:date>
	<upnp:class>object.item.videoItem</upnp:class>
</item>
Starting C:\Program Files (x86)\Universal Media Server\win32\ffmpeg.exe -fflags +genpts -y -loglevel info -i Z:\test\flv1.flv -ab 384k -c:a ac3 -c:v copy -bsf:v h264_mp4toannexb -f mpegts \\.\pipe\ffmpegvideo_48_1436194527665

ExSport
Posts: 596
Joined: Wed Oct 10, 2012 1:57 am

Re: PS4 now support DLNA!

Post by ExSport » Tue Jul 07, 2015 9:05 pm

Shot in the dark (defined in renderer.conf):

Code: Select all

# Specified extension will be added to every file shared by UMS
# Default: ""
UseSameExtension = 
I know some renderers internally parses files diferently, depending on the extension (not only dependent on ProtocolInfo).
So file with mpeg stream inside, with mpeg defined in ProtocolInfo but with invalid extension, some renderers play ok, others not.
So you can try to force all files are sent with mpeg or flv extension to see the difference on PS4.
As SubJunk wrote, the info sent in response seems similar so if file itself is also similar, problem can be extension [or nuances in transcoded file (FFmpeg outputs different file depending on input file)]

User avatar
SubJunk
Lead Developer
Posts: 3238
Joined: Sun May 27, 2012 4:12 pm

Re: PS4 now support DLNA!

Post by SubJunk » Tue Jul 07, 2015 9:51 pm

Good idea, here's a build that tries that:
http://www.spirton.com/uploads/UMS/UMS-20c8c76.exe

creighton
Posts: 15
Joined: Fri Jun 19, 2015 8:35 am

Re: PS4 now support DLNA!

Post by creighton » Wed Jul 08, 2015 2:11 am

SubJunk wrote:Good idea, here's a build that tries that
Well, I think ExSport is onto something good with that idea. The newest test build didn't seem to make a difference, but then I thought to change my testing method.

Here's the files I used and the results:

Code: Select all

- [flv1.flv] [H264/AAC] - transcode worked with FFmpeg!
- [flv1.mkv] [H264/AAC] - transcode failed.
- [flv1-mkv_rename.flv] - Exact file copy of flv1.mkv, with file extension changed to .flv - transcode worked with FFmpeg!

- [transcode1.mkv] [H264/DTS(Eng)/DTS(Fre)] - transcode failed.
- [transcode1-mkv_rename.flv] - Exact file copy of transcode1.mkv, with file extension changed to .flv - transcode worked with FFmpeg!
Log attached.
Attachments
20c8c76a0.zip
(70.4 KiB) Downloaded 187 times

ExSport
Posts: 596
Joined: Wed Oct 10, 2012 1:57 am

Re: PS4 now support DLNA!

Post by ExSport » Wed Jul 08, 2015 2:40 am

So the answer is:
  • SubJunk incorrectly implemented the tip (Sorry SubJunk!, I know it can be bug in "UseSameExtension =" interpretation :-))
  • "UseSameExtension =" changes filename on display only and not in URL itself as I expected 8-)
Another info confirming my hypothesis here:
https://github.com/mine260309/ps3medias ... -119219496

ExSport
Posts: 596
Joined: Wed Oct 10, 2012 1:57 am

Re: PS4 now support DLNA!

Post by ExSport » Wed Jul 08, 2015 2:56 am

Now tested (I don't have PS4) and I can confirm "UseSameExtension =" changes displayname only and not URL itself as I expected. 8-)
It means SubJunk have to create another testbuild :mrgreen:

User avatar
SubJunk
Lead Developer
Posts: 3238
Joined: Sun May 27, 2012 4:12 pm

Re: PS4 now support DLNA!

Post by SubJunk » Wed Jul 08, 2015 8:08 am

This is exciting! I'll make it in about 9 hours after work :) In the meantime if you get a chance creighton can you please check if the same thing works for files that need the video to be transcoded, like the H.265 ones in the test suite, or any video with subtitles?

Audioboxer
Posts: 15
Joined: Mon Nov 26, 2012 9:30 am

Re: PS4 now support DLNA!

Post by Audioboxer » Wed Jul 08, 2015 9:24 am

Thanks for the ongoing work guys! My PS3 hasn't been retired.... yet! :lol:

creighton
Posts: 15
Joined: Fri Jun 19, 2015 8:35 am

Re: PS4 now support DLNA!

Post by creighton » Wed Jul 08, 2015 10:34 am

SubJunk wrote:This is exciting! I'll make it in about 9 hours after work :) In the meantime if you get a chance creighton can you please check if the same thing works for files that need the video to be transcoded, like the H.265 ones in the test suite, or any video with subtitles?
Wasn't sure what you meant by a video with subtitles. I failed to mention before that my transcode1.mkv/flv file has internal subtitles. I tried selecting a FFmpeg option from the transcode folder that included subs, but it did not appear to be working (PS4 hung on the spinning loading circle for a very long time, UMS did not seem to be doing anything transcode-wise).

I also picked out a few videos from each category of the test suite and gave them an flv extension. Results...

Code: Select all

AVI-XviD-AC3-2ch - these working fine with FFmpeg
AVI-XviD-MP2-2ch
MKV-H264-FLAC-6ch
MKV-H264-MP2-2ch

MKV-H265-AC3-6ch - these only working with Mencoder
MKV-H265-DTS-6ch
MKV-H265-MP2-2ch

MKV-XviD-AACHE-2ch - these only working with Mencoder
MKV-XviD-AACLC-6ch
MKV-XviD-DTS-6ch

MP4-H264-AACHE-2ch - these working fine with FFmpeg
MP4-H264-AACHE-6ch

MP4-XviD-MP2-2ch - these only working with Mencoder
MP4-XviD-MP3-2ch

carbontoast
Posts: 2
Joined: Sun Jun 21, 2015 12:02 pm

Re: PS4 now support DLNA!

Post by carbontoast » Wed Jul 08, 2015 5:24 pm

Interesting!

Using UMS-3b723fa.exe.

First attachment is a log trying to play "12 Monkeys.mkv" that I ripped with makemkv into a mkv container with the original mpgv (mpeg-2) encoding. Has failed with every UMS version including this one.

However, second log attachment is the PS4 playing the same file, simply renamed "12 Monkeys.ts" and it works! Without using the #TRANSCODING folder, too.
It seems that the PS4 is quite interested in the extension of the file it is playing. Which is weird since its still a mkv container; I don't pretend to know why this works.

Not sure this is the answer to all problems, but my biggest issue was that I couldn't play any of the DVDs I had ripped. Now I can. One step closer :mrgreen:

Credit to mine260309 in the thread ExSport referred to:
https://github.com/mine260309/ps3medias ... -119219496
Attachments
ums_dbg_3b723fa1a-works.zip
Play same 12 Monkeys.mkv, but just renamed with .ts extension. Works!
(33.84 KiB) Downloaded 181 times
ums_dbg_3b723fa1a-fail.zip
Trying to play 12 Monkeys.mkv, fails.
(32.47 KiB) Downloaded 186 times

Post Reply