View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 32 posts ] 
Go to page 1, 2, 3  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: HDTV > H.264
PostPosted: Wed Sep 14, 2005 9:37 am 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Now that Cinelerra 2.0 is out and supports H.264, this might be an option to save HDTV. Record your program in HD using MythTV, transcode to H.264 using Cinelerra! Thoughts?

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 10:31 am 
I was considering installing the latest MPlayer and the x264 codec to get H264 support for videos and do some experiments.

I saw the Cinelerra announcement a few days ago and looked impressive but I discounted it because the hardware requirements are huge!

Quote:

RECOMMENDED SYSTEM

Now Cinelerra is by no means a lightweight program. You'll need something slightly less sexy than an Ipod to run it most effectively. Running in 32 bit mode is not recommended. We found this dual dual core Opteron with 128 bit, interleaved memory to be years ahead of anything else. It compresses MPEG-4 HDTV in realtime. The key is separate memory busses for each processor. Be aware most cheap motherboards share the memory bus of one processor with both processors.

Dual Opteron 275
4 * 1 Gig Registered PC3200 RAM
500 GB SATA drive
Tyan S2885 motherboard
Gigabit ethernet



Can the MPlayer Mencode transcode HDTV TS MPEG2 to H264? That might be an easier addition to KnoppMyth since it is basically just an update to what is already included.

Andrew Lynch


Top
  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 11:31 am 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Those are the recommended specs, Cinelerra is aimed at the "professional" arena. It will happily run much slower systems. In theroy, MPlayer/Mencoder can transcode to any format it understands, so yest it should work. I await the results of your experiments!

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 6:52 pm 
Well, it looked good but crapped out near the end. Oh well, at least I got an updated MPlayer out of the deal!

here are the instructions I followed:

1. update MPlayer using Graysky's instructions

http://mysettopbox.tv/phpBB2/viewtopic. ... 6564#26564

Graysky's instructions worked great as is. Thanks!



2. Turn off the KnoppMyth installed MPlayer with this crude hack and use the newly installed MPlayer instead

#cd /usr/bin
#mv mplayer mplayer.bak
#ln -s /usr/local/bin/mplayer mplayer

3. Update your apt databases (this gets a bit scary as it updates "locales") and install subversion

#apt-get update
#apt-get install subversion


4. Next, 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:

./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:

./configure && make && sudo make install

The configure script will autodetect that you have satisfied the requirements for x264.



5. I was doing great until I got to the last line to rebuild MPlayer with the x264 library installed. I got an error compiling an x264 file complaining about missing a data structure of some sort. Recognizing this is out of my league, I decide to remove x264 and rebuild MPlayer

#rm /usr/local/lib/libx264.a
#rm /usr/local/include/x264.h

6. At this point you can just rebuild MPlayer but to be on the safe side go back to using Graysky's instructions and wipe out the untarred directories and rebuild MPlayer from the tar balls. I did that and now everything works fine.

Does any other brave soul want to give this a try and maybe figure out why MPlayer would not compile with the x264 binaries present? I know that x264 is in super early pre-alpha state so it isn't a surprise. Maybe someone can fix that and we can proceed with x264 enhanced MPlayer.

Really, what we need is x264 encoding capable Mencoder. Then my modified mpg2avi script might work

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



Thanks!

Andrew Lynch

PS, looking this over in hindsight, probably what I really need is a cvs version of MPlayer. I will experiment with that later...


Last edited by lynchaj on Fri Sep 16, 2005 5:54 am, edited 1 time in total.


Top
  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 8:01 pm 
OK, more experimenting.

Good news, I got it to work. I can play and encode H.264 on my KnoppMyth box.

the key was to use the MPlayer cvs version.

Just follow Graysky's method but substitute the MPlayer instructions for building from cvs.

http://www.mplayerhq.hu/homepage/design7/dload.html

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

The script pretty much works as is. Please note it is hardcoded to 2200 kbps.

Thats it. Follow these instructions and you can play H.264 and even transcode your video to H.264

Comments, improvements?

Thanks!

Andrew Lynch


Top
  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 8:18 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
How is the quality? What was the size (length and file size) of the program? What is the size of the transcoded file?

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 9:29 pm 
well, I am having a difficult time finding a reference or sample H.264 video to test the decoder but I did sort of a test by doing this...

#cat /dev/video1 >test.mpg

#mpg2avi test.mpg

#mpg2avc test.mpg

the results are:

#ls -al test*
-rw-r--r-- 1 root root 10682752 Sep 15 23:19 test.mpg
-rw-r--r-- 1 root root 3578376 Sep 15 23:21 test.mpg.avi
-rw-r--r-- 1 root root 3817294 Sep 15 23:19 test.mpg.x264.avi

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.

Thanks!

Andrew Lynch


PS, 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.

My next attempt is to try to get MPlayer to recognize a MPEG TS stream and then transcode it.


Top
  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 9:52 pm 
I can convert MPEG-2 TS streams to xvid but not to H.264. Hmmm..

# ls -al tst*
-rw-r--r-- 1 lynchaj lynchaj 32870064 Sep 15 23:15 tst.ts
-rw-r--r-- 1 root root 22238438 Sep 15 23:42 tst.ts.avi
-rw-r--r-- 1 root root 28116 Sep 15 23:43 tst.ts.x264.avi

the MPEG-2 TS streams converted to xvid look awesome.

MPlayer refuses to play the MPEG-2 TS streams but plays the converted xvid no problem.

??? I need to convince MPlayer to play MPEG-2 TS

Andrew Lynch

PS, its late but before I go to bed I am going to start a job on the PVR to transcode a Nova that I captured in SDTV (its a digital channel of the HD-3000 in 704x480 resolution in MPEG-2 TS) into xvid and then into H.264.

I will post the results tomorrow. Hopefully they will work. G'nite!


Top
  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 10:58 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Cool. Thanks for the updates. I'd like a way to preserve HDTV recording at the best possible quality. I don't care too much about making DVDs that will play on regular DVD players (as I don't own one...).

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 4:45 am 
I just checked on the PVR. If I change the name of tst.ts to tst.ts.mpg MPlayer *will* play it as expected. Mencoder transcodes it to Xvid just fine but when it tries x264 it creates a small junk file. No luck there.

So, I tried it again with the nova.mpg 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.

Thanks!

Andrew Lynch

PS, 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!


Top
  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 5:51 am 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
This guy did a TON of quality tests with H.264 at a bunch of different resolutions

http://www.shapeofdays.com/2005/05/a_demonstration.html
http://www.shapeofdays.com/2005/05/more_h264_demon.html
http://www.theshapeofdays.com/2005/05/h ... hree_.html

He used Apple's H.264 implementation to create them; not sure if that will matter.

PS: did you say you're using about a 2200 kbps bitrate for your transcoding?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 6:11 am 
Thanks!

At first glance, that is what I thought I needed, however, after looking them over what I really need is just a direct link to the H.264 encoded files. The apple quicktime files require a Win32 plug-in and maybe I can save the files, I don't know. I would prefer a direct URL to a HTTP or FTP server that I could right click on and do a "save target as" to download the mpeg rather than going through a plug in.

I will try to test them out this evening or whenever my LOST transcode finishes (probably quite a while!).

Yes, I hardcoded the script for 2200 kbps bitrate transcoding. Why? Because that is the value the MPEG-2 trancoder profile uses to create MPEG-4's of approximately 1 GB per hour of video. I really don't have a any other reason. It seemed like a good idea at the time. Hopefully some of the other experimenters here will tweak the scripts for better performance, options & such.

Andrew Lynch

PS, after a more careful look at the article, on the third link at the bottom there are some *.mov files which I can directly download. I put them in the PVR and the play. They are awesome, beautiful images. Thanks for the info! COOL! HD H.264!


Top
  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 8:14 pm 
Hi,
I have been still twiddling with x264 and Mplayer/Mencoder. After some learning curve, I have some very interesting results I'd like to post and maybe start some discussion on.

first, here is the new revised script that converts video (MPEG2) to x264 2pass H.264

note that the x264 codec does not support interlaced video so I use Mplayer/Mencoder to deinterlace the video prior to conversion so the codec could function properly

Quote:
for file in $*
do
mencoder -ovc x264 -x264encopts bitrate=2200:pass=1 -vf lavcdeint -oac copy -o $file.x264.avi $file
mencoder -ovc x264 -x264encopts bitrate=2200:pass=2:8x8dct:i8x8 -vf lavcdeint -oac copy -o $file.x264.avi $file
done


and a similar script that converts video into xvid 2pass MPEG4

Quote:
for file in $*
do
mencoder -ovc xvid -xvidencopts bitrate=2200:pass=1 -oac copy -o $file.avi $file
mencoder -ovc xvid -xvidencopts bitrate=2200:pass=2 -oac copy -o $file.avi $file
done



I recorded a short clip in MPEG2 at 16000 Kbps as the control in the experiment. To keep it simple, I kept the audio the same for all transcodes.

I converted the file at varying bitrates using standard mythtv xvid at 2200 Kbps as a baseline xvid 1 pass trancode comparison.

Then I encoded 3 different bitrate using xvid 2pass and x264 2pass. The results were not very exciting until I lowered the bitrate down to 500 Kbps.

At 2200 Kbps and 1000 Kbps, xvid and x264 both looked pretty much similar to the baseline. Frankly, the baseline transcode looked a lot like the control.

However, when I changed the bitrate to 500 Kbps x264 2pass kept on looking just like the original while xvid really started to noticably degrade.

Now check out the file sizes these varying bit rates generated:


-rw-r--r-- 1 root root 164751946 Oct 12 19:04 test.mencoder-x264-2pass-1000kbps.avi
-rw-r--r-- 1 root root 306938596 Oct 11 21:33 test.mencoder-x264-2pass-2200kbps.avi
-rw-r--r-- 1 root root 105501190 Oct 12 21:23 test.mencoder-x264-2pass-500kbps.avi
-rw-r--r-- 1 root root 159550072 Oct 12 19:03 test.mencoder-xvid-2pass-1000kbps.avi
-rw-r--r-- 1 root root 270719052 Oct 12 06:19 test.mencoder-xvid-2pass-2200kbps.avi
-rw-r--r-- 1 root root 101681648 Oct 12 20:50 test.mencoder-xvid-2pass-500kbps.avi
-rw-r--r-- 1 root root 1826529860 Oct 11 19:29 test.mythtv-mpeg2-16000kbps.mpg
-rw-r--r-- 1 root root 314506090 Oct 12 05:44 test.mythtv-xvid-2200kbps.mpg


The control (original capture) came in at a ridiculus 1.8 GB length. The baseline transcode dropped that to 300MB or so.

Using Mencoder and 2pass transcoding was a bit more efficient and reduced filesize to under 300MB in both cases.

Taking the bitrate down to 1000 Kbps reduced the filesizes of both xvid and x264 to ~160MB

Dropping the bitrate down to 500 Kbps shrunk the filesizes down to ~100MB per, however, the x264 transcode showed little if any degradation while the xvid was noticably showing artifacts.

Now, this is by no means a thorough or scientific comparison. However, it does show the potential of the x264 H.264 codec to dramatically reduce video filesizes while preserving good video quality.

Andrew Lynch

PS, I just noticed that the test.mencoder-xvid-2pass-2200kbps.avi file has a problem in that I mistakenly reconverted the audio. I will rerun the transcode and repost the filesize. It should be more similar to the x264 2pass filesize.


Top
  
 
 Post subject:
PostPosted: Sat Oct 15, 2005 9:01 am 
OK, updated filesizes. As expected the 2 pass 2200 Kbps Xvid transcode is close to 300MB in length with the same audio format.

-rw-r--r-- 1 root root 164751946 Oct 12 19:04 test.mencoder-x264-2pass-1000kbps.avi
-rw-r--r-- 1 root root 306938596 Oct 11 21:33 test.mencoder-x264-2pass-2200kbps.avi
-rw-r--r-- 1 root root 105501190 Oct 12 21:23 test.mencoder-x264-2pass-500kbps.avi
-rw-r--r-- 1 root root 159550072 Oct 12 19:03 test.mencoder-xvid-2pass-1000kbps.avi
-rw-r--r-- 1 root root 302400320 Oct 12 22:43 test.mencoder-xvid-2pass-2200kbps.avi
-rw-r--r-- 1 root root 101681648 Oct 12 20:50 test.mencoder-xvid-2pass-500kbps.avi
-rw-r--r-- 1 root root 1826529860 Oct 11 19:29 test.mythtv-mpeg2-16000kbps.mpg
-rw-r--r-- 1 root root 314506090 Oct 12 05:44 test.mythtv-xvid-2200kbps.mpg


Actually, I am sort of surprised at the relative lack of posting on the forum with regard to the new H.264 format and the x264 codec. I would think that its possibilities have to be appealling to MythTV users and KnoppMyth.

Once x264 releases a version so that other applications (MPlayer, transcode, etc) can support it directly H.264 offers the possibility of dramatic increasing quality of recorded video or doubling the amount of quality video can be stored on any given PVR compared to Xvid.

I am fairly sure interest will heat up eventually.

Andrew Lynch

PS, if anyone can host the videos, I will be glad to upload them so you can see for yourself my results. Better yet, install your own Mplayer with x264 and do your own testing. I am very curious to see anyone elses testing results.


Top
  
 
 Post subject:
PostPosted: Sat Oct 15, 2005 2:03 pm 
Offline
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location: Virginia, USA
This is definitely on my short list of things to try--thanks for posting all of the info. I've used H.264 at work for a few things and it is amazingly good.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ] 
Go to page 1, 2, 3  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu