Log in

View Full Version : Converting a 120 fps AVI in TMPGEnc


Sakuya
9th January 2006, 04:51
I want to convert an AVI with 120 fps to DVD MPEG-2 using TMPGEnc. What should I be setting for the Frame Rate and Encode Mode? I usually use 23.976 fps AVI files and then set the Encode Mode to 3:2 pulldown when playback. Thanks for any help.

Revgen
9th January 2006, 07:58
DVD's can only support 29.97p, 29.97i (AKA 59.94i), and 23.976p with a pulldown flag. It may also support 23.976p without a pulldown flag, but I'm not exactly sure.

Is the avi file a film or a video (sports, newscast), or a combination of both?

Sakuya
9th January 2006, 08:31
It's a film, more like a TV show. Does it really matter? :confused:

Revgen
9th January 2006, 09:37
Often 120fps (or 119.88fps) avi files are made so that NTSC hybrid movies or videos can be deinterlaced and stored since .avi doesn't support VFR.

Lets say a WWII TV documentary has interviews with soldiers shot in 29.97i video and stock footage of the war shot in film. You could contain both IVTC'd 23.976p film footage and the 29.97p or 59.94p deinterlaced video footage at 119.88 since 119.88 is an even multiple of 23.976(multiple of 5), 29.97(multiple of 4), and 59.94 (multiple of 2).

If your video is a hybrid than you might run into problems trying to convert it to DVD since the DVD spec doesn't support VFR or 120FPS.

Sakuya
9th January 2006, 20:36
Is it wise to decimate the AVI to 23.976 fps? It's what I do with VFR MKV files. Here's the code I normally use to decimation.


DirectshowSource("file.avi",fps=119.89,convertfps=true)
FDecimate(23.976)

Mug Funky
11th January 2006, 02:53
probably the nicest option (especially with TMPG which allows you to do this) is to re-telecine it in avisynth and encode with "inverse 3:2 pulldown" mode, which auto-detects film sections and encodes everything else as interlace.

here's how to do it:

avisource("120fps.avi")
changefps(60000,1001) # the nice way to go to 59.94
converttorgb32() # stupidly, TMPG likes RGB
lanczosresize(720,480)
assumetff().separatefields().selectevery(4,0,3).weave()
converttorgb24() # more stupidly, TMPG likes RGB 24, but RGB32 is faster for processing

Sakuya
11th January 2006, 03:38
Thanks. So what's the difference with the code I had above? :confused: And if I use your code, should I bet setting it 23.976 in TMPGEnc?

Revgen
11th January 2006, 17:10
I believe that it would be a 29.97i TFF video. Which is compatible with DVD.

Make sure to check "Interlaced" and "Top Field First" when you encode in TMPGEnc.

Kika
11th January 2006, 17:37
I believe that it would be a 29.97i TFF video. Which is compatible with DVD.

Make sure to check "Interlaced" and "Top Field First" when you encode in TMPGEnc.

Make sure not to do this... ;)

TFF is OK, but set "Encode mode" to inverse 3:2 pulldown

Revgen
11th January 2006, 19:05
The script Mug Funky gave him creates a 29.97i TFF video. If Sakuya wants a 23.976 video it would be better to use TIVTC or Decomb and decimate after Mug Funky's script in avisynth rather than TMPGEnc.

For Example using:

avisource("120fps.avi")
changefps(60000,1001)
lanczosresize(720,480)
assumetff().separatefields().selectevery(4,0,3).weave()
TFM(mode=1,order=1,PP=6)
TDecimate()
converttorgb24()

Would be better served if trying to do 23.976 in TMPGEnc. All Sakuya would need to do is make sure the pulldown flag is checked.

Sakuya
12th January 2006, 03:46
For Example using:

avisource("120fps.avi")
changefps(60000,1001)
lanczosresize(720,480)
assumetff().separatefields().selectevery(4,0,3).weave()
TFM(mode=1,order=1,PP=6)
TDecimate()
converttorgb24()

Would be better served if trying to do 23.976 in TMPGEnc. All Sakuya would need to do is make sure the pulldown flag is checked.

So if I use that, I just set the Frame rate in TMPGEnc to 23.976 and then the 3:2 pulldown for Encode mode? And when I try to activate that code in TMPGEnc, it says there's no function TFM.

Revgen
12th January 2006, 08:07
Okay I just reinstalled my TMPGEnc software and there is no Pulldown flag option. I must have been thinking about something else. Sorry about that. Just use the script that Mug Funky posted and choose NTSC film when you do your IVTC in TMPGEnc.

Kika
12th January 2006, 10:34
Pulldown flag = 3:2 Pulldown when playback.
And please read mug funkys posting again: The inverse 3:2 pulldown option is the correct setting, if the original source is hybrid ntsc.

Sakuya
13th January 2006, 06:19
Pulldown flag = 3:2 Pulldown when playback.
And please read mug funkys posting again: The inverse 3:2 pulldown option is the correct setting, if the original source if hybrid ntsc.

Uh, what's a hybrid NTSC? Here's what I set in TMPGEnc. Frame rate is 29.97. Encode mode is Inverse 3:2 Pulldown. Aspect ratio is 16:9 (NTSC) because it's widescreen. When I preview it, I see that it's interlaced. Is that normal? :(

Mug Funky
13th January 2006, 07:37
it's normal to appear interlaced on playback.

the inverse 3:2 option in TMPGenc is basically a primitive form of variable frame rate - it detects the film parts and saves 24 frames plus pulldown flags (at a huge space saving), and when it detects that it's not safe to encode as film, then it just encodes 30 frames interlaced. this is perfectly legal for MPEG-2, and on a TV will look just fine.

on a decent progressive DVD player, it will automatically output progressive frames for the film bits.

so yeah... just use the script i posted with the setting i posted and you'll not lose any frames from the 120fps file.

Sakuya
14th January 2006, 04:23
Thanks, if I didn't process the audio while converting in TMPGEnc, will that make it go out of sync? By the way, the M2V file is looking good. :D

Mug Funky
15th January 2006, 12:30
sync should be fine. this method doesn't change the duration of the video, just the frame rate, so at the end audio should be in sync. of course, there could always be unforseen problems, but i doubt it.

Sakuya
30th April 2006, 04:09
By the way, why are there 2 "converttoRGB24" and 32 in the same code? Should I use either or? And just making sure, I set it to 23.976 fps with inverse 3:2 pulldown in TMPGEnc?

Mug Funky
4th May 2006, 09:29
oh that? i should have explained better but didn't consider it important.

TMPGenc likes to receive RGB24 (that's 8 bits for r, g, and b channels). avisynth works faster in RGB32 (that's 8 bits r, g, b and an extra 8 bit channel as padding to make everything data aligned to 32 bits, and CPU optimisations to be used more effectively).

so i've got it processing the RGB32 for (theoretically, i never bothered to speed-test) greater speed, and the "converttorgb24()" at the end just ditches the extra 8 bits per pixel before feeding TMPGenc. the actual picture will not be changed, because your input didn't use that extra 8 bit channel.

Sakuya
25th September 2006, 01:29
Oh yeah, in case I want to overlay subtitles for a certain scene but at the same time, using the AVS script by Mug Funky:


AVISource("file.avi",false)
TextSub("sub.ssa")
changefps(60000,1001)
converttorgb32()
lanczosresize(720,480)
assumetff().separatefields().selectevery(4,0,3).weave()
converttorgb24()

Would it be plausible to put that line of subbing code there where it is? Would the changefps mess up the timing?