Log in

View Full Version : Question about Trim() and joining MPEG files


Chainmax
15th September 2006, 04:41
I am currently trying to restore a horrible VHS-to-DVD transfer of a ~100min movie. Unfortunately, I don't have enough HDD space for a lossless intermediary file, and my computer is too slow to directly feed the Avisynth script to CCE. Therefore, I'll have to encode the movie in segments. Here's what I intend to do:


Extract the audio from the whole movie and process it.
Put Trim(0,n) at the end of the script, make an intermediary file out of that and then encode it in CCE.
Change the Trim line to Trim(n+1,0) and do the same as in the previous step.
Join the two encodes.
Feed the joined encode and the processed audio to DVDLab and author the DVD.


What I'd like to know is if this will result in perfect A/V synch, as I'm not exactly sure how Trim works (namely, if the range is inclusive or exclusive) and if by joining the two halves no extra frame is created. Another thing I'd like to know is which program would you recommend me for joining the two halves. Any help will be greatly appreciated.

manono
15th September 2006, 13:57
Hi-

What I'd like to know is if this will result in perfect A/V synch

Yes, the frame count and film length will remain the same doing it the way you are, so the audio will stay in synch.

Another thing I'd like to know is which program would you recommend me for joining the two halves.

I join the 2 halves during authoring using Muxman. I don't know if or how DVDLab handles it. Try and make the split during some black frames (like a fade out/in). I have had a couple of frames of corruption before, at the join. Probably due to me keeping open GOPs. I'm sure someone else can advise on how to join before authoring, if you have to do it that way.

Chainmax
15th September 2006, 15:52
I see, thanks for the answer :). So the Trim choices are correct (i.é: the ranges are inclusive) then? By the way, just how much quality loss can one expect if closing all GOPs?

manono
15th September 2006, 16:42
Yes, the trims are correct.

Quality loss is there, but not substantial, and probably not even noticeable. But I'm no expert on that. I always use open GOPs, do a lot of joining and make sure to trim in the middle of some black frames. One time I checked the box for the first half to end on an I-Frame where there weren't any black frames to trim from, and that seemed to work, so maybe Open GOP is OK, and all that has to be done is to end on an I-Frame. I don't know, but I bet there are people around here that do.

Wilbert
15th September 2006, 21:44
as I'm not exactly sure how Trim works (namely, if the range is inclusive or exclusive)
http://www.avisynth.org/mediawiki/wiki/Trim

Is the documentation not clear enough?

Chainmax
15th September 2006, 22:46
I can access that in the Start menu. And no, it's not clear enough for me because it doesn't clearly say wether the interval is [First Frame,Last Frame] or (First Frame,Last Frame).

foxyshadis
16th September 2006, 00:26
Trim is [x,y], however Trim2 and Trim3 from stickboy are [x,y), beware of hasty conversions.

Chainmax
16th September 2006, 00:34
Thanks, manono and foxyshadis :).