View Full Version : Conan 1080i, what are my options?
Cheech
27th May 2006, 03:46
I'm trying to encode some HD Conan to XviD and preserve the YV12 colorspace (Which I just learned is a good thing to keep). A little off topic: Is it possible to use a logo filter and keep the YV12? Because previously I used D. Graft's logo filter in Virtual Dub, and had to kick it in full processing mode to do so.
Anyways, I started off with a simple avs script that just loaded dgdecode and that was it, I then cropped, chopped, resized, deinterlaced, and logo filtered all in vd and then export to xvid.
Then a friend informed me on how fields work and said I could make a progessive stream with no artifacts at half res with this script:
LoadPlugin("DGDecode.dll")
MPEG2Source("__vid__")
crop(8,0,-0,-8)
separatefields().selecteven()
bicubicResize(952,height)
This worked, however I am not sure about the choice of the resize command, and I wasent blown away by the results. I'm just not really sure if this is the idea setup.
I then heard talk that with movies you can telecine it back with full res and progressive, and modern TV shows too if they are filmed at some FPS.
And that brings me here, bombarded with options and lots of questions :)
foxyshadis
27th May 2006, 05:52
It may be a bit out of date, but this is still a good intro on interlacing, ivtc, and progressive conversion (http://www.doom9.org/ivtc-tut.htm). But if you only want half the vertical resolution, it's perfectly legal to do that, but make sure you still decimate if necessary.
As a resize, bilinear or gauss will look a little smoother, bicubic and lanczos will look a little sharper (as will spline16 for upsizing). You may want to add a sharpener anyway, like LimitedSharpenFaster, and/or a denoiser.
Guest
27th May 2006, 06:02
Is it possible to use a logo filter and keep the YV12? Because previously I used D. Graft's logo filter in Virtual Dub, and had to kick it in full processing mode to do so. Any filtering in VirtualDub requires conversion to RGB. But you can do your Logo in Avisynth and stay YV12. There are threads about it. Make a new thread if you have to.
I then heard talk that with movies you can telecine it back with full res and progressive, and modern TV shows too if they are filmed at some FPS. Well, yes, it's always preferable to do that, because you retain full vertical resolution. You might try reading the doc foxyshadis pointed you to, as well as the documents that come with Decomb.
Cheech
27th May 2006, 08:31
I wanted to do a preview of the source with DGIndex, to see what the film/video percentages were on a movie clip that was shown mid show. I ended up getting the preview/play buttons mixed up; long story short, I watched the intro of the show instead of what I wanted, and saw the indicators flip-flop from video to film and interlaced to progressive at least 20 times during the intro :( How is that even possible? Also the post=false command for telecine referenced in that guide no longer works, is there a substitute?
I doubt this show is filmed on film at 24 FPS, every frame shows interlacing as far as I can tell. The only thing I really should "pull down" is the movie clips they show during the show, is that possible to do only clips?
neuron2, Check your PM's ;)
foxyshadis
27th May 2006, 09:51
Must be an old manual, because it's post=0 (0-5) now.
If it's a combination of pulldown and true video, you're dealing with hybrid material, which is not very noob friendly. Download megui and analyze it with that, it'll give you a script you can tweak that will effectively deal with the problem.
Progressive/interlaced is just the way some stuff encodes hard pulldown, encoding 3 as progressive and 2 as interlaced. Perfectly legal and won't hurt anything. That'll be a video section, as will a pure interlaced segment, whereas film is soft pulldown and can be safely stripped with force film if the whole movie is.
Cheech
27th May 2006, 23:41
I downloaded megui (cool program) and also ran the analysis pass, it finished and I'm not sure where the "analisis" is. Did it just make a .pass file? If so where? I will try to keep the program open as long as I can in case your response needs it.
foxyshadis
28th May 2006, 00:33
When you save and close it, it'll ask you where you want to save the resulting .avs script, it doesn't save anything before that.
Oh, and it's not the run analysis button, sorry, it's the avisynth script creator, under the filters tab.
Cheech
28th May 2006, 03:14
http://www.nonyaz.com/temp/images/albums/random/avisynth error.jpg
I tried the d2v file and the TP stream, both give me the same error, thinking about throwing in the towel :(
Edit: I gave up trying to do anything progressive, now I'm trying to encode interlaced XviD. After the resize, the video looses allot of sharpness even when using lanczos. Why does resizing do this? This doesn't happen when I resize an image in like photoshop, whats the difference? I can't confirm that using LimitedSharpenFaster helps because I was not able to get it to work after 45 min, thus I got frustrated and gave up. Here is my script so far:
LoadPlugin("C:\Documents and Settings\Administrator\My Documents\DG MPG Decode\DGDecode.dll")
MPEG2Source("Conan 25.d2v")
crop(8,2,-0,-10)
SeparateFields()
Lanczos4Resize(1280,360)
Weave()
Edit 2: I just noticed there was an 4 in the middle of Lancroz and Resize, is this significant?
Edit 3: Tried this setup out, seems to be working better, will respond once encode finishes:
LoadPlugin("C:\Documents and Settings\Administrator\My Documents\DG MPG Decode\DGDecode.dll")
MPEG2Source("Conan 25.d2v")
SeparateFields()
LanczosResize(1280,360,8,2,-0,-10,6)
Weave()
Edit 4: I don't know.... its better, not great, maybe there is a drawback to resizing that I don't know about. Im not sure why I put the 6 there at the end, sounded like a good idea. Just so confused.. tired, sleepy. I'll hit this again tomorrow, maybe I will forget resizing and just do 1080i :P
Cheech
28th May 2006, 21:13
(I didn't see a rule against double posts, sorry if it is a rule, just let me know.)
I've been playing around a little more and found some more wrenches to throw in the gears. As I said before, I did a previous episode before by tossing out a field and just using the half vert res and resizing the horz width to match, this gave me great sharpness and although the stuff in the intro was on film, it played fine, just a little jerky where they used it, hardly noticeable.
I used the same method on a newer episode, same great shapness (but still not amazing, why can't this look amazing?!), BUT they must have send the episode another way, because during the intro for example, they use animations, and before like I said, it just jerked, now where the previous version jerked (I should say hung on a frame for longer than it should) there is a white object where the previous version hung, but the movement is still there. So I don't know what that means.
So looks like I have 4 options:
1. Encode 1080i no resize:
Pros: Sharp Sharp Sharp, no resizing, amazing quality
Cons: Billy Fucillo says "It's HUGEEE!", my pc chugs when I try and make ffdshow deinterlace it, and did I mention its huge?
2. Drop a field:
Pros: Great shapness (I think the resizing the horizontal is whats killing the sharpness, I hate resizing with a passion at this point), Acceptable finial resolution size.
Cons: Can screw up film scenes and animations in the forms of hangs or white shapes, loose some motion on the rest of the show (pure NTSC).
3. Use the "drop a field" method but somehow use both fields to interlace it back. I am thinking this doesn't make any sense, it should be just resize to that resolution but until I figure out why my resize acts as a general purpose blur tool or someone can help me use LimitedSharpenFaster I am hoping the fist way can be used somehow (AVISynth is magic right?)
Pros: Good sharpness, no worries about pull down sources, good rez
Cons: I don't know how to do it.
4. Give up
Pros: I will have free time
Cons: I will have learned nothing, wated allot of money on this digital capture card if im not going to use it for what I wanted to.
I will get a screenshots of the white shape im talking about in a few minutes, going to have some nice gifs to show the jerk.
Edit: Here you go, a 7 MB GIF: http://www.nonyaz.com/temp/images/albums/random/32.gif
Edit 2: Been thinking about option 3 some more, can anyone make this this a real script?
#Seperate Fields into A and B fields
separatefields(A,B)
#Delete every other line on field A starting with the first line
DeleteLines(A,0)
#Delete every other line on field B starting with the second line
DeleteLines(B,1)
#Weave field A and B back toghter
Weave(A,B)
#Resize and Crop to correct aspect ratio
NonBlurryResize(952,height,8,2,-0,-10)
squid_80
29th May 2006, 07:16
Hmm, just on a hunch try changing your mpeg2source line to
mpeg2source("conan 25.d2v", upconv=1)
and see if the white bits are still there.
Cheech
29th May 2006, 08:14
Without doing that I can tell you they are, after I posted, I looked at the source and that white part is part of the interlaced video. The screenshots are after field discard and xvid encode. Whats the upconv do anyway? I'ts always nice to know these things.
Guest
29th May 2006, 08:17
Whats the upconv do anyway? I'ts always nice to know these things. It's also nice to read the documentation, instead of asking other people to regurgitate it:
http://neuron2.net/dgmpgdec/DGDecodeManual.html#MPEG2Source
Cheech
29th May 2006, 08:26
It's also nice to read the documentation, instead of asking other people to regurgitate it:
http://neuron2.net/dgmpgdec/DGDecodeManual.html#MPEG2Source
You know neuron2, your right, what was I thinking. You're comments are always so wise and insightful, you're probably the coolest guy I know. From this day forward I will devote my life to fulfilling your every last request including this one in hopes that I will one day be good enough to be called your friend. :thanks:
squid_80
29th May 2006, 08:28
I don't think sarcasm is really a good idea.
No harm in trying upConv anyway, if you don't know what it does how can you be sure it won't help?
Psst, Neuron2: Documentation needs updating - upConv is still listed as a bool.
Cheech
29th May 2006, 08:30
I don't think sarcasm is really a good idea.
No no, you got me all wrong, I have great admiration for this guy, hes like a god to me. I will try that command right away and post back.
Edit: Well I'll be darned, this command is nothing short of which-craft, it worked!
So am I right in assuming that the two shows were transmitted in different colorspaces (I think thats the word for it)?
Edit 2: You know now that I think of it, its probably the same! The only difference with the first video was that I used a filter in VD (logo filter from the great Donald Graft), that means it automatically had to be converted to RGB32. In the second video I learned about fast-recompressing to preserve the YV12 colorspace, and used it.
squid_80
29th May 2006, 08:59
The problem comes from the different ways chroma is stored in interlaced yv12 vs progressive yv12, commonly known as the Chroma Upsampling Error (http://www.avisynth.org/Sampling). upConv=1 tells DGDecode to upsample to YUY2 and since DGDecode knows which frames are progressive or interlaced, it can pick the correct upsampling method (that's something else you can think Mr. Graft for coming up with).
Cheech
29th May 2006, 09:22
The problem comes from the different ways chroma is stored in interlaced yv12 vs progressive yv12, commonly known as the Chroma Upsampling Error (http://www.avisynth.org/Sampling). upConv=1 tells DGDecode to upsample to YUY2 and since DGDecode knows which frames are progressive or interlaced, it can pick the correct upsampling method (that's something else you can think Mr. Graft for coming up with).
I saw that page from reading a diffrent post, and to be honest, I can't tell a bit of diffrence between the pictures they use for examples, you think I should post my screenshots?
In that page they say:
When VDub previews your video, it will need to convert it to RGB. Since AviSynth delivers YV12, it asks the codec (for example XviD or DivX) to convert YV12 to RGB. The codec however ALWAYS upsamples progressively. Hence you will get artifacts in VDub preview on interlaced YV12 material. This is however not present in the YV12 video (or in the resulting encoding). To confirm this, let AviSynth do the conversion by adding ConvertToRGB(interlaced=true) at the end of your script.
As per what they suggested, I took out the upConv=1, and added ConvertToRGB(interlaced=true) to the end of my script, however I still get the same effects, whats that all about? Here is my script:
LoadPlugin("C:\Documents and Settings\Administrator\My Documents\DG MPG
Decode\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\NicAudio.dll")
video=MPEG2Source("Conan 25.d2v")
audio=MPASource("Conan 25 PID 044 T01 3_2ch 384Kbps 48KHz.mp3")
AudioDub(video,audio)
#SeparateFields()
#selecteven()
#Weave()
LanczosResize(width,height,8,2,-0,-10,6)
ConvertToRGB(interlaced=true)
Info()
And your right, Its just another testament to the great work Mr. Graft has contributed to the community, you can see why I admire him so.
Edit: Solved this myself, it appears the resize was progressatizign it, and screwing it up. I will try to encode the 1080i to xvid just to prove the pages's point about it coming out right in the end.
So is there any hope in working with YV12? Looks like its limited in what you can do to it.
Edit 2: Made the test video like I said, and it still is giving me the Upscale error, could it be my ffdshow trying to play it? As far as I know, the xvid codec cant decode its own interlaced video, so thats why I am using it. Have a look for yourself: http://www.nonyaz.com/temp/videos/Prove.avi (about 15MB) I can see the sun rising, and the birds chirping, that's my que to hit the sack, I will be back tomorrow, good night squid and DG, thanks for your help thus far!
squid_80
29th May 2006, 09:45
Most avisynth filters don't know about interlacing and will mix up the chroma from the different fields, just like virtualdub does. Lanczosresize is no exception. Try putting the converttorgb(interlaced=true) right after the mpeg2source line or just use upConv=2 which does more or less the same thing.
Ok, now I see your edit. Nevermind.
If you want to stick with yv12, use upConv=1 on the mpeg2source line and stick a converttoyv12() after separatefields().
Guest
29th May 2006, 13:32
upConv=1 tells DGDecode to upsample to YUY2 and since DGDecode knows which frames are progressive or interlaced, it can pick the correct upsampling method (that's something else you can think Mr. Graft for coming up with). I made the first implementation of following the pf bit, but the current implementation was contributed by tritical, as part of his revamp of upsampling.
squid_80
29th May 2006, 14:05
The whole upsampling issue is what made me make a 64-bit port of avisynth. Without it I'd still be loading .d2v files into vdub64 via dgdecode wrapped in an AVIFile handler. I was too dumb to come up with the idea of using a suffix on the filename to specify interlaced upsampling...
check
29th May 2006, 14:50
Holy... this is completely OT, but can you please use an external link to 7mb gif files? It killed my poor little connection and sent it six feet under :P
Guest
29th May 2006, 15:36
Holy... this is completely OT, but can you please use an external link to 7mb gif files? It killed my poor little connection and sent it six feet under :P Good point. I removed it. Cheech, please change it to a link.
Cheech
29th May 2006, 16:20
If you want to stick with yv12, use upConv=1 on the mpeg2source line and stick a converttoyv12() after separatefields().
What's the point, isn't that just converting the video's colorspace three times? (YV12 -> YUY2 -> And doesn't xvid use YV12 when it encodes?) My goal is to preserve it if possible, not use it "for the hell of it".
I loaded my test xvid back into VD and saw that the Upscale error was not present, so there IS a decoding issue when trying to playback yv12. I really am shocked on how hard it is to keep the YV12 colorspace, is it even worth it to try? I will try to force MPC to use the xvid codec exclusively instead of ffdshow and see what happens.
The whole upsampling issue is what made me make a 64-bit port of avisynth. Without it I'd still be loading .d2v files into vdub64 via dgdecode wrapped in an AVIFile handler. I was too dumb to come up with the idea of using a suffix on the filename to specify interlaced upsampling...
Hey, I remember you now! You abandoned my x64 AC3 problem over at PlanetAMD64 (http://www.planetamd64.com/index.php?showtopic=14791&st=0&p=171459&#entry171459), your the reason I have to use DG index to convert to wav before I can do anything :P
And I fixed the link neuron :)
Edit: Ok the XviD codec properly decodes the YV12 I encoded along with the interlacing, I'm not sure where I got the idea that it couldn't decode interlacing. However, this doesnt come at a price, the ffdshow alpha was the only codec I know that could deinterlace progressive video on playback. All the evidence is laid on the table, does the jury find just cause in giving YV12 the death penalty?
Edit2: Upon further review, the XviD codec on my pc is locking frames up for long periods of time (see sample video to try yourself). Ok, now that its decided that I'm not going to keep the YV12, lets move on to the other issues, see the 4 options on the first page.
Edit3: Now wait a minute, ffdshow's property page says that it can and is supposed to show YV12, why doesnt it do this correctly? Am I the only one having this problem?
Pookie
30th May 2006, 04:16
A lot of work just to watch Conan at half res. It's a fun show, but sheesh...
Cheech
30th May 2006, 06:57
I'ts all the more important because of the nature of the show, it only airs once, and maybe if its a good episode they will re run it months later. The faster I can learn how to archive these to XviD or some other codec, the better, I cant keep a backlog of TP streams on my HD, they add up fast.
As for this thread, I'm going to put an end to it. I have to diversify my problems into their respective forums rather than lump it all into a topic in avisynth.
squid_80
30th May 2006, 08:44
Hey, I remember you now! You abandoned my x64 AC3 problem over at PlanetAMD64 (http://www.planetamd64.com/index.php?showtopic=14791&st=0&p=171459&#entry171459), your the reason I have to use DG index to convert to wav before I can do anything :P
You never mentioned AC3. You said you had a mpeg2 stream, so I gave you an mpeg2 decoder. If it was an AC3 stream you should have said so and I would've given you an AC3 decoder.
Cheech
30th May 2006, 12:28
You never mentioned AC3. You said you had a mpeg2 stream, so I gave you an mpeg2 decoder. If it was an AC3 stream you should have said so and I would've given you an AC3 decoder.
Oh yea... Thats was when I needed it for stuff of my TiVo which I think IS mpeg2 stuff, now I need both :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.