Log in

View Full Version : IVTC/Decimating/Deduping hybrid NTSC 29.97


Mizuho
5th October 2006, 16:45
Sorry for my presence in this section of the forum, but I'm not experienced in many AviSynth usage or frameserving as such, yet at the same time not entirely a novice in encoding.

What I have here is a hybrid NTSC 29.976 FPS video. It's a live video with some CGI. Most of the video is interlaced, and I've tried decimating using the regular decomb and it was not pretty.
I read some tutorials, and tried using DeDup, of which I obtained some pleasing results, with a low filesize but low bitrates (when I set the bitrate quite high). However after encoding with DeDup, the video framerate read at 29.97 FPS when I opened in MPC properties, but while looking at the real-time statistics, I see the framerate running at 33-34 FPS, with ocassional framerate drops.

What's also a problem are the subtitles. I've got a subtitles file ready to be embedded, but the subtitles correspond to the original framerate 29.97 FPS at 9419 frames. When I opened the DeDup typed up AVS script, the number of frames was roughly 11500 frames, and when previewing in MeGUI or AVSEdit, the subtitles were obviously out of place.

I've heard that it would be good to TDecimate and then DeDup afterwards, but I don't know how to go about that.
Do I run the 1st and 2nd passes for TDecimate/TDeint, and making an encoded video file, and use the timecode from the 2nd pass in TDecimate as input for DeDup?

So... run 1st and 2nd pass for TDecimate/TDeint, get the "tfm.txt", "tdec.txt", and "timecodes.txt" (from 2nd pass) and then run 1st pass for DeDup without any input from the TDecimate, and run 2nd pass of DeDup with the "timecodes.txt" as input (timesin) from the TDecimate 2nd pass?

Secondly, how do I go about encoding the subtitles then? My subtitles are in Advanced SubStation Alpha (ASS) format, and they were created from the original framerate 29.97, 9419 frames.

I am lost... can someone kindly offer any assistance?

foxyshadis
5th October 2006, 18:02
If you have subtitles you want to burn in, you have to apply them before you do any hybrid processing, since avisynth has no notion of vfr video. Note that dedup has nothing to do with hybrid animation, it doesn't change the framerate of hybrid sections at all, but it can still be useful for other reasons. For softsubs, ignore what you see in the resulting avi, mux to mkv with the timecodes, and then compare - everything should be correct.

If it's a 24/30 deinterlaced capture, it isn't hard at all, just run TDecimate as you mentioned. If it's 30/120, it's a lot more difficult. If it's all 120, that's easy too.

Lastly, if you can't meet your bitrate, you can't just try to add more. It's an effect called saturation, which means that with your settings you cannot go higher. What you have to do is use a different custom matrix, which will give you more quality as well as that extra size you want.

Mizuho
5th October 2006, 19:51
How am I supposed to apply my hardsubs onto the video before encoding? I'm a novice yes. I apologise for that...
The source I am encoding from is a DVD, VOB file, using DGMPGDec (.d2v), and my subtitles contain karaoke tags, so I'm not muxing them in the the Matroska container.

Since being a novice to Avisynth... do I somehow put the TextSub command before any deinterlacing and decimation?
But aren't the subtitles supposed to be applied just after cropping and before resizing?

Everytime I use TDecimate or DeDup etc., I see that the Avisynth script preview gives me lots of frames (like 11600 or double 18838) than my original 9419.
How am I supposed to encode my subtitles before any decimation?
Encode once with subtitles and without any IVTC/dedup (giving me a lossy file) and encode again with IVTC/dedup using that lossy file?
:confused:

[EDIT]
Huh, silly me. I just needed to put the TextSub line before the decimation, yes. Dumb, I was.

When I ran the first pass of TDecimation, and got the 'tdec' and 'tfm', I put the 2nd pass script into MeGUI, and I got 9052 frames. (original no. frames = 9419) :confused:
Is this normal? Would the resulting video be in 23.976FPS or what?
Because during many trials of encoding, I once used MeGUI automated Avisynth script creator and it used TIVTC+TDeint+EEDI2, all of that. Ran automated 2-pass and it gave me a 29.976 FPS video file (5 mins 14 secs), 45.1MB, but the deinterlacing was total abismal.

Would this 2nd pass TDecimation give me a lower filesize (i.e. less than 35MB) under the same bitrate?

I hope this all works out.

foxyshadis
5th October 2006, 22:26
Same bitrate = same file size. But encoding less means higher quality.

The latest versions of TDecimate should set the framerate to the average framerate, when using mode 5. It won't be 29.97 or 23.976, it'll be somewhere between them, because some sections are one and some are the other. You have to mux it into mkv or mp4 with the timecodes after, or 120fps avi, because the avisynth output will be the wrong framerate no matter what it is.

Mizuho
6th October 2006, 00:59
Ah yes. My 2nd pass for the tdecimation has just completed and I got my video. It was 45MB, same filesize just as you said.
I muxed the timecodes, and the resulting framerate was around 28FPS. However, I more often than not get lags and drops in frames, it's annoying.
Oh yes, I didn't mention that I am encoding with X264, and people may suggest that it's because of CPU usage that makes the video lag, but that's not the case, and I get ocassional frame drops.

I'll run my 2nd pass of DeDup when I wake up tomorrow. The encoding is painfully slow for me, since I've a Sony VAIO running with a Celeron 2.8Ghz (yes, crap I know), it takes over 2 hours to encode 5 minutes of video (@1.6-1.8 FPS).

[EDIT]
Damn, before I decided to retire for the night, I tried to open the 2nd pass of DeDup in MeGUI and I got the following dialog:
AviSynth script error:
DeDup: timeinfile doesn't contain enough timestamps

I put timesin="timecodes.txt", the timecode file I got from my 2nd pass of tdecimate, and that supposedly should work (should it not?).
Everything looks bleak now.
Q: If I were to just DeDup (without decimating) the video coupled with TDeint, would I get a lower filesize at the same bitrate?
Because I once tried just DeDup before, *BUT!* when I put the bitrate to 1200kb/s in MeGUI X264 config, the resulting 2nd pass of DeDup gave me a small file of 25MB (5 mins 14 secs). Then after muxing with the timecodes file, I got a framerate of around 33FPS, but the bitrate was poor, at approx, 800kb/s, when I asked for 1200kb/s. :(

[EDIT #2]
Okay, it seems that the frame lags and drops were due to CPU intensity, my MPC using CoreAVC is peaking at 100%, and averaging at 85%! This is not usual for me, as it usually averages at 60%. So I'd like to ask, does the MKV file which has muxed timecodes controlling the video framerate make it more heavy on the CPU processing than regular CFR, MKV contained videos?