Page 1 of 1

.mkv files stuttering on PS3

PostPosted: Tue Apr 02, 2013 10:26 pm
by S222NEY
I know this isn't a new issue, please bare with me as I've been working on this for sometime and have read as much as I can find on the forum. I'm having real issues streaming .mkv files to my PS3 from Serviio.

In the first instance, a lot of the files wont play at all. So, having read around, I have added the modified PS3 profile that I understand trancodes everything. This appeared to fix my problem, initially. After about a minute or so of smooth playback, the video starts to stutter.

To begin with, I assumed this was because my media server is an old Dell machine, running a Pentium 4 3.0GHz processor (1Gb RAM). It starts making a lot of fan noise when the ffmpeg sends CPU usage to 100% when transcoding. What I don't understand, is that the same computer will stream the same file to my Bravia TV (2010 KDL-46HX803) without any problems at all?

This is the file in question:

  Code:
General
Complete name                            : Y:\[removed].mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 1.46 GiB
Duration                                 : 26mn 5s
Overall bit rate                         : 7 988 Kbps
Writing application                      : x264.exe
Writing library                          : mkv2rls v1.4 (date: 2011 mar 29)

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 26mn 5s
Bit rate                                 : 6 472 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.293
Stream size                              : 1.15 GiB (79%)
Writing library                          : x264 core 115 r2008 4c552d8
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=6472 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 26mn 5s
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 282 MiB (19%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:00:00:00.000
00:01:20.289                             : en:00:01:20.289
00:10:06.064                             : en:00:10:06.064
00:19:05.895                             : en:00:19:05.895
00:24:55.577                             : en:00:24:55.577



I'd be grateful of any help trying to get to the bottom of this as I'd really like to use my PS3 as the player for all my media rather than using the TV for some and PS3 for others. I'm having similar problems with other .mkv files, some of which stutter on the TV as well, however I needed to start somewhere?

Thanks for your help.

Re: .mkv files stuttering on PS3

PostPosted: Tue Apr 02, 2013 10:34 pm
by zip
If you transcode everything to PS3 and not to the Bravia (if using the Bravia profile), then there is difference in performance, definitely.

Re: .mkv files stuttering on PS3

PostPosted: Tue Apr 02, 2013 11:11 pm
by S222NEY
Thanks for the quick reply zip.

I've just tested another .mkv direct to the TV and judging by CPU usage and the stuttering, this file did need to be transcoded. I suppose this points to a hardware performance issue.

Do you have any idea why the PS3 has such a hard time with .mkv files as it just refuses to play a lot of the file I have. If I didn't need to transcode all the time, I dont think I'd be having the problem.

Re: .mkv files stuttering on PS3

PostPosted: Wed Apr 03, 2013 12:47 am
by DenyAll
The PS3 doesn't support MKV files natively. The standard Serviio profile for the PS3 will transcode these files if the h264 profile level is 4.1 and above (which the example you posted is); or remux them (possibly transcoding audio only) if below 4.1. Remuxing, even with audio transcoding, is far less processor intensive that video transcoding. This is why I suspect some of your mkv's work and others struggle (some are 4.1 and above, others are below).

Don't know if this will work, but you could try removing (comment out) these two lines from the PS3 profile (I suspect it wont work, these lines are in for a reason, but it wont hurt to try. I cant test as I don't have any media of this type):

    <Matches container="*" vCodec="h264" profile="high" levelGreaterThan="4.1" />
    <Matches container="*" vCodec="h264" profile="main" levelGreaterThan="4.1" />
This will force Serviio to remux these files only (coded later in the profile), allowing them to still be played on the PS3 (if it indeed can handle this h264 profile). Remember to re-instate the lines if it doesn't work. Also, when ever you change anything in profiles.xml you need to restart the Serviio services (or reboot).

If this doesn't work then the only thing I can think of is to either get a more powerful PC :cry: or manually transcode all these files to a lower profile (that way you only do it once) :cry: :cry: . I used XMedia Recode to do this in the past, but there is plenty of software out there (and ffmpeg may be able to do it). You could also convert to an mp4 container at the same time which PS3's seem to handle better.

Re: .mkv files stuttering on PS3

PostPosted: Thu Apr 04, 2013 12:45 am
by S222NEY
DenyAll, thanks for your input. I've tried your suggestion with some mixed results. (I tested on my HTPC which has an AMD E450 APU)

The file detailed above didn't work with the modified profile, this will only play if its transcoded to MPEG2 which puts huge load on the CPU and subsequently starts to struggle after a minute or so. Serviio is still sending 5.1 audio, although the PS3 is reporting this as Dolby Digital, not DTS as per MediaInfo.

Removing the two lines hightlighted from the standard PS3 profile did work for this file:

  Code:
General
Unique ID                                : 75057309396976189840815044623829022263 (0x387783108CB4E28CBAD81A2CEBABB637)
Complete name                            : Y:\[removed].mkv
Format                                   : Matroska
Format version                           : Version 1
File size                                : 1.46 GiB
Duration                                 : 59mn 1s
Overall bit rate                         : 3 535 Kbps
Encoded date                             : UTC 2008-08-11 01:09:20
Writing application                      : mkvmerge v2.0.2 ('You're My Flame') built on Sep 20 2007 09:25:45
Writing library                          : libebml v0.7.7 + libmatroska v0.8.1

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 59mn 1s
Bit rate                                 : 3 148 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.137
Stream size                              : 1.27 GiB (87%)
Writing library                          : x264 core 59 859tw
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=hex / subme=6 / brdo=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=3148 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=1.00 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 1
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 59mn 1s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 162 MiB (11%)
Default                                  : Yes
Forced                                   : No



Usually, even on the standard PS3 profile, this file will transcode to MPEG2 - presumably because it is level 5.1. With the two lines of code turned off, it streams as AVC with the media server running at approx. 50% CPU as I assume it's remuxing and doesnt stutter. So the PS3 can cope with some h264 > L4.1 video?

I tested another file (below) - the will stream as AVC via the standard PS3 profile without the two lines removed with 5.1 DD audio.

  Code:
General
Unique ID                                : 222074949644652587411035322109786359100 (0xA712145CDB8280B98BD700F9B0F4853C)
Complete name                            : M:\test.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 1.10 GiB
Duration                                 : 36mn 1s
Overall bit rate                         : 4 355 Kbps
Encoded date                             : UTC 2013-03-17 08:49:51
Writing application                      : mkvmerge v4.9.1 ('Ich will') built on Jul 11 2011 23:53:15
Writing library                          : libebml v1.2.1 + libmatroska v1.1.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 36mn 1s
Bit rate                                 : 4 000 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.174
Stream size                              : 1 001 MiB (89%)
Writing library                          : x264 core 116 r2074 2641b9e
Encoding settings                        : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=4 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=4000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / vbv_maxrate=50000 / vbv_bufsize=50000 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 36mn 1s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 48ms
Stream size                              : 99.0 MiB (9%)
Default                                  : Yes
Forced                                   : No


Re: .mkv files stuttering on PS3

PostPosted: Thu Apr 04, 2013 3:05 am
by DenyAll
Confirming my understanding, if you use the standard PS3 profile with the two lines removed the results you get are:

  1. File 1: (from OP) AVC L4.1, DTS 5.1 - appears to be transcoded, resulting in high CPE, stuttering - FAIL
  2. File 2: AVC L5.1, AC3 2 channel - appears to be remuxed, 50% CPU, no stuttering - PASS
  3. File 3: AVC L4.1, AC3 5.1 - appears to be remuxed, no stuttering - PASS. This is the case with or without the lines in profiles.xml
Some conclusions:
  • In (1) above I suspect this file is only getting its audio transcoded, not its video (at least according to profiles.xml this is what should happen). If you want, enable detailed logging to see exactly what Serviio is doing to this file.
  • From (2) above it appears that the lines are not necessary. The PS3 (or at least, your PS3 - is it a later model one eg. the slimline?) seems to support L5.1 profiles. I would probably comment these lines out - general rule is if you don't need to transcode (especially video), then don't.
  • File 3 worked even with the 2 lines included in the profile. Here I may need to check my understanding: @zip - does levelGreaterThan="4.1" mean greater than or equal to 4.1, which was my understanding, or does it mean greater than 4.1 ie 4.2 and above (as it reads :oops:). If the latter, then this explains why it works with these lines included ie. they don't come into play for this 4.1 file.
That leaves the pesky first file. Two things come to mind: either DTS --> AC3 transcoding is processor intensive (anyone?) and your PC is struggling to convert the audio; or the other thing I notice is that this file has a 8Mbit/s data rate (6.5 video and 1.5 DTS) compared to 4.3Mbits for the other two files - your PC could simply be failing to keep up with that data rate.

Do you have other files that fail (when the two lines are removed)? If so, is the common factor DTS audio? If not, is the common factor high bit rate (above 4.5Mbps)? Also, on the Transcoding tab in Serviio Console, does the "Downmix to Stereo" option have any effect for these failing files?

Lastly: "although the PS3 is reporting this as Dolby Digital, not DTS as per MediaInfo.". AFAIK the PS3 doesn't support DTS. Serviio transcodes this to AC3 in all cases (ie. with or without the two lines - there is a reference later in the profile.xml that ensures audio is transcoded).

Re: .mkv files stuttering on PS3

PostPosted: Thu Apr 04, 2013 8:35 pm
by S222NEY
Thanks again. To confirm this is a later PS3 slim will all software updates installed.

I'm going to be as clear as I can with this feedback as this could get complicated...

DenyAll wrote:Confirming my understanding, if you use the standard PS3 profile with the two lines removed the results you get are:

  1. File 1: (from OP) AVC L4.1, DTS 5.1 - appears to be transcoded, resulting in high CPE, stuttering - FAIL -
  2. File 2: AVC L5.1, AC3 2 channel - appears to be remuxed, 50% CPU, no stuttering - PASS
  3. File 3: AVC L4.1, AC3 5.1 - appears to be remuxed, no stuttering - PASS. This is the case with or without the lines in profiles.xml


Correct, although in reference to File 1, to reiterate, this will only play with the modified 'Custom PS3' (below) profile where everything is transcoded. Turning off the two lines in the default PS3 profile made no difference.

  Code:
<Profile id="PS3custom" name="Playstation 3 * " extendsProfileId="4">
      <Transcoding>
         <!-- all other unplayable files just transcode to mpeg2 -->
         <Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" aBitrate="384">
            <Matches container="matroska" vCodec="h264" />
         </Video>
      </Transcoding>
   </Profile>


DenyAll wrote:Some conclusions:
  • In (1) above I suspect this file is only getting its audio transcoded, not its video (at least according to profiles.xml this is what should happen). If you want, enable detailed logging to see exactly what Serviio is doing to this file.
  • From (2) above it appears that the lines are not necessary. The PS3 (or at least, your PS3 - is it a later model one eg. the slimline?) seems to support L5.1 profiles. I would probably comment these lines out - general rule is if you don't need to transcode (especially video), then don't.
  • File 3 worked even with the 2 lines included in the profile. Here I may need to check my understanding: @zip - does levelGreaterThan="4.1" mean greater than or equal to 4.1, which was my understanding, or does it mean greater than 4.1 ie 4.2 and above (as it reads :oops:). If the latter, then this explains why it works with these lines included ie. they don't come into play for this 4.1 file.
That leaves the pesky first file. Two things come to mind: either DTS --> AC3 transcoding is processor intensive (anyone?) and your PC is struggling to convert the audio; or the other thing I notice is that this file has a 8Mbit/s data rate (6.5 video and 1.5 DTS) compared to 4.3Mbits for the other two files - your PC could simply be failing to keep up with that data rate.


Point 1 - I'm not sure I quite agree with this. The only way File 1 will play at all is with the custom PS3 profile. According to the PS3's display, it an MPEG video stream (i.e. transcoded AVC) and DD 5.1 (transcoded DTS 5.1)
Point 2 - If I change levelGreaterThan="4.1" to levelGreaterThan="5.1" Serviio streams File 2 as AVC (the same effect as turning the lines off). If I change the value back to 4.1, it transcodes the video to MPEG and stutters after 20-30 secs. Audio track is DD 2.0 either way. I think helps with the greater or equal to question you posed to zip.
Point 3 - Agreed. With the standard, un-edited PS3 profile File 3 streams as AVC. It's only transcoded if I use the custom PS3 profile.

DenyAll wrote:Also, on the Transcoding tab in Serviio Console, does the "Downmix to Stereo" option have any effect for these failing files?


Downmixing to stereo has no effect on the files that won't play. Interestingly, if I play File 3 with downmixing enabled, the PS3 is still reporting a DD 5.1 audio track?

DenyAll wrote:Lastly: "although the PS3 is reporting this as Dolby Digital, not DTS as per MediaInfo.". AFAIK the PS3 doesn't support DTS. Serviio transcodes this to AC3 in all cases (ie. with or without the two lines - there is a reference later in the profile.xml that ensures audio is transcoded).


My PS3 does have a DTS logo on the front and I'm certain that it outputs DTS to my A/V receiver (DTS logo appears) when playing a Bluray.

DenyAll wrote:Do you have other files that fail (when the two lines are removed)? If so, is the common factor DTS audio? If not, is the common factor high bit rate (above 4.5Mbps)?


I genuinely thought you might be on to something with the DTS 5.1 audio track, as I have another file that is similar to File 1 (another BD rip but completely different TV show - details below 'A.mkv'). However, the second set of details (B.mkv) is for another file that the PS3 also won't play unless I transcode with the custom profile. Whilst this is 5.1, it's AC3... The plot thickens.

  Code:
General
Complete name                            : Y:\A.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 2.19 GiB
Duration                                 : 52mn 41s
Overall bit rate                         : 5 938 Kbps
Writing application                      : mkvmerge v4.1.1 ('Bouncin' Back') built on Jul  3 2010 22:54:08
Writing library                          : libebml v1.0.0 + libmatroska v1.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 52mn 41s
Bit rate                                 : 4 420 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.200
Stream size                              : 1.59 GiB (73%)
Writing library                          : x264 core 129 r2230 1cffe9f
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=4420 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 52mn 41s
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 569 MiB (25%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Title                                    : Forced
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text #2
ID                                       : 4
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:00:00:00.000
00:01:54.531                             : en:00:01:54.531
00:10:16.241                             : en:00:10:16.241
00:18:15.511                             : en:00:18:15.511
00:24:27.299                             : en:00:24:27.299
00:31:39.773                             : en:00:31:39.773
00:41:03.753                             : en:00:41:03.753
00:51:21.704                             : en:00:51:21.704



  Code:
General
Unique ID                                : 240193886292885001910060701484066722721 (0xB4B3A8E91CE8E4C1B081A94A343AD3A1)
Complete name                            : Y:\B.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 500 MiB
Duration                                 : 26mn 5s
Overall bit rate                         : 2 680 Kbps
Encoded date                             : UTC 2011-09-08 08:22:29
Writing application                      : mkvmerge v4.9.1 ('Ich will') built on Jul 11 2011 23:53:15
Writing library                          : libebml v1.2.1 + libmatroska v1.1.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 26mn 5s
Bit rate                                 : 2 293 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.104
Stream size                              : 419 MiB (84%)
Writing library                          : x264 core 116 r2044 392e762
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=2293 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=20000 / vbv_bufsize=15000 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 26mn 5s
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 71.7 MiB (14%)
Language                                 : English
Default                                  : Yes
Forced                                   : Yes

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:00:00:00.000
00:01:20.289                             : en:00:01:20.289
00:10:06.064                             : en:00:10:06.064
00:19:05.895                             : en:00:19:05.895
00:24:55.577                             : en:00:24:55.577



With File 1 (presumably File A above as well) is there a way of telling Serviio to keep the AVC video but transcode the DTS to AC3? Perhaps altering the custom PS3 profile so that is transcodes audio and leaves the video alone? I don't understand the code enough yet to have a go at this myself.

Re: .mkv files stuttering on PS3

PostPosted: Thu Apr 04, 2013 10:53 pm
by S222NEY
I think I've found the common element amongst all the files that the PS3 refuses to play.

I have 8 seasons of a show; all .mkv, all AVC HIGH@L4.1 720p, all AC-3 5.1 and encoded using a version of mkvmerge.

Of the 8 seasons, there are only two that won't work and have to be transcoded. I was beginning to think it might have something to do with subtitles but there are files that have subtitles that work.

Going through text view in MediaInfo line by line comparing episodes that do work with those that don't, they are pretty much the same - until I got to the very bottom of the page and noticed some extra lines in seaons 6 and 7 that are missing from all the others:

  Code:
Menu
00:00:00.000                             : en:01
00:01:20.330                             : en:02
00:07:36.915                             : en:03
00:17:41.143                             : en:04
00:26:08.275                             : en:05


These files have chapters!

I've since gone back and checked all the other files that do and don't work. I'm in the process of obtaining some more files to test, but so far everything that works doesn't include chapter marks.

Next question, how can I easily remove these chapter markers without effecting the rest of the file to test this theory?

Re: .mkv files stuttering on PS3

PostPosted: Fri Apr 05, 2013 12:06 am
by DenyAll
Based on everything to date, I wouldn't create a custom profile but rather simply modify the standard profile for the PS3, either removing those lines or setting it to 5.1 as you suggest. The standard profile has rules for other file types that you don't want to lose.

S222NEY wrote:is there a way of telling Serviio to keep the AVC video but transcode the DTS to AC3?

The standard PS3 profile already does this. After the L4.1 rule there is another rule that picks up all matroska (.mkv) files not dealt with by the first rule:
  Code:
<Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384">
   <Matches container="matroska" />
   :
</Video>

This code remuxes the mkv into a mpegts container (this is the critical part - PS3's cannot handle the mkv container) and if the audio isn't already AC3, transcodes the audio to AC3 (so your DTS will be transcoded by this line). Note that as there is no targetVCodec in this rule, the video stream is not transcoded at all (it is simply copied as is into the mpegts container). If you feel like playing more, you could remove the targetACodec="ac3" aBitrate="384" bit in the code above - this will tell Serviio to still remux mkv's to an mpeg2 container (critical) but not touch the audio - your DTS will then be passed through and will let us see if the PS3 can handle DTS via DLNA (even though the PS3 has a DTS logo, it may not handle it via DLNA).

On to the chapters issue - I have never heard of chapters in an mkv file being an issue (I did a quick search and couldn't find anything). One thing it may be is mkv header compression (search the forum for info on this). In any case, both header compression and chapters should be able to be removed using a free tool called mkvmerge. I have only look at this tool briefly, but it should be able to do the job.

Re: .mkv files stuttering on PS3

PostPosted: Fri Apr 05, 2013 12:21 am
by S222NEY
I've just used mkvmerge to remove chapters - it didnt work. Strange, as it appears to be the common element amongst all the files that don't work.

I've read a bit about header compression but MediaInfo doesnt report it on any of these files?

Re: .mkv files stuttering on PS3

PostPosted: Fri Apr 05, 2013 5:53 am
by DenyAll
I noticed the three examples that need to be transcoded all have embedded text (subtitles?). Have you tried stripping those out as well?

Logically this shouldn't matter (but still try it, who knows!): one of the features of the mkv container is that it can contain all sorts of related information all in the one package - not only the video and audio streams that other containers support, but also text, chapter info, cover art, etc. I would think when remuxing to a new container type Serviio (or more correctly ffmpeg) would only take those streams that the new container could handle. Hence when remuxing to mpeg2ts only the video and audio streams would be remuxed... all these other streams (chapter info, text, etc) will be ignored.

My guess is that there is something in the video that isn't supported by the PS3. Transcoding the video allows it to work (albeit pushes your CPU to max out). What the incompatibility is though....

Re: .mkv files stuttering on PS3

PostPosted: Fri Apr 05, 2013 7:00 am
by DenyAll
I had a look at the three files that failed vs the two that passed:

  • noticed that the three that fail have a frame rate of 23.976 fps (the 2 that pass are 25 fps). Don't think this is an issue as 23.976 is pretty common;
  • noticed that the three that fail have a ReFrames rate of 5 frames (the 2 that pass are less, 3 or 4)
I then had a look on the web and (in its normal unclear manner) there are comments that suggest that the ps3 cannot support 5 or more frames as a reframe. Stick "ps3 reframes" into google and have a read - it isn't definitive and there is some debate on whether its 4 or 5 (we know 4 is OK) but that's what I would now class as the #1 suspect.

Unfortunately, the only way to fix these is to re-encode them (perhaps mkvmerge may be able to do something??).

Re: .mkv files stuttering on PS3

PostPosted: Fri Apr 05, 2013 11:58 pm
by S222NEY
Reading around it seems the PS3 only supports DTS from a disc play-back. For file play-back it is apparently blocked, so this quite possibly applies to streaming too.

I had a play with tsMuxeR and converted the mkv to an m2ts. The file will play but without sound, possibly because it's still DTS. So it looks like I need to re-encode and convert the sound track to AC-3. What's the best route to go about this?

Re: .mkv files stuttering on PS3

PostPosted: Sat Apr 06, 2013 2:22 am
by DenyAll
ffmpeg (which comes with Serviio) can do this. Try this from the command line:

    "C:\Program Files\Serviio\lib\ffmpeg.exe" -i "input.mkv" -sn -vcodec copy -acodec ac3 -b:a 384k "output.mkv"
Adjust above for the location of ffmpeg on your system. This will copy the video stream (ie. no change) and convert the audio to AC3 (any ffmpeg guru's on the forum - please check that I haven't left anything out, am new to this. I tested, it works) and put both streams into a new mkv file. Note that:

  • you can also convert to a mp4 container by changing the output file name to "output.mp4". This way the PS3 can play the file direct without any remuxing;
  • Serviio should already be converting DTS to AC3 for these files before streaming (the standard PS3 profile does that). I still believe the issue is with the video (maybe the 5 reframes bit in previous post). If the above doesn't work (esp after trying the mp4 option), we will need to work on re-encoding the video. May need some help from others as my ffmpeg skills are rudimentary (but I am learning rapidly :D )

Re: .mkv files stuttering on PS3

PostPosted: Sat Apr 06, 2013 2:22 pm
by S222NEY
Thank you again, I really appreciate your help.

I'll have a play with ffmpeg and see if converting the DTS audio track helps. As the AVC video is not touched, if the file still doesnt work I guess it's safe to assume the problem is more likely to be reference frame related. Will post the results in due course.

EDIT: Ok, so converting the soundtrack to AC-3 didn't solve the problem for the files with the DTS audio. However, once in AC-3, I can you Tsmuxer to convert to a m2ts which does work and preserves the AVC video, so no transcoding. The sacrifice here being the quality of the audio (DTS > AC-3) and a slightly convoluted process. Still quicker than re-encoding though, I think.

It is possible to write .bat files for ffmpeg commands in order to simplify the re-encoding of the audio track? It would be great to be able to drop problem mkv's onto a .bat file and have it spit out a 'fixed' .m2ts.

Re: .mkv files stuttering on PS3

PostPosted: Sat Apr 06, 2013 11:30 pm
by DenyAll
No problems - am enjoying the challenge and the learning. Can you please post the MediaInfo for the new file, I'd like to see what has changed in the video stream.

You could also try:
    "C:\Program Files\Serviio\lib\ffmpeg.exe" -i "input.mkv" -sn -vcodec mpeg2video -q:v 0 -acodec ac3 -b:a 384k "output.m2ts"
This will now covert both video (to mpeg2) and audio (to AC3) and package as a m2ts file. Not sure whether this degrades video quality though. If you prefer you can also go to a mp4 container which the PS3 supports natively:

    "C:\Program Files\Serviio\lib\ffmpeg.exe" -i "input.mkv" -sn -vcodec mpeg4 -q:v 0 -acodec ac3 -b:a 384k "output.mp4"
If you want to go the batch file path:
  Code:
@echo off
set "srcfile="%~nx1""
set "newfile=%srcfile:.mkv"=%.m2ts""

if exist temp.mkv del temp.mkv
if exist %newfile% del %newfile%

"C:\Program Files\Serviio\lib\ffmpeg.exe" -i %srcfile% -vcodec copy  -acodec ac3 -b:a 384k "temp.mkv"
REM insert your TSMUXER command here, using temp.mkv as the input file, and %newfile% as the output file.  Point to the full path of the TSMUXER program.

if exist temp.mkv del temp.mkv

echo.
echo.
echo Finished remuxing %srcfile%.
echo 
pause

set "srcfile="
set "newfile="
Save this into the folder with your videos. Drag and drop a video file on to it. Will create a m2ts file of the same name as your original. Should work....

Re: .mkv files stuttering on PS3

PostPosted: Sun Apr 07, 2013 4:34 pm
by S222NEY
DenyAll wrote:ffmpeg (which comes with Serviio) can do this. Try this from the command line:

    "C:\Program Files\Serviio\lib\ffmpeg.exe" -i "input.mkv" -sn -vcodec copy -acodec ac3 -b:a 384k "output.mkv"
Adjust above for the location of ffmpeg on your system. This will copy the video stream (ie. no change) and convert the audio to AC3 (any ffmpeg guru's on the forum - please check that I haven't left anything out, am new to this. I tested, it works) and put both streams into a new mkv file. Note that:

  • you can also convert to a mp4 container by changing the output file name to "output.mp4". This way the PS3 can play the file direct without any remuxing;
  • Serviio should already be converting DTS to AC3 for these files before streaming (the standard PS3 profile does that). I still believe the issue is with the video (maybe the 5 reframes bit in previous post). If the above doesn't work (esp after trying the mp4 option), we will need to work on re-encoding the video. May need some help from others as my ffmpeg skills are rudimentary (but I am learning rapidly :D )


Ok, I've created a small file based on 'File 1' in the OP to speed up the testing process. It retains the 5 ref frame, DTS audio etc. so from what I can see it a true snippet of the original troublesome file. See below:

  Code:
General
Unique ID                                : 206111320583107414739860301731314494024 (0x9B0F98AEE76040A89FE46584B6136A48)
Complete name                            : M:\Test\File1-DTS.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 13.1 MiB
Duration                                 : 11s 221ms
Overall bit rate                         : 9 789 Kbps
Encoded date                             : UTC 2013-04-05 18:33:25
Writing application                      : mkvmerge v6.1.0 ('Old Devil') built on Mar  2 2013 14:32:37
Writing library                          : libebml v1.3.0 + libmatroska v1.4.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 11s 220ms
Bit rate                                 : 8 086 Kbps
Nominal bit rate                         : 6 472 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.366
Stream size                              : 10.8 MiB (83%)
Writing library                          : x264 core 115 r2008 4c552d8
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=6472 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 11s 221ms
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 2.02 MiB (15%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:00:00:00.000



As in my previous post, using the ffmpeg command, I transcoded this file mkv to mkv converting the audio track to AC-3 (why is it always 384 kbps?). The resulting file still did not work. MediaInfo for the AC-3 file (interesting how despite being a 'copy' the video duration and bit rate fluctuate slightly):

  Code:
General
Unique ID                                : 216331744018160155002091326540272298271 (0xA2BFFA76A0967F5DB9AD8E3B3126E91F)
Complete name                            : M:\Test\File1-AC3_output.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 11.6 MiB
Duration                                 : 11s 308ms
Overall bit rate                         : 8 595 Kbps
Writing application                      : Lavf54.59.106
Writing library                          : Lavf54.59.106

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 11s 303ms
Bit rate                                 : 8 040 Kbps
Nominal bit rate                         : 6 472 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.364
Stream size                              : 10.8 MiB (94%)
Writing library                          : x264 core 115 r2008 4c552d8
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=6472 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 11s 308ms
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 1mn 5s
Stream size                              : 530 KiB (4%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Menu
00:00:00.000                             : :00:00:00.000



Using ffmpeg seems to strip out the subtitles. No an issue on this file, but could they be preserved using this method?

After posting yesterday, I quickly realised that rather than messing around with TSmuxer I could use ffmpeg to output an .mp4 instead - same data but different container compatible with the PS3:

  Code:
General
Complete name                            : M:\Test\File1-AC3_output.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 11.6 MiB
Duration                                 : 11s 231ms
Overall bit rate                         : 8 659 Kbps
Writing application                      : Lavf54.59.106

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 11s 219ms
Bit rate                                 : 8 275 Kbps
Nominal bit rate                         : 6 472 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.976 fps
Minimum frame rate                       : 23.256 fps
Maximum frame rate                       : 24.390 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.374
Stream size                              : 11.1 MiB (95%)
Writing library                          : x264 core 115 r2008 4c552d8
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=6472 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : ac-3
Duration                                 : 11s 231ms
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : 83ms
Stream size                              : 527 KiB (4%)
Language                                 : English

Menu
00:00:00.000                             : 00:00:00.000



Despite retaining the 5 ref frames - the .mp4 works perfectly (althought I haven't tried a full length file and watched it to the end to test). It doesn't stress the CPU at all either so there's no stuttering, which was the primary aim.

If I can get a .bat file working, this appears to be the best solution as the transcoding of the audio and remuxing into an .mp4 is presumably quicker than a full re-encoding of the video and audio. I now need to test on some of the other troublesome files, but it's looking positive at the moment.

Does moving to .mp4 mean the loss of embedded subtitles?

Re: .mkv files stuttering on PS3

PostPosted: Sun Apr 07, 2013 11:44 pm
by DenyAll
S222NEY wrote:Using ffmpeg seems to strip out the subtitles. No an issue on this file, but could they be preserved using this method?
Remove the -sn from the command line. This should preserve the subtitles - not sure whether they will survive the translation to mp4 though.

S222NEY wrote:...converting the audio track to AC-3 (why is it always 384 kbps?)
You can set the bit rate using the b:a xxxk parameter. 384k seems a commonly used bit rate for AC3, I have also seen 640k being used a bit (the max I believe for AC3). As always, file size vs quality trade offs. Stick "bit rate for ac3" into Google for some info/opinions.

I'm happy we got an answer but is does confuse me. I still don't know why it works. The conversion to AC3 would have been done by the standard Serviio profile anyway, so it is the copying of the video stream from the matroska container to the mp4 container that solved the problem. I have used ffmpeg in the past simply to copy both video and audio back into the same container type - it seems to fix any abnomolies in the header - maybe thats coming into play here (other than it didnt work unless we also tsmuxed it). Some mysteries never get solved I suppose...:?

ps. Did you ever try going straight to mp4 (in one of my earlier posts) using ffmpeg? In theory this should be doing exactly the same as your two step process (AC3 conversion and remux using tsmuxer):

    "C:\Program Files\Serviio\lib\ffmpeg.exe" -i "input.mkv" -sn -vcodec copy -acodec ac3 -b:a 384k "output.mp4"
This should work??