INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Streaming HD video to a 2010 Bravia (partial success!)  (Read 8468 times)

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Streaming HD video to a 2010 Bravia (partial success!)
« on: July 06, 2014, 12:39:03 pm »

Back when I first started using Media Center, I tried to get video streaming working to the televisions in the house, and never got anywhere.
The only thing which worked correctly was the default "Sony BD/TV" preset, but the video quality was terrible as it was only sending an SD MPEG2 stream.
 
Using the "Device Spy" tool from the Intel UPnP development tools, I was able to get a list of all the formats that the televisions report they accept:
 
Code: (GetProtocolInfo) [Select]
http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_FLAGS=8cf00000000000000000000000000000,
http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_FLAGS=8cf00000000000000000000000000000,
http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_FLAGS=8cf00000000000000000000000000000,
http-get:*:audio/L16:DLNA.ORG_PN=LPCM;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_60_AC3_T;SONY.COM_PN=AVC_TS_HD_60_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_50_AC3_T;SONY.COM_PN=AVC_TS_HD_50_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_60_AC3;SONY.COM_PN=AVC_TS_HD_60_AC3;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_50_AC3;SONY.COM_PN=AVC_TS_HD_50_AC3;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_60_AC3_ISO;SONY.COM_PN=AVC_TS_HD_60_AC3_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_50_AC3_ISO;SONY.COM_PN=AVC_TS_HD_50_AC3_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_EU_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_EU;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_EU_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_NA_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_KO_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_NA;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_KO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_NA_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_KO_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_NA_MPEG1_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_60_L2_T;SONY.COM_PN=HD2_60_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_HD_50_L2_T;SONY.COM_PN=HD2_50_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_NA_MPEG1_L2_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_60_L2_ISO;SONY.COM_PN=HD2_60_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_HD_50_L2_ISO;SONY.COM_PN=HD2_50_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_60_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_50_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_JP_MPEG1_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_MPEG1_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_60_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_50_L2_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_MPEG1_L2_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_24_AC3_T;SONY.COM_PN=AVC_TS_HD_24_AC3_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_HD_24_AC3;SONY.COM_PN=AVC_TS_HD_24_AC3;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_24_AC3_ISO;SONY.COM_PN=AVC_TS_HD_24_AC3_ISO;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=AVC_TS_JP_AAC_T;DLNA.ORG_FLAGS=8d700000000000000000000000000000,
http-get:*:video/x-mp2t-mphl-188:*

 
Through some trial and error, I was able to determine a few things:

1.  It's a small thing, but enabling the "PlayStation 3 compatible" option for the server makes the cover art display about twice the size it would otherwise when playing music rather than video.

2.  The MIME Type video/vnd.dlna.mpeg-tts does not work with any of the formats that Media Center will convert to - it must be video/mpeg

3.  While SD MPEG2 works correctly using MPEG_PS_NTSC or MPEG_PS_PAL, none of the HD MPEG2 formats display correctly.
All of the formats like: MPEG_TS_HD_NA_ISO do display an image when using the MPEG2-TS encoding options, but they all result in a letterboxed (vertically compressed) image for some reason.
I'm not sure if this is a Media Center issue, or an issue with the televisions. The zoom options are still available on the televisions during playback, so in theory you could encode an anamorphic signal to work around it.

4.  I was able to get the H264-TS options working! From reading around the net, and my previous attempts at getting this working, it looked like the 2010 sets simply did not support AVC over DLNA.
The following formats work:
  • AVC_TS_HD_24_AC3_ISO
  • AVC_TS_HD_50_AC3_ISO
  • AVC_TS_HD_60_AC3_ISO
  • AVC_TS_HD_EU_ISO


There are a few remaining issues though:

1.  If I stop playback via the TV remote, Media Center reports a playback error, and skips to the next item in the playlist instead of stopping.
This is the same behavior I saw with the SRS-X7 speakers I bought a while back too. I don't know if it's a general DLNA issue, or specific to Sony.
 
2.  While I now have HD streaming working, the H264 encoder seems ridiculously demanding.
My CPU is stuck at 100% the entire time something is playing, and I am only able to stream YouTube quality videos to the television smoothly. Even then, the sound will often go out of sync.
If I try to stream a Blu-ray or DVD, playback starts stuttering less than a minute in.

Are there plans to move towards hardware accelerated encoding? (NVENC/QuickSync)

MPEG2 encoding at least leaves the system usable as it hovers around 30-40% CPU during playback.
The problem is that your only options there are SD (very low quality) or a vertically squashed HD image.
Aside from the squashed image, the MPEG2-TS stream seems to be of acceptable quality.

I'm also wondering if re-encoding is actually necessary if the video is already H.264 encoded?
I know there are potential issues like the television not supporting the current profile, but it seems like putting the existing H.264 stream into an H264-TS container would require a lot less CPU power.


3.  The TV uses different Video DLNA Override values depending on the framerate of the video. While Media Center has the option to encode "autofps" streams, I don't see a way to let MC switch between 24/50/60fps.
That said, the typical "1080p24" overlay does not appear when streaming a 24p video, so I'm not sure if it is actually switching the TV to 24Hz anyway.

4.  I've had Media Center crash a couple of times when seeking via the TV (which is also very slow) so it doesn't seem to be especially stable.
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392
Re: Streaming HD video to a 2010 Bravia (partial success!)
« Reply #1 on: July 08, 2014, 10:07:52 pm »

^

Just so you know..

Auto negotiation between a renderer's SinkProtocolInfo and MC's Source capability, is a topic that a) I have been pushing for, and b) where I am working on an independent tool to help. (You found a partial solution by trial and error, but not all users are so capable, and so I am building a tool that should add some intelligence to the process..)
Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Streaming HD video to a 2010 Bravia (partial success!)
« Reply #2 on: July 09, 2014, 06:59:17 am »

That sounds like it would be pretty useful.
It does seem like an area where Media Center could be better.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13521
Re: Streaming HD video to a 2010 Bravia (partial success!)
« Reply #3 on: July 10, 2014, 09:54:02 pm »

The MIME Type video/vnd.dlna.mpeg-tts seems to be bogus in the TV's SinkProtocolInfo.
Most of those strings seem to be just hacked together in some wishful thinking sort of way.
With our Sony I can send exactly that string it's looking for with exactly the right content and it doesn't work, in fact it doesn't even try to read the URI. Another broken SinkProtocolInfo example IMO.
Setting the Playstation 3 switch allows the larger coverart to be sent in a way that breaks the protocol but that the PS3 accepts.
MPEG2 of course only supports certain sizes. We fit to the maximum size supported horizontally or vertically with the applied aspect ratio.
Converting to 1080p in realtime will take 4 cores on a good machine. It will run at 100% until it gets a certain way ahead of the demand from the TV.
Unless your TV supports time based seeks you will not have a fun time seeking during transcoding. The crash is probably because of multiple transcodings started during the seek.
If the TV allows you to set the seek mode to "skip" you might want to try that.
Since there are a lot of H264 profiles and the TV only supports some of them, you may or may not have to transcode. Also note that it is more common for devices to accept AAC audio than AC3 with the H264 video.
MPEG2 encoding doesn't use all of the CPU because it isn't multithreaded. A limitation of libav.
I don't think the TV pays any attention to the supplied framerate in the DLNA flags that it advertizes in SinkProtocolInfo.
If MC has a playlist of videos when you hit stop on the remote and you have started the playback from MC, I'd expect that it'd go on to the next one. It has no idea that the TV itself has stopped playback. You could turn repeat for that zone to stop after each item.






Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Streaming HD video to a 2010 Bravia (partial success!)
« Reply #4 on: July 10, 2014, 10:34:08 pm »

Thanks for the reply bob.
 
The MIME Type video/vnd.dlna.mpeg-tts seems to be bogus in the TV's SinkProtocolInfo.
Most of those strings seem to be just hacked together in some wishful thinking sort of way.
With our Sony I can send exactly that string it's looking for with exactly the right content and it doesn't work, in fact it doesn't even try to read the URI. Another broken SinkProtocolInfo example IMO.
Well that explains why none of it was working. I did suspect that these TVs just have a poor renderer/implementation of DLNA since they're 2010 sets, and some of the first Smart TVs.

Setting the Playstation 3 switch allows the larger coverart to be sent in a way that breaks the protocol but that the PS3 accepts.
Interesting. Well, it also works on the TV so that's a small improvement.

MPEG2 of course only supports certain sizes. We fit to the maximum size supported horizontally or vertically with the applied aspect ratio.
It's very strange though. It just looks like 1080p that has been scaled down to something like 1920x800 as if it were a proper letterboxed movie. (but the image is obviously stretched)
I guess it's just another thing that is broken in the TV.

Converting to 1080p in realtime will take 4 cores on a good machine. It will run at 100% until it gets a certain way ahead of the demand from the TV.
Yes, that's why I was wondering if it were possible to extract the MP4 content from an MKV and package it into an H264-TS file instead of re-encoding.
 
Or support hardware accelerated encoding via NVENC/QuickSync.

Unless your TV supports time based seeks you will not have a fun time seeking during transcoding. The crash is probably because of multiple transcodings started during the seek.
That probably explains it - seeking is very slow with video. Barely 2x speed.

If MC has a playlist of videos when you hit stop on the remote and you have started the playback from MC, I'd expect that it'd go on to the next one. It has no idea that the TV itself has stopped playback. You could turn repeat for that zone to stop after each item.
For videos, I could just set it to stop after each item, but it's not great for audio.
 
So does this mean that my TV doesn't support sending a "stop" command and simply tries to break the connection, which MC restores immediately?
 
While my TV clearly doesn't support it, is there a proper "stop" command over DLNA that would allow for this control from the renderer, or is this a DLNA limitation?
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13521
Re: Streaming HD video to a 2010 Bravia (partial success!)
« Reply #5 on: July 10, 2014, 10:49:23 pm »

It's very strange though. It just looks like 1080p that has been scaled down to something like 1920x800 as if it were a proper letterboxed movie. (but the image is obviously stretched)
I guess it's just another thing that is broken in the TV.
I seem to recall that happening on our Sony as well. I think I decided that it was indeed broken (over DLNA anyway).
Quote
Yes, that's why I was wondering if it were possible to extract the MP4 content from an MKV and package it into an H264-TS file instead of re-encoding.
I agree that would be a good enhancement. It would probably only work with AAC audio in an MKV though.
Quote
Or support hardware accelerated encoding via NVENC/QuickSync.
Sounds like a job for Hendrik!
Quote
That probably explains it - seeking is very slow with video. Barely 2x speed.
It's probably the max rate your computer can transcode the video.
I kind of thought our Sony supported time based seeks, I don't recall how.
On the PS3 you don't really do it in realtime, you move a slider to the place you want to seek to then hit the action button and it happens immediately.
Quote
For videos, I could just set it to stop after each item, but it's not great for audio.
So does this mean that my TV doesn't support sending a "stop" command and simply tries to break the connection, which MC restores immediately?
While my TV clearly doesn't support it, is there a proper "stop" command over DLNA that would allow for this control from the renderer, or is this a DLNA limitation?
It's a bit of a DLNA controller limitation. When a track (in this case video) stops playing and there is a playlist it's assumed the end has been reached and it's time to push the next track in the playlist. This could happen by seeking with MC as the controller or just reaching the end of the video or in your case reaching the end by hitting stop on the remote.
If you want to start a video in MC on the TV you could just right-click on it and do send-to the device -> play instead of double clicking on the movie in a list of files. That way only the one movie will be sent as the "playlist".
Logged
Pages: [1]   Go Up