Author Topic: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC  (Read 32219 times)

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Hello,

I found a way to playback 1080p MKV/H264/X264 files on LinuxMce using the commercial CoreAVC decoder. The file on which I tested this is particular was unwatchable before, as the CPU was being maxed out at 100%. Now in runs around 70% on the same file and I could watch it without problem.
It uses the standard Xine_Player, so there is full support for pause, fast forward, seeking etc...

I listed the instructions on this wiki page. Feel free to edit for cosmetics or any errors you may find, and let me know in this thread how it works out for you...

Jean

EDIT: sorry apparently I had copied the wrong link above. I have corrected it now.
« Last Edit: July 14, 2008, 09:27:48 pm by jeangot »

padrino

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #1 on: July 14, 2008, 07:12:24 pm »
Hello,

I found a way to playback 1080p MKV/H264/X264 files on LinuxMce using the commercial CoreAVC decoder. The file on which I tested this is particular was unwatchable before, as the CPU was being maxed out at 100%. Now in runs around 70% on the same file and I could watch it without problem.
It uses the standard Xine_Player, so there is full support for pause, fast forward, seeking etc...

I listed the instructions on this <a href=http://wiki.linuxmce.org/index.php/Adding_new_computing_apps>wiki page</a>. Feel free to edit for cosmetics or any errors you may find, and let me know in this thread how it works out for you...

Jean

Great solution!

I haven't tried it yet but I definitely will when I get home. I spent some time this weekend changing extensions from .mkv to .m2ts because mlayer can handle 1080p on my AMD 4200 but Xine cannot. In the end I changed them back because trick play is weak with mplayer, hopefully this solves it.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #2 on: July 14, 2008, 07:24:20 pm »
Padrino,

Mplayer was still maxing out on my MKV file, but it was 1080p, maybe that was the reason. Out of curiosity, when you play your files in Mplayer, are you able to pause/fast forward? Seems that some people are and some people are not. For me that was a problem because I can't take the risk of starting a movie without being able to pause if I have to and then resume...

Jean

Itsik

  • Guru
  • ****
  • Posts: 190
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #3 on: July 16, 2008, 07:08:09 am »
Has any one else tried it ?

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #4 on: July 31, 2008, 09:31:19 am »
I have tried, but all I managed to do was to get no media working....
I did correct a spelling error on the wiki.... Was it a spelling error?!?

In section 9, libxine was called lixine and the command failed. I renamed it to libxine.

I was not able to compile on the MD, so I compiled on my Core and copied the files from /usr/local/lib to my MD.
Then I did this:

cd /opt/libxine/lib
rm libxine.so.1
ln -s /usr/local/lib/libxine.so.1.19.0 libxine.so.1

No errors, reboot and now no media works...
I'm now running a rebuild on the MD and will try again...

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #5 on: July 31, 2008, 05:05:52 pm »
Cirion,
I reinstalled the patch a few days ago following my own instructions in the wiki and also noticed some typos, probably due to someone formatting my ugly page. I corrected them to my best, but if you read lixine it was definitely an error.

Is your MD and Core the same architecture? Because if one if 32 bits and the other is 64 then you can't copile on one and copy to the other. Why won't it compile on your MD anyway, what's the error?
Also if you go to the KDE Desktop on your MD and try to launch xine from a terminal window, it could help you determine what's wrong, whether it cannot find the library, or whether it cannot read the library or maybe something else usefull.

Jean

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #6 on: July 31, 2008, 07:28:54 pm »
...
I reinstalled the patch a few days ago following my own instructions in the wiki and also noticed some typos, probably due to someone formatting my ugly page. I corrected them to my best, but if you read lixine it was definitely an error.
...

Just out of curiousity, do you always blame others for your own shortcomings?
"Change is inevitable. Progress is optional."
-- Anonymous


cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #7 on: July 31, 2008, 11:54:18 pm »
The compiler did not work when the source was on the Core... I copied the source of Xine to my MD's home directory and the compiler worked.
I also had a error complaining about XSHM extensions. I installed libxext-dev and it compiled :)

This time I can play my media, but I do not see any improvements...
Same amount of jerkiness in MKV's and I still have the same amount of green errors...
Running the same MKV in the KDE desktop on the same MD triggers Kaffeine. An it plays with the same jerkiness but without the green errors....
Running the same MKV in windows on the same MD and CoreAVC installed, it plays smooth, no jerkiness, And it does not have green errors...
CPU load in windows is round 58 - 78% with CoreAVC. Without it used to be 98 -100%.

Is there a way to check if Xine is running with CoreAVC? Can I see the CPU load in LinuxMCE somewhere?

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #8 on: August 01, 2008, 12:33:59 am »
@ Zaerc: in general yes, I always like to blame others :-) I was referring to the changes you can see here http://wiki.linuxmce.org/index.php?title=How_to_play_MKV_H264_X264_video_files_using_CoreAVC_in_Xine_Player&diff=prev&oldid=14965 in step 3 and step 8, where the < signs are getting messed up in the command lines somehow and copy/paste will no longer yield a working commandline.
But in general my quote: <quote>probably due to someone formatting my ugly page</quote> was meant as a compliment to whoever took the time to make the ugly page look nice, so thank you!

By the way, did you get my solution to work?

@Cirion: that's odd that it wouldn't compile, I would assume that we all start off the same system with the same libraries, so if it works for me it should work for you. Perhaps you hadn't completed all the steps of setting up a dev environement, including compiling the whole LinuxMCE even if you're not going to use it (that seems to install some needed missing pieces)

Most likely xine is not using your newly compiled libxine.so.1.19.0
In KDE, run xine from a terminal window with the option --verbose. Not Kaffeine (which doesn't give enough debug info).
So: xine /path/filename.mkv --verbose
Somewhere it will say what type of stream it found and what decoder it's going to use. If it works, it should talk about CoreAVC as opposed to Matroska

When I had this problem where xine wasn't picking up the right module, I searched for every libxine.so.* on my system (and they were in 3 places I believe), renamed them all to something else (like .old) and then ran xine again. Now xine will complain that it cannot find the shared object and give you a path name. Now go back to that pathname and put your newly compiled shared object (which you can identify based on the timestamp) and start xine again. See if that helps.
From memory, KDE is using the shared object in /usr/lib, the install defaults to /usr/local/lib and LMCE uses the one in /opt/libxine/lib, so once it works in KDE it doesn't mean that it will work in LMCE yet.

Jean

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #9 on: August 01, 2008, 01:51:43 am »
@ Zaerc: in general yes, I always like to blame others :-) I was referring to the changes you can see here http://wiki.linuxmce.org/index.php?title=How_to_play_MKV_H264_X264_video_files_using_CoreAVC_in_Xine_Player&diff=prev&oldid=14965 in step 3 and step 8, where the < signs are getting messed up in the command lines somehow and copy/paste will no longer yield a working commandline.
But in general my quote: <quote>probably due to someone formatting my ugly page</quote> was meant as a compliment to whoever took the time to make the ugly page look nice, so thank you!

By the way, did you get my solution to work?

...

I'm very sorry but this: tar -xjf <path to dshowserver-ia32-r63-gentoo.tar.bz2 is just plain wrong, either you are telling tar to read from a file and then redirect a file to it's standard input instead, or you're intending a <placeholder> but you forgot the ">".  Instead I don't really see much of a problem with tar -xjf <path/to/>dshowserver-ia32-r63-gentoo.tar.bz2, so please enlighten me.

If you'll check the man page, you'll find that: patch -p1 < <path to coreavc-for-linux>/xine/dshowserver.patch is actually equivalent to: patch -Np1 -i <path/to/coreavc-for-linux/>xine/dshowserver.patch.  With the added benefit of quitting if the patch was already applied, instead of asking to reverse the patch instead which can be confusing. 

Now obviously pasting things with <placeholders> isn't going to work when you copy/paste them literally anyway, but the real problem however was because you misspelled "libxine" in the first place.  So thanks for your lovely "compliment", but the only one that messed up here was you.  It's a bit sad to see you (and nobody but you) complain about these non-related trivial things to cover that up though.

And no, I haven't tried it myself because I don't see this problem at all (apart from that I am not a big fan of closed source software).  But if I had, we probably wouldn't even be having this discussion now would we?

"Change is inevitable. Progress is optional."
-- Anonymous


jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #10 on: August 01, 2008, 02:23:39 am »
Zaerc,
I really didn't mean to fight with you or anyone, and I'm not complaining either. I am truly gratefull that you took the time to format my page nicely, even more so if you';re not using the content! I do see now that I forgot a > in my point 3), however when I was copying your version which looked like this on the screen:
Quote
tar -xjf <path to> dshowserver-ia32-r63-gentoo.tar.bz2
it was showing up like that in my terminal
Quote
tar -xjf ''&lt;path/to/&gt;''dshowserver-ia32-r63-gentoo.tar.bz2
(which I cannot reproduce right now by the way) so that's why I went back to the source and changed the &lt; to < and so on and assumed that it got messed up during editing.

Thank you for enlightening me about the patch options, that is indeed very usefull as I got that message myself  when trying to apply the patch twice and it's a bit confusing.
Jean

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #11 on: August 01, 2008, 07:27:36 am »
This is what happens when trying to compile xine when the source is in the Core's home folder:
Code: [Select]
root@moon59:/home/linuxmce/charon-merge/ubuntu/xine-lib-1.1.10.1# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking build system type... (cached) i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
root@moon59:/home/linuxmce/charon-merge/ubuntu/xine-lib-1.1.10.1#

If I copy the source to my MD, it does not have this error.

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #12 on: August 01, 2008, 09:44:41 am »
I renamed the xinelib.so.1.17.1 that xine in KDE was using, and renamed it. Then i tried running it and of course it did not work.
I then copied the xinelib.so.1.19.0 to the same folder and renamed it to xinelib.so.1.17.1 and tried again.

This time the jerkiness is at a whole new level! Now the hole screen is jumping 3-4cm a second....

I belive this is what you want:
Code: [Select]
xine: found input plugin  : file input plugin
xine: found demuxer plugin: matroska demux plugin
demux_matroska: Track 1, V_MPEG4/ISO/AVC und
demux_matroska: Track 2, A_DTS eng

CoreAVC is not used...

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #13 on: August 01, 2008, 06:55:41 pm »
Cirion,

you;re right, it's not working. I just tried in again on my MD that I reinstalled, and it seems that the newly compiled libxine does not launch CoreAVC. I wonder what has changed or if I wrote down the incorrect version number for libxine. I know it's not the patch as it has not been changed since I last tried it. Give me a little time and will find out what's wrong and let you know. I need to anyway for my own MD now.
You're 80% done, it's just a matter now of getting libxine to launch dshowserver which launches CoreAVC.

Jean

cirion

  • Guru
  • ****
  • Posts: 353
    • View Profile
Re: Playback of MKV/H264/X264 HD video files: a solution using CoreAVC
« Reply #14 on: August 01, 2008, 07:25:41 pm »
I kind of figured that out... I have tried 3 times now, same result every time...

I shure hope you figure this out :)