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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > DV
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 14th May 2003, 14:47   #1  |  Link
Logiqx
Registered User
 
Join Date: Apr 2003
Posts: 19
A third option for encoding DV in CCE (re: field orders)

I often see threads relating to peoples trouble encoding DV material in CCE. So far I have seen two options suggested to deal with field order (of course, we all know that DV is bottom field first):

1) Use the 'top field first' flag in CCE to move the video up one line and in effect change the footage from bff to tff.

2) Encode in CCE then use pulldown, restream or whatever your preferred tool is for switching the tff/bff flags in the mpeg stream.

I've been using a third option on my footage and find the results very pleasing so I thought that it could be worth sharing. Using AviSynth (v2.51) I use a simple script to change the DV material from bff to tff. This means that I can encode as usual and should anyone need to work with my footage later (e.g. rip from my DVD and re-encode for some reason) then the footage is tff and should not cause them any problems.

The principal is simple:

1) Split the frames into separate fields
2) Add a blank field at the start and end of the footage.
3) Weave the fields back together and hey presto, it has changed to tff.


Here's an example of the kind of script that I use:

# Load the DV footage as individual fields, bottom field first is automatic.
# Note: Fix the chroma upsampling of the Canopus DV codec.

dv=AVISource("vhs.avi").FixBrokenChromaUpsampling.ConvertToYV12

fields=dv.SeparateFields

# Add a blank field at the start and end of the original footage.

BlankClip(fields, 1) + fields + BlankClip(fields, 1)

# Weave the fields back together, the result being top field first.

AssumeFieldBased.AssumeTFF.Weave

# Trim the footage to the desired length.

Trim(0, 106018)

# Use the Convolution3D plugin to smooth out VHS capture nasties!

Convolution3D(preset="vhsBQ")

# Switch back to YUY2 colorspace for MPEG-2 encoding.

YV12toYUY2


Maybe this trick will be of use (or just of interest) to you. It's just a little something that I came up with one day and been using ever since.


Logiqx
Logiqx is offline   Reply With Quote
Old 14th May 2003, 15:06   #2  |  Link
RB
Retired
 
Join Date: Nov 2002
Posts: 1,349
To convert bff to tff in AVISynth, you can also simply do
Code:
DoubleWeave().SelectOdd()
RB is offline   Reply With Quote
Old 14th May 2003, 15:44   #3  |  Link
Logiqx
Registered User
 
Join Date: Apr 2003
Posts: 19
Thanks RB,

That will remove most of the clutter from my DV related scripts.

I should have spotted the DoubleWeave opportunity myself.

Logiqx
Logiqx is offline   Reply With Quote
Old 14th May 2003, 20:05   #4  |  Link
Swan
It's more fun to compute
 
Swan's Avatar
 
Join Date: Apr 2002
Location: Scandinavia
Posts: 536
Logiqx, this sounds interesting.
But.. Since you add one black frame at the start of the video, doesn't the audio need to be moved forward 1 frame as well?
That's 1/25 second in PAL video and 1/29.97 sec for NTSC.
Maybe I'm totally off here, but I just want to check.
Swan is offline   Reply With Quote
Old 14th May 2003, 22:03   #5  |  Link
Logiqx
Registered User
 
Join Date: Apr 2003
Posts: 19
The extra fields also insert the correct amount of silence too. I checked this by inserting 1001 blank fields as a test and getting ~20 seconds of black screen silence at the start of my PAL clip. I guess it's quite easy for VirtualDub to deal with this in PAL (since 48,000Hz audio can be divided exactly by 50) but it may lose a tiny bit of synchronisation in NTSC (since 48,000 / 59.97 doesn't work out exactly). I'm yet to try the DoubleWeave idea but I see no reason why it won't be just as good my longer method (except for the loss of one field at each end of the clip but I'm not that fussy, lol).

Logiqx
Logiqx is offline   Reply With Quote
Old 17th May 2003, 02:47   #6  |  Link
troy
Registered User
 
Join Date: Apr 2003
Posts: 84
FixBrokenChromaUpsampling.ConvertToYV12

can you explain what this line is for. Do I need this when encoding my minidv material??????
FixBrokenChromaUpsampling.ConvertToYV12
troy is offline   Reply With Quote
Old 17th May 2003, 09:57   #7  |  Link
Logiqx
Registered User
 
Join Date: Apr 2003
Posts: 19
The FixBrokenChromaUpsampling is only required if you use the Canopus codec (read the sticky thread at the top of this forum for further information). It definitely is needed for the Canopus codec... it is easy to see why when examining interlaced material in particular.

The ConvertToYV12 is because I am using Avisynth 2.5x and in theory, subsequent filters should be faster in that colorspace. The version of Convolution3D for AviSynth 2.5x may only work in that colorspace too, I forget. Note how I have to switch back to YUY2 at the end of the script anyway.
Logiqx is offline   Reply With Quote
Old 17th May 2003, 10:21   #8  |  Link
bb
Moderator
 
bb's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 2,665
Quote:
Originally posted by Logiqx
The version of Convolution3D for AviSynth 2.5x may only work in that colorspace too, I forget.
The YUV2 version of Convolution3D is now available for AviSynth 2.5x, too. See http://www.avisynth.org/~warpenterprises/

bb
bb is offline   Reply With Quote
Old 30th May 2003, 22:24   #9  |  Link
midiguy
Registered User
 
Join Date: Feb 2002
Location: Toronto, Canada
Posts: 407
what if you just use the m$ dv codec? do you still need to use the FixBrokenChromaUpsampling line?

Last edited by midiguy; 31st May 2003 at 04:52.
midiguy is offline   Reply With Quote
Old 31st May 2003, 16:47   #10  |  Link
Logiqx
Registered User
 
Join Date: Apr 2003
Posts: 19
Not to my knowledge but I have not used the Microsoft codec. I opted for the Canopus codec after reading the sticky thread in this forum and examining the example images:

http://forum.doom9.org/showthread.php?s=&threadid=33526

Logiqx
Logiqx is offline   Reply With Quote
Old 2nd June 2003, 15:53   #11  |  Link
Ookami
Xe-Rotaredom
 
Ookami's Avatar
 
Join Date: Oct 2001
Location: Croatia
Posts: 1,029
Quote:
Originally posted by RB
To convert bff to tff in AVISynth, you can also simply do
Code:
DoubleWeave().SelectOdd()
http://forum.doom9.org/showthread.php?s=&threadid=46765
__________________
"Only those who attempt the absurd achieve the impossible."
Ookami is offline   Reply With Quote
Reply


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 19:01.


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