some x264 mkv files trouble, some work fine?

I have about a dozen HD x264 mkv movies and strangely some work perfectly fine in kaffeine xine, others only play in totem-gstreamer or mplayer BUT constantly stutter even there. those that do play in xine I have full dolby/dts working as well (would really like to get gstreamer to do this so could simply use moovida)

output of rpm --query --all ‘libav*’ ‘libpostproc*’ ‘libswscale*’ ‘xine’ ‘gst’ ‘layer’ ‘vlc’ | grep -v avahi | sort

banshee-1-backend-engine-gstreamer-1.4.3-1.2.1
dragonplayer-4.3.1-81.4
flash-player-10.0.32.18-0.1.1
gstreamer-0_10-0.10.24-999.pm.1000.4
gstreamer-0_10-ffmpeg-0.10.8-999.pm.1001.3
gstreamer-0_10-fluendo-mp3-0.10.10-42.pm.42.1
gstreamer-0_10-fluendo-mpegdemux-0.10.23-42.pm.42.1
gstreamer-0_10-lang-0.10.24-999.pm.1000.4
gstreamer-0_10-plugins-bad-0.10.14-999.pm.1000.9
gstreamer-0_10-plugins-bad-lang-0.10.14-999.pm.1000.9
gstreamer-0_10-plugins-base-0.10.24-999.pm.1000.3
gstreamer-0_10-plugins-base-lang-0.10.24-999.pm.1000.3
gstreamer-0_10-plugins-good-0.10.15-42.pm.43.1
gstreamer-0_10-plugins-good-extra-0.10.15-42.pm.43.1
gstreamer-0_10-plugins-good-lang-0.10.15-42.pm.43.1
gstreamer-0_10-plugins-ugly-0.10.12-999.pm.1000.8
gstreamer-0_10-plugins-ugly-lang-0.10.12-999.pm.1000.8
gstreamer-0_10-schroedinger-1.0.7-0.pm.1.1
gstreamer-0_10-utils-0.10.24-999.pm.1000.4
gstreamer-utils-0.10.24-999.pm.1000.4
kaffeine-gstreamer-0.8.8-1.pm.4.19
libavc1394-0-0.5.3-129.6
libavcodec52-0.5.20024svn-20090925.pm.20090925.10
libavformat52-0.5.20024svn-20090925.pm.20090925.10
libavutil49-0.5-1.pm.7.2
libavutil50-0.5.20024svn-20090925.pm.20090925.10
libgstbasevideo-0_10-0-0.10.14-999.pm.1000.9
libgstinterfaces-0_10-0-0.10.24-999.pm.1000.3
libgstphotography-0_10-0-0.10.14-999.pm.1000.9
libgstreamer-0_10-0-0.10.24-999.pm.1000.4
libgstreamer-0_10-0-32bit-0.10.24-999.pm.1000.4
libpostproc51-0.5.20024svn-20090925.pm.20090925.10
libswscale0-0.5.20024svn-20090925.pm.20090925.10
libxine1-1.1.16.3-2.pm.6.10
libxine1-codecs-1.1.16.3-2.pm.6.10
libxine1-gnome-vfs-1.1.16.3-2.pm.6.10
libxine1-pulse-1.1.16.3-2.pm.6.10
MPlayer-1.0rc2_r29116-2.pm.29.8
phonon-backend-gstreamer-0_10-4.3.1-31.3
phonon-backend-xine-4.3.1-31.3
pullin-flash-player-11.1-1.1
python-gstreamer-0_10-0.10.15-42.pm.42.1
xinetd-2.3.14-129.35
xine-ui-0.99.5cvs-20090912.pm.20090912.2

output of

| Alias | Name | Enabled | Refresh | Priority | Type | URI | Service

—±--------------------------±------------------------±--------±--------±---------±-------±-------------------------------------------------------------------------------------±-------
1 | bleeding_edge_xorg/mesa_1 | bleeding edge xorg/mesa | No | Yes | 18 | rpm-md | Index of /repositories//X11:/XOrg/openSUSE_11.1 |
2 | gnome_2.26 | gnome 2.26 | No | Yes | 19 | rpm-md | Index of /repositories/GNOME:/STABLE:/2.26/openSUSE_11.1 |
3 | gnome_2.26_backports | gnome 2.26 backports | No | Yes | 19 | rpm-md | Index of /repositories/GNOME:/Backports:/2.26/openSUSE_11.1 |
4 | kde4 | kde4 | Yes | Yes | 16 | rpm-md | Index of /repositories/KDE:/KDE4:/Factory:/Desktop/openSUSE_11.1 |
5 | openSUSE 11.1-0 | openSUSE 11.1-0 | Yes | No | 99 | yast2 | cd:///?devices=/dev/sr0 |
6 | openSUSE-11.1-Updates | Updates for 11.1 | Yes | Yes | 20 | rpm-md | Index of /update/11.1 |
7 | radeonhd | radeonhd | Yes | Yes | 95 | rpm-md | Index of /repositories//X11:/Drivers:/Video/openSUSE_11.1 |
8 | repo | VideoLan Repository | No | Yes | 99 | rpm-md | Index of /pub/videolan/vlc/SuSE/11.1/ |
9 | repo-debug | openSUSE-11.1-Debug | No | Yes | 99 | NONE | http://download.opensuse.org/distribution/11.1/repo/debug/ |
10 | repo-non-oss | openSUSE-11.1-Non-Oss | Yes | Yes | 98 | yast2 | Index of /distribution/11.1/repo/non-oss |
11 | repo-oss | openSUSE-11.1-Oss | Yes | Yes | 98 | yast2 | Index of /distribution/11.1/repo/oss |
12 | repo_1 | Packman Repository | Yes | Yes | 15 | rpm-md | Index of /pub/packman/suse/11.1

Play them through the console with mplayer, and paste the messages (if any) of these that stutter

also paste the output of the stuttering ones you get from the commands below

strings file.mkv | grep x264

Ok, here’s a couple.

MPlayer dev-SVN-r29116-4.3-openSUSE Linux 11.1 (x86_64)-Packman (C) 2000-2009 MPlayer TeamCan’t open joystick device /dev/input/js0: No such file or directory
Can’t init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Monsters.Vs.Aliens.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Track ID 3: subtitles (S_TEXT/UTF8), -sid 0, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x544 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)

Opening video decoder: [ffmpeg] FFmpeg’s libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)

==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio: 80000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)

AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback…
VDec: vo config request - 1280 x 544 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.35:1 - prescaling to correct movie aspect.
VO: [xv] 1280x544 => 1280x544 Planar YV12
No bind found for key ‘MOUSE_BTN2’. 8% 5 0
No bind found for key ‘MOUSE_BTN2’. 0% 5 0
No bind found for key ‘MOUSE_BTN2’. 2% 0 0
No bind found for key ‘MOUSE_BTN2’. 0% 0 0
No bind found for key ‘MOUSE_BTN2’.-MOUSE_BTN2_DBL
No bind found for key ‘MOUSE_BTN2_DBL’. 0
No bind found for key ‘MOUSE_BTN0’.-MOUSE_BTN0_DBL
No bind found for key ‘MOUSE_BTN0_DBL’. 0
A: 741.5 V: 741.5 A-V: -0.001 ct: -0.160 0/ 0 51% 3% 2.2% 0 0
Exiting… (Quit)

and its x264 output

x264 - core 75 r1251 e553a4c - H.264/MPEG-4 AVC codec - Copyleft 2003-2009 - VideoLAN - x264 - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=7 psy=1 psy_rd=1.0:0.0 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=-2 threads=12 nr=0 decimate=1 mbaff=0 bframes=3 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 wpredb=1 keyint=250 keyint_min=25 scenecut=40 rc_lookahead=40 rc=2pass mbtree=1 bitrate=2674 ratetol=1.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 aq=1:1.00
.x264
x264&Z

and now vid #2

MPlayer dev-SVN-r29116-4.3-openSUSE Linux 11.1 (x86_64)-Packman (C) 2000-2009 MPlayer TeamCan’t open joystick device /dev/input/js0: No such file or directory
Can’t init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Transformers.Revenge.of.the.Fallen.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) “Video: x264_L4.1 @ 6000 Kbps”, -vid 0
[mkv] Track ID 2: audio (A_DTS) “Audio: English DTS 5.1 @ 1509 Kbps”, -aid 0, -alang eng
[mkv] Track ID 3: audio (A_VORBIS) “Commentary: English Vorbis 2.0 @ 80 Kbps”, -aid 1, -alang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO: [avc1] 1280x534 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)

Opening video decoder: [ffmpeg] FFmpeg’s libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)

==========================================================================
Opening audio decoder: [libdca] DTS decoding with libdca
Stream with high frequencies VQ coding
AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [dts] afm: libdca (DTS-libdca)

AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback…
VDec: vo config request - 1280 x 534 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.40:1 - prescaling to correct movie aspect.
VO: [xv] 1280x534 => 1280x534 Planar YV12
A: 96.0 V: 96.0 A-V: -0.000 ct: -0.001 0/ 0 53% 2% 7.7% 9 0
Exiting… (Quit)

and its x264 output (this one took much much longer to complete than the first though the file was 4 times as large)

Video: x264_L4.1 @ 6000 Kbps
x264 - core 68 r1179M 96e2229 - H.264/MPEG-4 AVC codec - Copyleft 2003-2009 - VideoLAN - x264 - options: cabac=1 ref=12 deblock=1:-3:-3 analyse=0x3:0x133 me=umh subme=9 psy_rd=1.0:0.0 mixed_ref=1 me_range=32 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 chroma_qp_offset=-4 threads=24 nr=0 decimate=1 mbaff=0 bframes=8 b_pyramid=1 b_adapt=2 b_bias=0 direct=1 wpredb=1 keyint=250 keyint_min=25 scenecut=40 rc=2pass bitrate=6000 ratetol=1.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30 aq=1:0.80
x264


note, one thing I noticed is mplayer from console claims its using oss output if I’m reading the messages correctly, yet I have mplayer configured to use alsa as default.

also, In kaffeine if I try to play one of these files, it just seems to sit there grinding away so I select track info and it displays the following which seems to indicate it can’t properly parse the mkv header for some reason maybe?

xxxxxxx.mkv
Mime:
video/x-matroska
Audio:
0kb/s
Video:
1280x534(1280x534)

it does not really give much information on what could be causing the stuttering. I thought a decoding error or something, but then again if it was a decoding error, you’ll probably see distortions in the video

(btw, when using strings, you don’t have to wait to parse the whole file. Just hit CTRL+C the moment you get the x264 params ;))

When MPlayer is ran from console, it reads a configuration file (if present) in /home/username/.mplayer/config so in there you have to add to use it alsa instead of oss and this is done like below - note the comman at the end! it’s important or it won’t work!

ao=alsa,

I cannot really figure out why these files stutter as the settings look all fine to me. Are you sure you have enough CPU power for decoding? Maybe a throughput problem (tried -cache 8192) ?

As for stuttering, is it the audio or the video that stutters, or both? if audio, it could be DTS causing problems (though it shouldn’t) and if this is the case, try forcing a different audio decoder, -ac dts (needs libdca support in mplayer) or -ac ffdca

its a triple core phenomII 710 so cpu power def isn’t an issue and other HD movies play fine without problem including dolby es or dts which is why I’m trying to use kaffeine as it easily configures the passthrough for this.

Stuttering may not be the proper term, its more like a slight pause while audio/video resync in totem or second or so speedup/slowdown in mplayer to do the same.

thanx for the tips and yarp, I’m used closing commands in config files :wink:
do you know how to make gstreamer apps and mplayer output the dts/dolby over spdif? I know in moovida its apparently a playbin not supporting it vs the newer playbin2 which they aren’t using yet.

Do you know how to get error output from kaffeine/xine so maybe we can figure out what its tripping over? I had already previously tried loading it from console as you had asked with mplayer but it simply opens kaffeine to try to play file and releases console back to me without any console output.

thanx for your help.

I’m coming in late to this thread, and do not understand all that has been exchanged, but there are cases where the pulse audio implementation has caused stuttering. Please take a look at step #7 of the audio troubleshooting guide (and maybe try the work arounds) to see if that helps: SDB:AudioTroubleshooting - openSUSE - step#7

I can’t really help on kaffeine, gstreamer or xine. I’m a 100% mplayer guy and am also invloved on a low level with the project (just sent a patch to fix ve_x264.c due to changes introduced in latest x264 from git)

for passthrough, have you tried: mplayer file.mkv -ac hwdts ?

kaffeine/xine probably also spew messages when ran from console. In mplayer you can increase verbosity with the -v option (adding multiple times -v will increase it more)

I’ve absolutly no idea what causes this “stuttering/pausing” in mplayer on your side. However, I’ve observed that sometimes MPlayer coming from Packman does not behave like it should so I never use it and always compile from SVN

tried the force dts and as long as I set ao=alsa then it works. I just went to the mplayer wiki and found that -afm=hwac3 should handle both dts and dolby, added that to the config file as well so thank you for this tip! :slight_smile:

kaffeine as I mentioned doesn’t output anything to the console when I run it from there, it simply opens the player with the file specified and releases the console back to me at the prompt. I’ll google a bit more and see if there is a way or a logfile it creates or can create.

Do you have a ‘happy’ working build of mplayer which runs on suse 11.1 64? I’m willing to try. Alternatively I can compile it with whatever settings you recommend. I’ve dealt with Toni at packman and he’s been really good in the past for fixing bugs in his packages.

thanx as well oldcpu, I’ll look at the pulseaudio issues as well but I’m thinking there is something else involved since most of my movies work fine. all my avi’s, half of my mkv x264’s. its just a small handful of the mkvs that are causing me headaches. I’m going to test them on a windows box later to see if klite pack with mediaplayerclassic has issues as well.

After I posted, I was thinking the same … although if there are some mediaplayer applications that have the stuttering and others that do not, then it could be the media players with the alsa api selected do not have the stuttering, and ones with pulse selected had the stuttering. But it reads now that is not what you are seeing, but rather you are seeing something on a specific multimedia file basis? In which case given mkv is a container, you could check the bit rate (and other characteristics) of those x264 in the mkv that cause the stuttering, and see if there is a pattern there?

none are configured to use pulse, I use alsa for everything (as it was easiest to get ac3/spdif working to receiver). those that stutter don’t even work in xine apps including xine-ui, dragonplayer or kaffeine.

already starting to compare side by side. Gonna grab a few more randomly just to test with.

Yes, I have a happy working build and don’t have any problems with it. I just pull from SVN and compile with --enable-gui --disable-lirc --disable-lircc (use enable/disable options to your liking though). I can’t package MPlayer in my repo though. Not allowed by the rules :frowning:

I was gonna ask you for a sample but then again, there’s no guarantee that it will stutter too

ok, I’ll attempt to compile with those settings.
I’ll also look into cutting a large enough sample of one of these videos for you to test with.

looks like I can start kaffeine --verbose>logfile and it’ll spit out any errors for me. not there right now but will test when I get home.

Note that there’s been lots of updating today wrt x264 and it broke some thing in MPlayer and ffmpeg’s libavcodec. Jason (Dark Shikari) updated libavcodec in ffmpeg and I posted a patch on the mplayer-dev list which updates ve_x264.c. I don’t know if they have pushed it yet, but if not, below is the link (I assume you know how to patch?). The patch is needed as mplayer will error out on compile without it. It’s a one-liner patch

http://microchip.bplaced.net/ve_x264.diff

Sorry for not updating, I’ve been crazy busy with work and haven’t even looked at my htpc in a couple days. Is the diff still needed or has your patch made it in to svn already?

I do plan on trying this as well as getting a verbose log out of kaffeine tonight sometime.

It’s not needed anymore, they pushed the patch so you can just check out and compile. Make sure to first get latest x264 version from git and compile & install before mplayer