BIG FAT DISCLAIMER!
CAUTION! THIS KNOPPMYTH H.264 MPLAYER HOWTO IS A FIRST DRAFT! I JUST GOT THIS TO WORK AND HERE IS WHAT I DID (I THINK).
THESE INSTRUCTIONS ARE *DRAFT* AND SUBJECT TO REVISION! IF YOU USE THEM AND YOUR COMPUTER EXPLODES DON'T BLAME ME!
YMMV!
1. update MPlayer using Graysky's instructions but substitute the MPlayer instructions for building from cvs.
http://www.mplayerhq.hu/homepage/design7/dload.html
http://mysettopbox.tv/phpBB2/viewtopic. ... 6564#26564
Graysky's instructions worked great (with the modification for cvs MPlayer). Thanks!
(note, using cvs MPlayer is mandatory if you want H.264)
2. Turn off the KnoppMyth installed MPlayer with this crude hack and use the newly installed MPlayer and MEncoder instead
#cd /usr/bin
#mv mplayer mplayer.bak
#ln -s /usr/local/bin/mplayer mplayer
then you also need to do the same hack to mencoder that you did to mplayer
#cd /usr/bin
#mv mencoder mencoder.bak
#ln -s /usr/local/bin/mencoder mencoder
3. Update your apt databases (this gets a bit scary as it updates "locales") and install subversion. Caution, using apt-get can potentially hose your system. Use caution and make a backup before proceeding.
#apt-get update
#apt-get install subversion
4. Next, to add in H.264 follow the instructions in paragraph "2.2.1.10.4. How can I encode videos using MEncoder and x264?" from
http://www.mplayerhq.hu/DOCS/HTML/en/codecs.html
Quote:
2.2.1.10.4. How can I encode videos using MEncoder and x264?
If you have the subversion client installed, the latest x264 sources can be gotten with this command:
svn co
svn://svn.videolan.org/x264/trunk x264
MPlayer sources are updated whenever an x264 API change occurs, so it is always suggested to use CVS MPlayer as well. Perhaps this situation will change when and if an x264 "release" occurs. Meanwhile, x264 should be considered very unstable, in the sense that its programming interface is subject to change.
x264 is built and installed in the standard way: [ed note: cd to the x264 directory, presumably in /root/x264]
./configure && make && sudo make install
This installs libx264.a in /usr/local/lib and x264.h is placed in /usr/local/include. With the x264 library and header placed in the standard locations, building MPlayer with x264 support is easy. Just run the standard: [ed note: cd to the cvs MPlayer directory, presumably in /root/main]
./configure && make && sudo make install
The configure script will autodetect that you have satisfied the requirements for x264.
5. To do the transcoding, you need a script with the proper commands for MEncoder.
Quote:
# cat /usr/local/bin/mpg2avc
for file in $*
do
mencoder -ovc x264 -x264encopts pass=1 -nosound -o $file.x264.avi $file
mencoder -ovc x264 -x264encopts bitrate=2200:pass=2 -oac copy -o $file.x264.avi $file
done
Here is another script to transcode but using the xvid codec
Quote:
#cat /usr/local/bin/mpg2avi
for file in $*
do
mencoder -ovc xvid -xvidencopts pass=1 -nosound -o $file.avi $file
mencoder -ovc xvid -xvidencopts bitrate=2200:pass=2 -oac mp3lame -lameopts preset=medium -o $file.avi $file
done
The scripts pretty much work. Please note they are hardcoded to 2200 kbps.
Thats it. Follow these instructions and you can play H.264 and even transcode your video to H.264
POST INSTALL NOTES
to test the decoder but I did sort of a test by doing this... (/dev/video1 is a hauppauge PVR-250)
#cat /dev/video1 >test.mpg
#mpg2avi test.mpg
#mpg2avc test.mpg
to be honest, the H.264 quality is watchable but is not as good as the xvid at first review.
I suspect that I'd need to tweak this a bit to make better quality video.
I did try to download some samples like the WMV HD Serenity video and Robotica from MS but they either did play correctly. Serenity played corrupted (like it has DRM encryption) and the Robotica didn't play at all.
I tried transcoding with a nova.mpg recorded off the HD-3000 in SDTV format (704x480 MPEG-2 TS) and of course the xvid transcodes fine and the x264 transcodes fine as well (its not finished yet). The transcoded files appear to have identical video quality to the original nova.mpg. There is one big difference though and that is the time to encode. Xvid is near realtime even in the 2 pass configuration transcode but the x264 is W A A A A Y slow. That is to be expected since its so early and it is advertised as processor intensive encoding.
I can't post file sizes yet. I also ran into another problem and that is since Nova.mpg is a PBS SDTV digital broadcast for some reason the audio is not on the default track. Using the MythTV internal viewer I have to press '-' to get the audio to play. Of course when the file is transcoded the audio disappears entirely and I can't get it to appear at all. I can see the video though.
I have changed course and am now going to try this transcoding again with a LOST episode from Wednesday. It was recorded in HDTV and is 13 GB long. I suspect the transcode on that file will take for ever so I will post you when its done.
One thing that would really help me out would be some "reference" or sample H.264 videos posted somewhere. Not the movie trailers like Serenity, although it is H.264 encoded it requires a license from NBC to run so the file is likely encrypted and when you play it you get garbage.
I really need some objective independent H.264 sample to test out the H.264 capabilities of the MPlayer. If you have some or know where some are please post a link because I cannot find any I can get to work.
THANKS!
Andrew Lynch