I have a Galaxy Tab P1000 connected to my MyBookLive via WiFi. A lot of .mkv files (with H.264 1080p video) play perfectly with MX Player's H/W+ decoder, but some files have to be re-encoded for some reason in order to get them to play. After 1 or 2 seconds the H/W+ decoder switches to S/W, in which the video becomes very slow. When I download the files onto my SD card they work with the H/W decoder, but again not with S/W and H/W+. It's not that because of bandwith issues, because I'm able to play files like the problemfiles with even smaller sizes. Does anybody know what I should change in the H.264 stream to make playback possible without re-encoding everything so I lose quality?

Here is the mediainfo for four files. The first two are from the same episode from a tv series. The working one has been re-encoded from the failing one, which was ripped from a BluRay disc with MakeMKV. The second two are from different episodes of the same season from another tv series (not from a bluray source), in which the first one works and the second one fails.

1. Work:
Code:
General
Unique ID                                : 234343239673977762618719673618961511719 (0xB04CDDC2E7FDE7329D7CCBBBC513B527)
Complete name                            : \\MYBOOKLIVE\Public\E01S-WORKING.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 3.36 GiB
Duration                                 : 22mn 58s
Overall bit rate mode                    : Variable
Overall bit rate                         : 20.9 Mbps
Encoded date                             : UTC 2014-03-09 17:26:30
Writing application                      : mkvmerge v6.8.0 ('Theme for Great Cities') 64bit built on Mar  2 2014 21:34:26
Writing library                          : libebml v1.3.0 + libmatroska v1.4.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                                 : 22mn 58s
Width                                    : 1 920 pixels
Height                                   : 1 080 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
Writing library                          : x264 core 130 r2273 b3065e6
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=4 / 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=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / 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 #1
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : MA / Core
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 22mn 58s
Bit rate mode                            : Variable
Bit rate                                 : Unknown / 1 509 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                         : Lossless / Lossy
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : The same subtitle format used on BDs/HD-DVDs
Title                                    : English Subtitles
Language                                 : English
Default                                  : Yes
Forced                                   : No

Menu
00:00:00.000                             : en:Chapter 1
00:06:24.133                             : en:Chapter 2
00:15:49.114                             : en:Chapter 3
00:21:37.587                             : en:Chapter 4
00:22:29.556                             : en:Chapter 5
1. Fail:
Code:
General
Unique ID                                : 172569040243458747359910432848533087323 (0x81D39694CB104A6C87FC87B0BCC5645B)
Complete name                            : \\MYBOOKLIVE\Public\E01S-FAILING.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 3.22 GiB
Duration                                 : 22mn 58s
Overall bit rate mode                    : Variable
Overall bit rate                         : 20.1 Mbps
Encoded date                             : UTC 2014-03-09 10:49:00
Writing application                      : mkvmerge v6.8.0 ('Theme for Great Cities') 64bit built on Mar  2 2014 21:34:26
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 22mn 58s
Bit rate mode                            : Variable
Width                                    : 1 920 pixels
Height                                   : 1 080 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
Language                                 : English
Default                                  : No
Forced                                   : No

Audio
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Format profile                           : MA / Core
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 22mn 58s
Bit rate mode                            : Variable
Bit rate                                 : Unknown / 1 509 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                         : Lossless / Lossy
Title                                    : Surround 5.1
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : The same subtitle format used on BDs/HD-DVDs
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:Chapter 01
00:06:24.050                             : en:Chapter 02
00:15:49.114                             : en:Chapter 03
00:21:37.587                             : en:Chapter 04
00:22:29.556                             : en:Chapter 05
2. Work:
Code:
General
Unique ID                                : 188788479820812115094307780391583572152 (0x8E0756B1634E450D95AC9324B1C360B8)
Complete name                            : \\MYBOOKLIVE\Public\E01-WORKING.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 1.60 GiB
Duration                                 : 43mn 20s
Overall bit rate                         : 5 287 Kbps
Encoded date                             : UTC 2014-03-03 13:53:21
Writing application                      : mkvmerge v6.7.0 ('Back to the Ground') 64bit built on Jan 11 2014 10:17:39
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 43mn 20s
Width                                    : 1 912 pixels
Height                                   : 1 072 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
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : A_AAC
Duration                                 : 43mn 20s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 43mn 20s
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                  : 7ms
Stream size                              : 119 MiB (7%)
Language                                 : English
Default                                  : No
Forced                                   : No
2. Fail:
Code:
General
Unique ID                                : 218517220253526364888771618884565076009 (0xA464E2C2CF28CDCC9648BC61D0DC0829)
Complete name                            : \\MYBOOKLIVE\Public\E02-FAILING.mkv
Format                                   : Matroska
Format version                           : Version 1
File size                                : 1.71 GiB
Duration                                 : 42mn 42s
Overall bit rate                         : 5 735 Kbps
Encoded date                             : UTC 2014-03-04 07:59:44
Writing application                      : mkvmerge v6.7.0 ('Back to the Ground') 64bit built on Jan 11 2014 10:17:39
Writing library                          : libebml v1.3.0 + libmatroska v1.4.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 42mn 42s
Width                                    : 1 912 pixels
Height                                   : 1 072 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
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : A_AAC
Duration                                 : 42mn 42s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -200ms
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 42mn 42s
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                              : 117 MiB (7%)
Language                                 : English
Default                                  : No
Forced                                   : No