PDA

View Full Version : Pure video 1080i -> 720p & camera panning


mrwhitethc
27th March 2006, 15:10
I have some Discovery HD Theater Festival episodes that I've capped and would like to encode them to xvid 720p, native res of my projector. I have one major problem, if anyone can help it would be appreciated. The major problem is all the camera pans are extremely choppy and there are many of them in this series. I've tried TDeint, Mvbob and AutoGK and none of them produce smooth camera movement, they all seem to deinterlace fine with little to no combing artifacts left. Any help appreciated. If anyone needs to see an example and can tell me where to up a chunk of the .TS file I'll be more than happy, I'm starting to get a lot of these DHDT episodes and they are eating up a lot of space. :) Thanks again.

neuron2
27th March 2006, 18:04
Post a link to an unprocessed source TS fragment containing a pan. There are may free hosting sites.

mrwhitethc
28th March 2006, 03:27
http://www.bestsharing.com/files/ms00111268/Clip.0001.ts.html

thank you for looking into this.

SeeMoreDigital
28th March 2006, 11:41
Damn....

I'm unable to download your 95.36MB sample. When I left click or right click on the link nothing happens :(

mrwhitethc
28th March 2006, 13:49
That's odd, it shows that it's been downloaded 25 times, I'm trying to upload it to a second site to see if that will help.

SeeMoreDigital
28th March 2006, 14:33
That's odd, it shows that it's been downloaded 25 times, I'm trying to upload it to a second site to see if that will help.It's most probably my broadband "Internet Service Provider".... For some reason it does not like some of these file sharing sites, especially RapidShare.

Thankfully, Richard Berg (one of our forum moderators) has provided us with some very temporary file hosting space. A link to it can be found in "his sig" (http://forum.doom9.org/member.php?u=1704).


Cheers

mrwhitethc
28th March 2006, 15:10
Here's a second link (http://www.badongo.com/file/380456) If that doesn't work, late tonight, when I get home I'll upload it to the temp share SeeMoreDigital pointed me too.

scharfis_brain
28th March 2006, 15:26
you'll need to create a 59.94fps XVid video file to preserve all the motion smoothness.

the following script does the resizing and deinteralcing needed for such an encode:
mpeg2source("C:\Downloads\forum\mrwhitethc\Clip.0001.d2v",cpu=6)
crop(0,0,0,-8,align=true)
bicubicresize(1280,height)
tdeint(mode=1,type=2)
bicubicresize(1280,720)

mrwhitethc
28th March 2006, 18:02
Thank you for the reply I'll try when I get home, I have a question so I can understand this better next time, why is there 2 resize commands? Since the clip is 1920x1080 and I would like 1280x720 output would it read:

mpeg2source("Clip.0001.d2v",cpu=6)
crop(0,0,0,-8,align=true)
bicubicresize(1280,1080)
tdeint(mode=1,type=2)
bicubicresize(1280,720)

SeeMoreDigital
28th March 2006, 18:19
Thanks... I've got the source sample now ;)

All the frames appear to be interlaced, ie: running 29.790 frames per second/59.940 fields per second. So you have a couple of choices when encoding to MPEG-4.

Your first choice is to do what scharfis_brain suggests. Effectively converting each separate field into a progressive frame.

Your second choice is to keep everything interlaced. Thankfully the XviD codec offers an interlaced encoding option. So provided your encoding GUI (AutoGK) allows access to the option and also gives you the option of turning off any other automatic de-interlacers, you should be able to generate "interlaced" MPEG-4 encodes!

Unfortunately, I'm not 100% sure whether XviD's MPEG-4 direct-show decoder supports "interlaced" playback (or any other popular MPEG-4 decoder for that matter). So my suggestion might be a total waste of your time.

However, I can confirm that it's possible to playback interlaced encodes in all of the Sigma EM8620L chip-set based "hardware" players.

Here is an HDTV Interlaced Comp Test (http://www.one.seemoredigital.net/Temp_Files/HDTV_Interlaced_Comp_Tests.7z) example. Both of which play perfectly smoothly in hardware, with no motion blur!


Cheers

mrwhitethc
28th March 2006, 21:16
Actually I really want to get this to a progressive state, my projector and output device are both 720p. I'm hoping to offload having to do deinterlacing now since I'm reencoding this already.

scharfis_brain
28th March 2006, 21:27
there are two resizing instances to speed up the encoding process.

one can resize interlaced contents in horizontal domian without negative side effects.
I do this before deinterlacing, to minimize the pixels that are passed to the (relatively) slow deinterlacer.
after deinterlacing the video is resized in the vertical direction, because one only can properly resize interlaced contents after deinterlacing.

so,

mpeg2source("Clip.0001.d2v",cpu=6)
crop(0,0,0,-8,align=true)
tdeint(mode=1,type=2)
bicubicresize(1280,720)

is slower than

mpeg2source("Clip.0001.d2v",cpu=6)
crop(0,0,0,-8,align=true)
bicubicresize(1280,height)
tdeint(mode=1,type=2)
bicubicresize(1280,720)

and you should NOT replace height by a fixed number.
height ensures that there won't be applied any vertikal resizing (which will destroy every interlaced strucure, if done before deinterlacing)

mrwhitethc
28th March 2006, 22:15
Thank you for explaining that, makes sense not sure why I didn't think about that. :) I won't be home for atleast another 7 hours so I can't report back until the am as to my results, but as usual the forum gods are probably going to be spot on.

SeeMoreDigital
28th March 2006, 22:35
Actually I really want to get this to a progressive state, my projector and output device are both 720p. I'm hoping to offload having to do deinterlacing now since I'm reencoding this already.Then without doubt you need to follow scharfis_brain's method.

I would be most grateful if you could try using the MPEG-2 sample I provided as a source, when generating your progressive 1280x720/60p (59.940fps) MPEG-4 encode.


Cheers

mrwhitethc
28th March 2006, 22:53
Sure, it's the least I can do after you guys helpped me. I'll queue it up along with my sample tonight.

SeeMoreDigital
28th March 2006, 22:58
Sure, it's the least I can do after you guys helpped me. I'll queue it up along with my sample tonight.Thanks.... I'll test it in my hardware player an report back my findings ;)

mrwhitethc
29th March 2006, 15:08
Here are the links, first is the DHDT content (http://www.badongo.com/vid/80574) and second is from SeeMoreDigital (http://www.badongo.com/vid/80580). I didn't get a chance to test this before I ran out of the house but here at work using VLC these 2.8ghz p4's are hitting 100% CPU. Can that be right, did I screw up or is VLC a hog, and I did make sure to uncheck the resample high quality audio box. It's still slightly choppy on pans but here's hoping that is becuase of whatever is going on here. Just brainstorming out loud here but if Xvid is going to take up that much resources maybe I should encode back to MPEG-2? Too bad DooM9 doesn't have a guide for encoding HD in CCE with 59.940fps :)

Pookie
30th March 2006, 01:42
Forgive the slightly OT question, but doesn't the bottom crop affect the deinterlacing if you do it before Tdeint ? Is that also the case with IVTC ?

mrwhitethc
30th March 2006, 02:53
Hrmm I don't think that's off topic at all, you may be right. Anyone else with thoughts on this?

scharfis_brain
30th March 2006, 06:10
crop will NOT affect interlacing especially when applied at the bottom or the sides of a video.
the only limitation is with YV12 colorspace: odd numbered cropping on the top border will result in a field order reversal.
YV12 restricts cropping (due to the subsampled chroma) to mod2 (even numbered) cropping, so there won't be any problem with cropping.

the crop(0,0,0,-8,align=true) command is used to get rid of the unecessary 8 lines at the bottom of 1080i...

mrwhitethc
30th March 2006, 06:27
Thank you once again, secondly anything i can do to bring the CPU requirements down? Now that it's 720p @ 59.975 (http://www.badongo.com/vid/80574) , same as the previous link, it seems to be eating all the CPU's I have for lunch, fastest is an Athlong 64 3700+. I did a few more tests with TDeint and YV12InterlacedReduceBy2 and when I use reduceby2@29.975 and keep the bitrate around 6mb's the 3700+ hit's around 50%-60% CPU usage in Media Player Classic, nothing else running. I read the guide @ DooM9 and don't see anything on options to reduce the playback overhead. I left everything default minus the bitrate, unrestricted profile and a quant type of MPEG. Should i scrap Xvid in favor of a lighter weight decoder, is there any, while keeping it in the realm of MPEG, Xvid, Divx and x264?

Pookie
30th March 2006, 09:00
scharfis -
:thanks:

Good to know.

SeeMoreDigital
30th March 2006, 10:23
Hi again,

As promised I tested the MPEG-4 1280x720/60p encode you generated for me and it appears to play fine in hardware....

When playing on a PC you're right about the amount of CPU power consumed :scared:

mrwhitethc
30th March 2006, 14:09
And that's what's left me scratching my head, I'm at a loss, good thing I picked up this empty 300gb drive while we figure this out :) I'm thinking maybe since Tdeint is getting rid of the interlacing, and each field is now "progressive" I could go down to 24fps like you would a 720p movie, any thoughts on this and if it would lower our cpu consumption? SeeMoreDigital what hardware player do you have? Been thinking about one for a long time but had been holding out for x264 support.

SeeMoreDigital
30th March 2006, 17:42
A 1280x720 frame containing 921,600 pixels at 60 frames per second, equates to 52,296,000 pixels being rendered each second.... A 1920x1080 frame containing 2,073,600 pixels at 30 frames per second, equates to 62,208,000 pixels being rendered each second..... In both cases this is a lot of pixels :eek:

That said, I think it's fair to say there's still some progress to be made with regard to MPEG-4 SP/ASP direct-show decoder performance. Especially if we take into consideration the great strides the guys at Core have made with their MPEG-4 AVC direct-show decoder filter :)

mrwhitethc
30th March 2006, 20:46
Interesting, I've heard you can get very good quality with x264 using lower bitrates, and I've also seen that bitrate can impact performance along with resolution. I haven't tried anything x264 but I'm willing too if it results in a lower sys requirement. I guess the big thing is finding the sweet spot. I'm trying to shoot for 720p @ a framerate that is smooth on playback on a sub 2ghz machine.

mrwhitethc
31st March 2006, 14:23
I'm going to try encoding the clip using TMPGEnc @ 720p can anyone give me the correct settings for this? Like Profile & Level, Max bitrate, fps, etc Or should I just stick to the dvd guide? I'm thinking I should be able to change a few things to tweak the encoder a bit.

mrwhitethc
1st April 2006, 20:16
Moved the topic of TMPGEnc over to the Mpeg1/2 Encoders thread:

http://forum.doom9.org/showthread.php?t=109450

Thanks all, now the battle has turned from camera pans to encoding these things to something playable.

As a side note I can swear I'm getting a single frame jerk in the panning of the xvid posted, can anyone confirm this, or have I just watched this way too many times?