FAQ  •  Register  •  Login

MKV audio and video stutter, fix or remux?

<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Tue Sep 23, 2014 8:16 pm

MKV audio and video stutter, fix or remux?

Ok, I've searched and read most of the posts relating to mkv's stuttering, however my tiny brain is not capable of understanding the issue :( so please be gentle with me

I'm using the Panasonic 2010 profile on my TX-P50G20BA (latest version of Serviio and high spec PC, connected through homeplugs) and pretty much everything plays including most mkv's without any issues. An example I am having trouble with is detailed below (aspect ratio correct with black bars above and below):

  Code:
General
Unique ID                                : 176121867618419934911797495194306499691 (0x847FD67EB2EBD9E6B1BD8DE9A254546B)
Complete name                            : F:\Media\Film\Transformers Age of Extinction.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 6.56 GiB
Duration                                 : 2h 45mn
Overall bit rate                         : 5 684 Kbps
Encoded date                             : UTC 2014-09-18 20:51:00
Writing application                      : mkvmerge v7.1.0 ('Good Love') 64bit built on Jul 27 2014 13:06:55
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1
DURATION                                 : 02:35:41.832000000
NUMBER_OF_FRAMES                         : 2509
NUMBER_OF_BYTES                          : 80548
_STATISTICS_WRITING_APP                  : mkvmerge v7.1.0 ('Good Love') 64bit built on Jul 27 2014 13:06:55
_STATISTICS_WRITING_DATE_UTC             : 2014-09-18 20:51:00
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

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                                 : 2h 45mn
Bit rate                                 : 5 043 Kbps
Width                                    : 1 280 pixels
Height                                   : 536 pixels
Display aspect ratio                     : 2.40:1
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.307
Stream size                              : 5.69 GiB (87%)
Writing library                          : x264 core 142 r2479 dd79a61
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / 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=8 / lookahead_threads=1 / 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=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=5043 / 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
DURATION                                 : 02:45:07.273000000
NUMBER_OF_FRAMES                         : 237537
NUMBER_OF_BYTES                          : 6243731577
_STATISTICS_WRITING_APP                  : mkvmerge v7.1.0 ('Good Love') 64bit built on Jul 27 2014 13:06:55
_STATISTICS_WRITING_DATE_UTC             : 2014-09-18 20:51:00
_STATISTICS_TAGS                         : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

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                                 : 2h 45mn
Bit rate mode                            : Constant
Bit rate                                 : 640 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                              : 756 MiB (11%)
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                                    : English FORCED
Language                                 : English
Default                                  : Yes
Forced                                   : Yes

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

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

Menu
00:00:00.000                             : en:00:00:00.000
00:06:51.578                             : en:00:06:51.578
00:14:33.581                             : en:00:14:33.581
00:21:37.463                             : en:00:21:37.463
00:30:13.395                             : en:00:30:13.395
00:38:45.990                             : en:00:38:45.990
00:46:08.057                             : en:00:46:08.057
00:51:39.513                             : en:00:51:39.513
00:59:09.337                             : en:00:59:09.337
01:07:48.648                             : en:01:07:48.648
01:15:14.552                             : en:01:15:14.552
01:23:25.292                             : en:01:23:25.292
01:29:14.724                             : en:01:29:14.724
01:37:16.956                             : en:01:37:16.956
01:44:35.436                             : en:01:44:35.436
01:51:25.053                             : en:01:51:25.053
01:57:47.936                             : en:01:57:47.936
02:04:48.481                             : en:02:04:48.481
02:12:35.865                             : en:02:12:35.865
02:21:04.206                             : en:02:21:04.206
02:28:48.670                             : en:02:28:48.670
02:37:09.629                             : en:02:37:09.629


Now, there is either something totally obvious in the above to everyone apart from me and there is a simple solution.....or I could remux (as I have done with PS3Muxer) into an mp4 where the stuttering disappears, however the aspect ratio gets screwed (stretched vertically) when I do this. The resulting mp4 is larger than the original, however, I have not noticed a reduction in the quality of the video (details of the mp4 below) and the bitrates are the same for both files.

  Code:
General
ID                                       : 1 (0x1)
Complete name                            : F:\Media\Film\Transformers Age of Extinction.mp4
Format                                   : MPEG-TS
File size                                : 6.82 GiB
Duration                                 : 2h 45mn
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 913 Kbps
Maximum Overall bit rate                 : 35.5 Mbps

Video
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : 27
Duration                                 : 2h 45mn
Bit rate mode                            : Variable
Bit rate                                 : 5 043 Kbps
Maximum bit rate                         : 40.0 Mbps
Width                                    : 1 280 pixels
Height                                   : 536 pixels
Display aspect ratio                     : 2.40:1
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.307
Stream size                              : 5.74 GiB (84%)
Writing library                          : x264 core 142 r2479 dd79a61
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / 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=8 / lookahead_threads=1 / 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=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=5043 / 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.0

Audio
ID                                       : 4352 (0x1100)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : 129
Duration                                 : 2h 45mn
Bit rate mode                            : Constant
Bit rate                                 : 640 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                              : 756 MiB (11%)


Therefore my questions are as follows:
1. Is there anything in the above which I should beware of in mkv's?
2. If yes, can it be fixed to prevent stuttering? I assume by the posts I have read there is no clear solution and that remuxing might be the best way forward.
3. If remuxing, is there a way I can force the aspect ratio (in the Panasonic 2010 profile) to stay the same as in the original mkv when playing an mp4 (remuxed mkv with PS3Muxer) ?
4. If remuxing is the only answer, what is the best tool for it?

Much appreciated
<<

DenyAll

DLNA master

Posts: 2170

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sat Sep 27, 2014 12:53 am

Re: MKV audio and video stutter, fix or remux?

1. Is there anything in the above which I should beware of in mkv's?
Not that I can see in this MKV at least.
It could be due to your PC not being able to transcode fast enough (is this occuring all the time or just for high action sequences). In the Panasonic 2010 profile MKV files are video transcoded (this is needed to fix the aspect ratio issue) while MP4's are simply remuxed (to an mpeg-2 container). Transcoding is far more processor intensive - and this is what I suspect you are seeing. Check your CPU usage during streaming of the MKV. Try enabling more CPU cores if possible on the Delivery, Transcoding tab of Serviio Console.

It could also be the maximum bit rate on this file (if it its only in high action sequences and your PC CPU is not the cause would indicate this may be the problem). If bit rate related we will need to edit the profile to limit the bit rate (this may affect quality so we will do this if all else fails).

2. If yes, can it be fixed to prevent stuttering? I assume by the posts I have read there is no clear solution and that remuxing might be the best way forward.
You could try and remux the MKV back into an MKV container and see if that fixes the issue - if its not CPU related but rather a bad MKV container this may help.

3. If remuxing, is there a way I can force the aspect ratio (in the Panasonic 2010 profile) to stay the same as in the original mkv when playing an mp4 (remuxed mkv with PS3Muxer) ?
Edit the Panasonic 2010 profile and add the line:
    <Matches container="mp4" />
    under the existing line
    <Matches container="matroska" />
This will cause the MP4 file to be transcoded rather than remuxed - but as I explained in the first point this will force transcoding and the stuttering may return. You need to restart your PC after editing profiles for the changes to take effect.

4. If remuxing is the only answer, what is the best tool for it?
I think they all do the job. I use ffmpeg that comes with Serviio, or if you are a Windows user, my tool here: viewtopic.php?f=17&t=12136 (shameless plug :-))
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Sun Sep 28, 2014 8:08 pm

Re: MKV audio and video stutter, fix or remux?

Hi, and thanks for taking the time to look into this.

1. I don't think it's a PC issue as the stuttering occurs both at high action sequences (bombs killing dinosaurs at the beginning of movie) as well as at low action sequences (talking to the feds in front of the barn). Ffmpeg CPU usage between 83 and 93% during transcoding (i5 4670k CPU, 250GB SSD HD, 16GB RAM). The setting for number of cores in Serviion is 'Optimal'. I will test with 4 cores enabled.

2. Have tried remuxing original with mkvtoolnix 7.20 with no change. Also tried remuxing and removing everything apart from the audio and video only.

3. Will give this a try and let you know. Just curious as to why most of the series I watch in mp4 format are not stretched.

I'll try 1 an 3 above in the next couple of days and let you know.

Cheers
<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Sun Sep 28, 2014 8:44 pm

Re: MKV audio and video stutter, fix or remux?

Update.

1. Choosing 4 cores actually increases the stuttering throughout.

3. Added the line to the Panasonic 2010 profile as suggested (see below), however image still vertically stretched. No stuttering though.
  Code:
      <Transcoding>
         <!-- unsupported codecs will be transcoded into mpeg-ts, mpeg2 video and ac3 audio -->
         <Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" aBitrate="384" DAR="16:9">
            <Matches container="matroska"/>
            <Matches container="mp4" />
         </Video>
<<

DenyAll

DLNA master

Posts: 2170

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Sep 29, 2014 6:15 am

Re: MKV audio and video stutter, fix or remux?

I just noticed something in your MP4 file:
Complete name : F:\Media\Film\Transformers Age of Extinction.mp4
Format : MPEG-TS
It looks like PS3Muxer is muxing into a MPEG-TS container even though it gives it an MP4 file extension. This would be why (3) above didn't have any effect (Serviio looks into the file to determine container type, not simply at the file extension). Try remuxing the file using ffmpeg or my tool.

Also - some more things to try:
  • try setting transcoding to 1 or 2 cores and see if that helps stuttering. This will help if you have another program that is causing the stuttering.
  • Do you have a non-SSD drive. If so, try setting transcode temporary folder to a non-SSD drive.
Just curious as to why most of the series I watch in mp4 format are not stretched
Most series (and made-for-TV movies) are 16:9 aspect ratio. The stretching only occurs when the aspect ratio is greater than 16:9 (or 1.77:1). In your case the MP4 file is 2.40:1.
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Mon Sep 29, 2014 7:08 pm

Re: MKV audio and video stutter, fix or remux?

First of all I'm an idiot and don't know why I said I used PS3Muxer when it was actually mkv2vob...but never mind. The resulting MPEG-TS file cannot play on VLC but plays on PowerDVD and, most importantly no stutter on my Panasonic. The image is however vertically stretched.

I have additionally tried as per your suggestion:

1. Tried remuxing with your tool. MKV to MKV no difference, MKV to MP4 quits immediately and created file is only 1kb. Don't know how to remux with ffmpeg.
2. Tried with 4, 3, 2 and then 1 core(s) and no difference, although the more cores used the more pronounced the stuttering.
3. My Serviio Temp folder is on a non SSD drive.

I have also tried 'properly' remuxing to an mp4 with MkvToMp4. The resulting mp4 or mv4 output files both stuttered. MediaInfo identifies the format for these as MPEG-4.

  Code:
General
Complete name                            : F:\Media\Film\Transformers Age of Extinction.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 6.56 GiB
Duration                                 : 2h 45mn
Overall bit rate                         : 5 684 Kbps
Encoded date                             : UTC 2014-09-29 18:37:47
Tagged date                              : UTC 2014-09-29 18:37:47
Writing application                      : MkvToMp4 [www.mkvtomp4.ru] version 0.224 (x64)

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                                 : 2h 45mn
Bit rate                                 : 5 043 Kbps
Maximum bit rate                         : 26.0 Mbps
Width                                    : 1 280 pixels
Height                                   : 536 pixels
Display aspect ratio                     : 2.40:1
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.307
Stream size                              : 5.81 GiB (89%)
Writing library                          : x264 core 142 r2479 dd79a61
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / 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=8 / lookahead_threads=1 / 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=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=5043 / 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
Encoded date                             : UTC 2014-09-29 18:37:47
Tagged date                              : UTC 2014-09-29 18:39:04

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                                 : 2h 45mn
Bit rate mode                            : Constant
Bit rate                                 : 640 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                              : 756 MiB (11%)
Language                                 : English
Encoded date                             : UTC 2014-09-29 18:39:01
Tagged date                              : UTC 2014-09-29 18:39:04


Therefore, I don't know what mkv2vob did, but it definitely fixed the stuttering with no quality loss. I am happy to use this solution for other stuttering mkv's, however I would appreciate knowing what I need to add to my Panasonic profile to prevent stretching?
<<

DenyAll

DLNA master

Posts: 2170

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Fri Oct 03, 2014 1:15 pm

Re: MKV audio and video stutter, fix or remux?

..however I would appreciate knowing what I need to add to my Panasonic profile to prevent stretching?
If only it was that easy. In short, you can't.

The reason you are getting stretching is because the file that mkv2vob is creating is simply the H264 video remuxed into a MPEG-2 container. For these types of files the Panasonic TV does not honour the aspect ratio of the file - it ignores the aspect ratio information in the video file, and stretches it to fit the display panel of the TV. For video files that are 16:9 (like TV series) this isnt a problem - if you stretch a 16:9 file to fit a 16:9 display panel then nothing changes. But if you stretch a 2.4:1 video (eg. many movies) to fit a 16:9 display panel everyone looks tall and thin.

Serviio overcomes limitation of the TV by transcoding the video and adding padding to the top and bottom of the video stream. This gives the illusion of maintaining the aspect ratio (in reality, the TV is still stretching to fit the screen - its just Serviio has added black bars top and bottom so that the aspect of the content - ie. the video - is maintained).

So without transcoding the video there is no way to fix your issue; and you cannot transcode without stuttering. The problem though really is - why can your system not transcode the file without stuttering. It should be able to I would have thought. If its only one or two files I would get another copy of the file - if its many then perhaps start playing: stop everything but Serviio on the PC, try cable rather than powerplugs. Otherwise I'm at a loss.....
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Fri Oct 03, 2014 3:16 pm

Re: MKV audio and video stutter, fix or remux?

Oh well, I guess I'll just have to use other file formats, pity mkv's are usually the best quality.

Many thanks for your time and advice.
<<

lepicane

Serviio newbie

Posts: 15

Joined: Sat Nov 12, 2011 12:30 am

Post Tue Nov 11, 2014 10:45 am

Re: MKV audio and video stutter, fix or remux?

For info only.

I have installed Mezzmo 4.1.2.0 and selected the 'Panasonic Viera (2009)' profile for my Panasonic Viera TX-P50G20BA. With the initial testing I have done, there is no mkv stuttering with files that stuttered with Serviio.

I will not even attempt to explore the reasons for this...pity, I love Serviio for its simplicity.

Return to Panasonic

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.