Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > HDTV / DVB / TiVo

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th February 2005, 07:06   #61  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
Quote:
venutolo writes
As far as I can tell, CCE takes care of pulldown.
Yeah, CCE does have an option for pulldown, but I've read about issues with it enough to decide not to use it. I don't really have any examples, so take my advise for what it's worth, but PULLDOWN by HardCode does more than just set some 2:3 flags, so even if you did use CCE to set pulldown, I'd still recommend you run it through pulldown.exe for these two features:

1) Enabling Drop Frame
This has to do with the way the mpeg counts time in relation to frames. When you encode the video at 23.96 and make it play back as if it were 29.97, the mpeg's "natural seconds" appear to play longer than a "real" second. This results in the video's duration appear to be shorter than it actually is... Now, when I first read about this, I thought the flag would cause the video to actually skip playing a frame or something, but that's not the case. This guys dissertation explains it rather well: "It is not so much frames which are dropped as frame numbers which are skipped." In the end, if you do not use the Drop Frame Flag in your .m2v, you could have a real hard time setting chapters accurately or getting subtitles to sync right.

2) Setting all Frames to Progressive
Now, I don't really know how beneficial this is, but here's my line of thought... The video -is- encoded with progressive frames. The 2:3 pulldown flags makes it appear to be 29.97fps, which is typically an Interlaced video. So in truth, a 29.97fps Progressive scan video would actually contain duplicate frames. By setting this flag, you're telling the players not to deinterlace when decoding and just show the frame. Progressive scan enabled dvd players should love that. Now, I've tried using the other prog_seq switch that marks the entire stream as progressive but found playback to be...problematic. Xbox Media Center hated it anyway, so marking the frames progressive and not the stream seemed to be the way to go.

So, how do you apply pulldown? I made a .bat file (see below) and made a shortcut to it on my desktop. When CCE has finished making it's .mpv I just drag and drop it on the shortcut and this .bat makes an .m2v for me. So for example, I encode lost-s1e14.mpv and drop it on the shortcut and it spits out lost-s1e14_PULLED.m2v for me to mux with the ac3.

Code:
@echo off
set INFILE=%1
set OUTFILE=%INFILE:~0,-4%_PULLED.m2v
PULLDOWN.EXE %INFILE% %OUTFILE% -drop_frame true -prog_frames p
pause


WoofSoft built a GUI out of the source code from this command line app and called it DoPulldown v1.0.0.0, but I prefer to drag and drop my .mpv on the shortcut. Old habits die hard, but it'd be easier if DoPulldown supported Drag-n-Drop (@WoofSoft: hint hint)

Quote:
venutolo writes
As for flagging it as progressive scan, does checking the box next to "Progressive Frame" take care of it
Checking the "Progressive Frame" box tells CCE to encode the stream as progressive, and yes I suspect it does the same thing as pulldown.exe's -prog_frames p switch, but I'm just guessing on that...

Quote:
nnigam writes:
I just convert my 59.94 fps progressive to 29.97 by decimate(cycle=2), and leave the extra frame there.
But just to be clear on why using 2:3 pulldown is a good idea... Remember how Telecine works? 24fps (what tv shows are actually filmed at) gets to 30fps by using duplicates of previous frames. The Pulldown flags tells it to simply show the previous frame, rather than having an actual copy of it in the stream. This flag trick allows you to allocate the bits that would be needed to show approximately 6 frames and spread it around the other 24.

And incidentally, decimate(cycle=2) is probably a lot slower than just using SelectEven() or SelectOdd() which would yield (probably) the same result.

Quote:
nnigam writes:
Would the avisynth cmd changefps be similar to pulldown since it just slows the video down.
Absolutely not the same thing. ChangeFPS() actually changes the framerate by simply duplicating or deleting frames. Pulldown tells the software the decodes the stream to show a frame twice, with ChangeFPS, the duplicate frame would actually be there. This is also not the same thing as the ever popular Decimate() function from the Decomb plugin. Where ChangeFPS just drops or copies any frame as it needs to, Decimate actually compares frames to each other to discover which is a duplicate and drops one of those.

Quote:
nnigam writes:
How is bbMpeg
Honestly, it does a lot more than I need, and it's a little convoluted to use just for muxing, but it's done a great job so I stick with it.

You can pick it up here. You have to open avi2mpg2.exe which opens this interface for...honestly, I have no idea. But you have to click the "Load" button as if you wanted to load a project file and click Cancel (apparently there is a known bug that this fixes, *shrug*). Then you click the "Start Encoding" button, even though you are not encoding anything, and this opens the bbMPEG window. At this point you can click the "Settings" button and go to the "Program Stream Settings" tab and tick the dot for ~DVD. The defaults should be fine, then go to the "Input and Output files" tab to select the target .mpg and your source .m2v and .ac3 files. Click OK, then Start and it'll mux it up for you.

What can you do with the final .mpg? I've found InterVideo WinDVD to be a great app for playing the video, that or Xbox Media Center. You can also use the .mpg to author a DVD using TMPGEnc DVD Author.
FreQi is offline   Reply With Quote
Old 4th February 2005, 15:40   #62  |  Link
nnigam
Registered User
 
Join Date: Nov 2004
Posts: 92
Thanks FreQi. Very informatinve. My project for the weekend is set. I am going to try all of this on my videos.

As for changefps, you are right. Thats what happens when I try to write from memory. I meant assumefps. I stopped using it because it changed the video rate so that audio and video no longer were in synch. I guess that changefps was also incorrect.
__________________
Neeraj C. Nigam
nnigam@pntravels.com
nnigam is offline   Reply With Quote
Old 24th April 2005, 23:22   #63  |  Link
MarkGrigsby
Registered User
 
Join Date: Jan 2003
Posts: 28
I am using this method to convert 720p material to DVD, and am not sure why I need to use 'Telecide()' for 720p material? Surely I could just use FDecimate to get the frame rate down to 24, since there are no interlaced frames present?

Or am I missing something?!
MarkGrigsby is offline   Reply With Quote
Old 25th April 2005, 03:57   #64  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
That's right. If there are no combed frames, Telecide is not required.
Guest is offline   Reply With Quote
Old 25th April 2005, 06:01   #65  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
You're right, Telecide() is not used on 720p (it's an option for 1080i) but I use Decimate(cycle=5) because I first use SelectEven() which takes it down to a progressive 29.97fps. My scripts for 720p all look something like this:

Code:
LoadPlugin("C:\Program Files\theeo\DGMpegDec\DGDecode.dll")
LoadPlugin("C:\Program Files\theeo\AVISynth\Decomb.dll")
LoadPlugin("C:\Program Files\theeo\AVISynth\BT709ToBT601.dll")
MPEG2Source("F:\According.to.Jim.s4e23\atj-s4e23.d2v")

# correct the slight color error SDTV->HDTV introduces
BT709ToBT601()

theeoAddRange(302,9931)++theeoAddRange(18822,22801)++theeoAddRange(53890,21667)

# InverseTelecine and Decimation
SelectEven().Decimate(cycle=5)

Crop(4,4,-4,-4)     # take 4 pixels of left, top, right, bottom

LanczosResize(720,480).ConvertToYUY2().AudioDub(BlankClip())

function theeoAddRange(clip c, int s, int r) { return c.Trim(s,s+r-1) }
FreQi is offline   Reply With Quote
Old 25th April 2005, 14:57   #66  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
@FreQi,

Not all HDTV streams use Rec.709, contrary to what the readme of BT709ToBT601 claims.
Wilbert is offline   Reply With Quote
Old 26th April 2005, 01:56   #67  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
How do you determine when it needs correction? Is there some way to detect it in software, or is it just visually apparent? Perhaps there is a way to determine it logically.

For example, when something is transferred from Film to HD, it would need correction...? I believe that would be the case with just about all Drama's and Sitcoms.

When something is filmed with an HD Camera, then it would not...? The only thing I can think of here would be things like the specials you'd see on PBS, NASCAR races, the Superbowl and other live broadcast events. Incidentilly, these types of HD streams would probably not take to well to being IVTC'd either.
FreQi is offline   Reply With Quote
Old 26th April 2005, 09:34   #68  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Just open the stream in GSpot and see what coefficients are being used. If it indicates nothing then Rec.709 coefficients are being used since that's the default. See also readme of ColorMatrix.
Wilbert is offline   Reply With Quote
Old 26th April 2005, 16:13   #69  |  Link
nnigam
Registered User
 
Join Date: Nov 2004
Posts: 92
OK. I have learned a lot here. A brief delay while I had to remove a very persistent virus on my pc that just refused to go away, but now I am back in business.

I process my 720p using dgindex, convert to 23.976 using fdecimate since they happen to be 3:2 format. I convert to avi using vdubmod and everything is in perfect synch. I convert to m2v using quenc and then run dgpulldown to convert to 29.97, and covert to dvd using muxman. Again everything is in perfect synch. I then open the puldown m2v file and the ac3 audio in Mpeg2Schnitt to cut the commercials. First problem is that there is no place to put the audio delay. Even in Mpeg2Schnitt I can see audio synch errors greater than would be caused by the delay alone. I tried the original 23.976 m2v, and I still have audio errors. I then tried delaycuter utility on the audio with both the original and pulldown m2v and I still have audio synch errors. Pulling the audio into gspot, It says the audio frame rate is 31.5fps. Somehow this synchs with the 23.976 or 29.97 pulldown audio and sitll maintain perfect audio synch while cutting causes audio errors.

I read somewhere of a utility that will take the cut list from Mpeg2Schnitt and perform the same cuts in the audio seperately. I will look for that and try again.
__________________
Neeraj C. Nigam
nnigam@pntravels.com
nnigam is offline   Reply With Quote
Old 26th April 2005, 17:05   #70  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
Cut the commercials -before- you encode. If for no other reason, it's the only way to accuratly target any final file size.
FreQi is offline   Reply With Quote
Old 26th April 2005, 18:09   #71  |  Link
nnigam
Registered User
 
Join Date: Nov 2004
Posts: 92
I would love to. How to cut an HD transport stream. I process the hd stream to a d2v project. Open the d2v in an avsynth script. Cutter tools need an m2v which I get only after processing with quenc. I tried cutting in vdubmod, but it takes forever.

In your sample, I saw

theeoAddRange(302,9931)++theeoAddRange(18822,22801)++theeoAddRange(53890,21667)

How did you get these ranges? Any limit to the number of ranges I can add here? How is the range affected by the fps changes needed to convert the 3:2 720p to 23.976?

Thanks
__________________
Neeraj C. Nigam
nnigam@pntravels.com
nnigam is offline   Reply With Quote
Old 26th April 2005, 18:31   #72  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
Check out my second post on page 2 of this thread. It's explains pretty much what I still do today, except I wrote an app to automate the whole process (called theeo, which still needs a little tweaking before I publicly release it).

Keep in mind that in order to cut the AC3 with VirtualDubMod, you have to use v1.4.13. The newer 1.5x doesn't cut the ac3 stream when you demux it with trim's. Not sure why.

Also, rather than using BeSplit, I'd suggest you use DelayCut to Fix the trimmed ac3. It seems to do a better job of maintaining sync.

Quote:
Any limit to the number of ranges I can add here?
nope.

Quote:
How is the range affected by the fps changes needed to convert the 3:2 720p to 23.976?
If you do your trims -before- you IVTC, you're unaffeted. You can try any sort of IVTC method and never have to cut commercials again. Just do it in the order I have my last example in. Load the .dll's, load the .d2v, trim the commercials, then process the video.

Last edited by FreQi; 26th April 2005 at 18:34.
FreQi is offline   Reply With Quote
Old 2nd May 2005, 09:29   #73  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
Quote:
I read somewhere of a utility that will take the cut list from Mpeg2Schnitt and perform the same cuts in the audio seperately. I will look for that and try again.
Mpeg2Schnitt is designed to cut the audio as well. If the audio file has the same name as the video (except for extension) it should be loaded automatically. Doesn't it do this for you?
squid_80 is offline   Reply With Quote
Old 17th May 2005, 21:20   #74  |  Link
Bruce Willis
Registered User
 
Join Date: Mar 2004
Posts: 24
Interesting thread..

Is it true that converting the framerate from 60 to 24 fps, either by SelectEven().Decimate or by FDecimate, slows down the encoding 4 times or even more? Or am I doing something wrong?
Bruce Willis is offline   Reply With Quote
Old 17th May 2005, 21:45   #75  |  Link
nnigam
Registered User
 
Join Date: Nov 2004
Posts: 92
I never timed it. It takes a long time regardless. I am processing 1 hour hd programmming. Taking out commercials, it comes to about 45 minutes. Encoding this takes about 8 hours. Three hours for the first pass and 5 for the second. I would assume FDecimate would be slower because it checks all frames to find best frames to drop, while SelectEven.Decimats() does not have to be too intelligent, but I could be wrong. I just process overnight and so do not care how long it takes.
__________________
Neeraj C. Nigam
nnigam@pntravels.com
nnigam is offline   Reply With Quote
Old 17th May 2005, 21:49   #76  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Decimate() also compares frames.

If you want a fast but dumb decimation, use ChangeFPS(). You can compare that to FDecimate() to get an idea of the time difference. I doubt it is as bad as you suggest.

The advantage of FDecimate() is that it preferentially drops duplicates where possible.
Guest is offline   Reply With Quote
Old 19th May 2005, 21:07   #77  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
Yeah ChangeFPS would probably be faster but I really wouldn't trust it to make a good looking video (it would probably jitter pretty regularly). Decimation is the way to go, dispite the potential speed hit.

I've got a P4 2.8 and I find encoding times to be about 4x the runtime. So if you have a 30min show, it takes me about 2hrs to encode. That's a really rough estimate... I don't know the real times off hand as I also set up my encodes and go to sleep. They're all done bu the time I wake up.
FreQi is offline   Reply With Quote
Old 26th May 2005, 03:39   #78  |  Link
Leehro
Registered User
 
Join Date: May 2005
Posts: 3
learned some great stuff here, thanks for all the info. I'm still having some sync issues but I think i'm on the right track.

Most of my concern though is for converting interlaced HD content (like leno/conan/letterman and live music on pbs) down to DVD.

does anyone have a good script for those? i end up playing with the settings a lot. this was one of my scripts for an Austin City Limits performance (which was upconverted and, broadcast 1080i widescreen)

Code:
LoadPlugin("C:\progra~1\gordia~1\MPEG2Dec3.dll")
mpeg2source("P:\HDTV\pixies.d2v")
crop(16,0,-16,-8)
SeparateFields
SeparateFields
Lanczos4Resize(720,240)
SelectEvery(4,0,2)
doubleWeave
selectodd
just seems like i'm missing something and going overboard. but it worked and looked fine on TV.

I then encoded that with CCE and authored a 16x9 DVD, with original AC3 audio. Didn't have any sync issues because I didn't cut out any commercials. But I tried a lot of the info here on SNL from a couple weeks ago, and best I got was bad field ordering and a constant sync offset (improvement over a sliding one).

Last edited by Leehro; 26th May 2005 at 03:41.
Leehro is offline   Reply With Quote
Old 26th May 2005, 18:56   #79  |  Link
FreQi
Registered User
 
FreQi's Avatar
 
Join Date: Dec 2001
Posts: 234
The live programming that you're talking about is filmed natively in NTSC, which means you do not want to decimate it. If you do you'll get jitter and general baddness. I'd try something like this:

Code:
LoadPlugin("C:\progra~1\gordia~1\MPEG2Dec3.dll")
mpeg2source("P:\HDTV\pixies.d2v")
SeparateFields()
SelectEven()
Crop(16,0,-16,-8)
Lanczos4Resize(720,240)
This should give you a progressive scan 29.97fps video at 720x480, so you won't need to use pulldown.exe for 2:3 pulldown or drop-fram flags, but you'll probably still want to set the pregressive flag.

You could use Decomb.dll to run Telecide() in order to deinterlace it (do not decimate), but you'd be spending more processing time for something that's going to be less than what you get from simply SeparateFileds().SelectEven() anyway. It might look better tho. Try both, see what you prefer. LMK.

Last edited by FreQi; 26th May 2005 at 19:03.
FreQi is offline   Reply With Quote
Old 26th May 2005, 21:15   #80  |  Link
Leehro
Registered User
 
Join Date: May 2005
Posts: 3
yeah it's NTSC stuff like letterman, SNL. stuff that is natively 480i (probably slightly higher than 480 but still standard def, interlaced video)

i don't want progressive video. I want to keep it interlaced. Sometimes i want to convert to divx/xvid, and in that case yeah i want progressive.

but if it's originally standard def, interlaced video at 29.97fps, that's what I want to be able to put on a DVD.
Leehro is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.