Page 1 of 1

Playstation and MKV issue

PostPosted: Thu Jan 27, 2011 7:46 pm
by jac2703
Hi,

I am unable to play most of the mkv files served from Serviio to my PS3. Some mkv files however work perfectly!

One example in particular is the below mkv. The error on the PS3 is "The datatype is not supported". I can run the following command from the windows machine which hosts Serviio without an issue:
  Code:
C:\Program Files\Serviio\lib>ffmpeg -i "H:\TV Shows\Bored to Death\Bored to Death - s01e01 - Stockholm Syndrome - 720p BluRay.mkv" -y -vcodec copy -copyts -acodec ac3 -ab 192k -vbsf h264_mp4toannexb -sn -f mpegts transcoding-temp-2868-MPEG2TS.stf


I can play the above STF file using Windows Media Player so the transcoding is working, just not for the PS3.

The ffmpeg -i output is:
  Code:
C:\>"C:\Program Files\Serviio\lib\ffmpeg.exe" -i "H:\TV
 Shows\Bored to Death\Bored to Death - s01e01 - Stockholm Syndrome - 720p BluRay
.mkv"
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 10 2011 21:46:22 with gcc 4.4.2
  configuration: --enable-static --disable-shared --disable-shared --disable-ffp
lay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --arch=x86 --e
nable-runtime-cpudetect --enable-w32threads --target-os=mingw32 --cross-prefix=i
686-mingw32-
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.92. 0 / 52.92. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.72. 0 /  1.72. 0
  libswscale     0.12. 0 /  0.12. 0
[matroska,webm @ 003dd0d0] Estimating duration from bitrate, this may be inaccur
ate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/
1001) -> 23.98 (48000/2002)
Input #0, matroska,webm, from 'H:\TV Shows\Bored to Death\Bored to Death - s01e0
1 - Stockholm Syndrome - 720p BluRay.mkv':
  Duration: 00:29:57.75, start: 0.000000, bitrate: 1536 kb/s
    Chapter #0.0: start 0.000000, end 51.051000
    Metadata:
      title           : 00:00:00.000
    Chapter #0.1: start 51.051000, end 438.480000
    Metadata:
      title           : 00:00:51.051
    Chapter #0.2: start 438.480000, end 919.168000
    Metadata:
      title           : 00:07:18.480
    Chapter #0.3: start 919.168000, end 1484.400000
    Metadata:
      title           : 00:15:19.168
    Chapter #0.4: start 1484.400000, end 1744.451000
    Metadata:
      title           : 00:24:44.400
    Chapter #0.5: start 1744.451000, end 1797.754000
    Metadata:
      title           : 00:29:04.451
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 fp
s, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: dca, 48000 Hz, 5.1, s16, 1536 kb/s
    Stream #0.2(eng): Subtitle: [0][0][0][0] / 0x0000
At least one output file must be specified


To rule out some possible issues I have tried the same file, via Serviio, but from a windows based player XBMC which works fine.

Any help would be appreciated.

Re: Playstation and MKV issue

PostPosted: Thu Jan 27, 2011 11:52 pm
by patters
Can you find out what Profile Level the H.264 in that file is at? Use TSMuxerGUI to take a look. If it's higher than 4.1 the PS3 will refuse to play it, even if FFMPEG can remux it to m2ts (which is what the PS3 device profile is telling it to do).

Re: Playstation and MKV issue

PostPosted: Fri Jan 28, 2011 12:02 am
by jac2703
Hi patters,

It reads Profile: High@4.1

Re: Playstation and MKV issue

PostPosted: Fri Jan 28, 2011 12:18 am
by jac2703
I have been digging further into this issue. It appears that making the following modification to the PS3 profile:
  Code:
         <Video targetContainer="mpegts" targetACodec="ac3" forceVTranscoding="true" targetVCodec="mpeg2video">
            <Matches container="matroska" />
            <Matches container="avi" vCodec="h264" />
                        <Matches container="mpegts" aCodec="dca" />

         </Video>


The issue is resolved and all MKV files play on the PS3.

I am not sure how sustainable this is as playing a 4GB MKV has resulted in 100% CPU usage on all 3 cores.

A common factor in the 5 (previously not working) MKV files is at least one audio DTS track. How can I force Serviio to transcode only DTS audio to AC3? If nothing else, it will remove the thought that DTS is to blame (note: apparently DTS audio is supported by the PS3).

Any other thoughts?

Re: Playstation and MKV issue

PostPosted: Fri Jan 28, 2011 12:27 am
by patters
The unmodified PS3 device profile was already remuxing all mkv files to m2ts (preserving the h264 video stream) and transcoding all audio to ac3, including dts.
What you have there is transcoding of all audio and video hence the large CPU load.

Re: Playstation and MKV issue

PostPosted: Fri Jan 28, 2011 1:26 am
by jac2703
In summary, changing the profile to encode all video and audio has enabled the PS3 to play all encountered MKVs. I currently have about 10 different MKV encoding sources which I have been using to test.

So I guess the question is; what was not being transcoded before which needs to be?

I am not 100% on the profile xml so I will have a read of
http://www.serviio.org/index.php?option=com_content&view=article&id=24
tomorrow and see if I can loosen the net and see at what point different MKV files stop working.

patters, as you seem to be a whizz with the profiles is there any chance you could write me two simple profiles (ideally just for MKV files); one for transcode all audio and never video, one for all video and never audio? If you don't have time, no worries, I will figure it out tomorrow. If you do have time... Appreciated!

I have read posts on other sites where people have suggested remuxing all MKV files for similar issues. Is there nobody else here with similar issues on the PS3?

Re: Playstation and MKV issue

PostPosted: Fri Jan 28, 2011 6:19 pm
by patters
jac2703 wrote:patters, as you seem to be a whizz with the profiles is there any chance you could write me two simple profiles (ideally just for MKV files);

(1) for transcode all audio and never video,
(2) for all video and never audio?

If you don't have time, no worries, I will figure it out tomorrow. If you do have time... Appreciated!


These should work, but it's one or the other. Matches are processed in the order they are described in the XML.

(1):

  Code:
      <Transcoding>
         <Video targetContainer="mpegts" targetACodec="ac3">
            <Matches container="matroska" />
         </Video>
      </Transcoding>



(2):

  Code:
      <Transcoding>
         <Video targetContainer="mpegts" targetVCodec="mpeg2video">
            <Matches container="matroska" />
         </Video>
      </Transcoding>

Re: Playstation and MKV issue

PostPosted: Mon Jan 31, 2011 6:58 pm
by jac2703
Thanks for your help patters - much appreciated.

I haven't had much time to play with this but it is still on my 'to-do'.

I did however, find another issue which is loosely being discussed at the below link.
http://forum.serviio.org/viewtopic.php?f=7&t=1010&start=0

The audio of some Matroska files does not play on the Playstation 3. It appears to be because the converted AC3 audio is encoded at an invalid (as far as the PS3 is concerned) bitrate. I noticed it on DTS encoded audio - not sure if that is a link or just a coincidence. Adding 'aBitrate="384"' without the single quotes ['] to the profiles XML sorts it out. Maybe someone who knows a little more about it can decide if it might be worth adding this to the default release profile?

Anyway, for anyone else having PS3 MKV issues, I am using the following transcoding config. It encodes just about everything at the moment which needs 'loosening' to conserve resource but it does play everything. I have tested it on about 10 different MKV sources and all play perfectly. Compared with the default profile which played about 30% of that, but at the expense of extra resource transcoding everything.

  Code:
<Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="mpeg2video" aBitrate="384">
  <Matches container="matroska" />                     

</Video>


I cant believe more people are not having a similar issue; after all, loads of people must have a Playstation 3 and Serviio is simply brilliant!

Re: Playstation and MKV issue

PostPosted: Tue Feb 01, 2011 8:57 am
by Illico
jac2703 wrote:...The audio of some Matroska files does not play on the Playstation 3. It appears to be because the converted AC3 audio is encoded at an invalid (as far as the PS3 is concerned) bitrate. I noticed it on DTS encoded audio - not sure if that is a link or just a coincidence. Adding 'aBitrate="384"' without the single quotes ['] to the profiles XML sorts it out. Maybe someone who knows a little more about it can decide if it might be worth adding this to the default release profile? ...Compared with the default profile which played about 30% of that, but at the expense of extra resource transcoding everything.

  Code:
<Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="mpeg2video" aBitrate="384">
  <Matches container="matroska" />                     

</Video>
...


I also add this "aBitrate" option for the Sony Bravia TV profile, see the FAQ section: viewtopic.php?f=11&t=425#p2339
- I have a sound/audio problems when playing movie. The video seem to be working just fine: Its probably due to audio bitrate issue #201 --> Fixed since version 0.5