VideoHelp Forum




+ Reply to Thread
Results 1 to 15 of 15
  1. Is it easy to convert from TFF to BFF with AviSynth? Is the avs script below a proper way to convert from tff to bff?
    Code:
    LoadPlugin("drive:\path\to\DGDecode.dll")
    MPEG2Source("drive:\path\to\dgindex project.d2v")
    AssumeTFF
    SeparateFields()
    Trim(1, 1000) # from a total of 1000 frames
    Weave()
    AssumeBFF
    Or there is a better way to convert from tff to bff than the method in the above avs script?
    Last edited by codemaster; 23rd Sep 2013 at 22:47.
    Quote Quote  
  2. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    No. Your sample is not correct. It doesn't change the physical relationship of interlaced fields, it changes only the way an editor or player reads the field order.

    Why ?
    Last edited by sanlyn; 21st Mar 2014 at 10:38.
    Quote Quote  
  3. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Gonna have to disagree. The posted script implements the SeparateFields().Trim(1,0).Weave() method which does alter the image and not just the metadata. Note, codemaster, that "0" at the end of the Trim command lets you select the last frame of the video without cutting anything.

    Are you doing this to align out-of-phase 25i material?
    Quote Quote  
  4. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I disagree again. If the original field order was really BFF, the results of the routine are an incorrect alteration. The original file doesn't change unless it is overwritten with the new data -- and it's rather difficult with many operating systems to read and write to the same file at the same time. The O.P. didn't say whther a desired correction was being made, therefore my post ended with: "Why?".
    Last edited by sanlyn; 21st Mar 2014 at 10:38.
    Quote Quote  
  5. That script will convert a TFF video to BFF. Another method is to shift the frame up (or down) by one scan line:

    Code:
    # YUY2 or RGB video
    Crop(0,1,-0,-0) # remove top scan line
    AddBorders(0,0,0,1) # add one scan line to the bottom
    But that doesn't work with YUV 4:2:0 sources, they have to be converted to YUV 4:2:2 or 4:4:4 (or RGB 4:4:4) first, incurring some blurring of the colors:

    Code:
    # TFF (or BFF) interlaced YV12 video
    ConvertToYUY2(interlaced=true)
    Crop(0,1,-0,-0) # remove top scan line
    AddBorders(0,0,0,1) # add one scan line to the bottom
    # TFF converted to BFF (or BFF converted to TFF)
    ConvertToYV12(interlaced=true)
    Quote Quote  
  6. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    That's what I was trying to get at. Thanks for the code. I looked everywhere.
    Last edited by sanlyn; 21st Mar 2014 at 10:41.
    Quote Quote  
  7. Originally Posted by sanlyn View Post
    Why ?
    Because I'm trying to edit a DVD in a NLE such as Premiere or Vegas, and the most popular solution seems to be to transcode to DV, and since standard DV is BFF, I wanted to know how to properly convert from tff to bff, in avisynth, so that I can transcode to DV bff with ffmpeg, using the avs script as input.

    I could leave it TFF and transcode to lossless Lagarith, but that means I'll have to use this:
    Code:
    Levels(0, 1, 255, 16, 235, coring=false)
    which reduces the contrast considerably.

    I could leave it TFF and not transcode it, but with mpeg 2 clips in Vegas Pro 8, scrubbing is very slow, ram usage is so high that there is not enough ram left for rendering, project opens too slow. And Premiere Pro CS3 accepts the mpeg 2 files, scrubbing is fast, but project opens too slow, some frames have weird green and red artifacts, and Premiere never stops conforming the mpeg files.

    Therefore, I arrived at the following conclusion:
    - for editing DVD in a NLE on Windows, DV is the best codec to transcode to;
    - for editing AVCHD in a NLE on Windows, DNxHD is the best codec to transcode to;
    Last edited by codemaster; 24th Sep 2013 at 14:54.
    Quote Quote  
  8. Originally Posted by codemaster View Post
    I could leave it TFF and transcode to lossless Lagarith, but that means I'll have to use this:
    Code:
    Levels(0, 1, 255, 16, 235, coring=false)
    Why would you have to do that? You should be able to leave the levels just as they are.
    Quote Quote  
  9. If I leave the levels just as they are, some detail in the high tones (or superwhites) will be lost. If I transcode to DV, I can recover detail in premiere, by using the fast color corrector to lower the high tones until they reach 100% or 1.0v on the yc waveform. There is something in those superwhites that can be recovered. If I add
    Code:
    Levels(0, 1, 255, 16, 235, coring=false)
    before compressing to lagarith, detail in the superwhites is recovered, but contrast is lowered too much. If I don't add
    Code:
    Levels(0, 1, 255, 16, 235, coring=false)
    in the avs script before compressing to lagarith, contrast is not lowered, but detail in the superwhites is deleted by premiere, and can't be recovered.
    Last edited by codemaster; 24th Sep 2013 at 15:18.
    Quote Quote  
  10. Originally Posted by codemaster View Post
    If I leave them just as they are, some detail in the high tones (or superwhites) will be lost. If I transcode to DV, I can recover detail in premiere, by using the fast color corrector to lower the high tones until they reach 100% or 1.0v on the yc waveform. There is something in those superwhites that can be recovered. If I add
    Code:
    Levels(0, 1, 255, 16, 235, coring=false)
    before compressing to lagarith, detail in the superwhites is recovered, but contrast is lowered too much. If I don't add that line in the avs script before compressing to lagarith, contrast is not lowered, but detail in the superwhites is deleted by premiere, and can't be recovered.
    That must be a Premiere issue then. Why don't you leave the black level where it is and just reduce the brights? Something like ColorYUV(gain_y=-20) or Levels(0,1,255,0,235, coring=false).
    Quote Quote  
  11. I tried
    Code:
    Levels(0, 1, 255, 0, 235, coring=false)
    and contrast is normal now, but there are some vertical lines in the waveform.

    This is without the levels correction:

    Click image for larger version

Name:	before.png
Views:	390
Size:	131.4 KB
ID:	20162

    And this is with levels correction:

    Click image for larger version

Name:	after.png
Views:	384
Size:	119.2 KB
ID:	20161

    Those vertical white lines, ar they indicating a problem ?
    Quote Quote  
  12. You're reducing 256 integer values to 236 integer values. There has to be some duplicates in the result. That's what those lines are. You can use SmoothLevels() instead of Levels() to add a little dithering to the results. SmoothLevels() is part of the SmoothAdjust package.
    Last edited by jagabo; 24th Sep 2013 at 16:30.
    Quote Quote  
  13. levels has a dither=true parameter now in avisynth 2.6.x , works similar to smoothlevels

    Levels(0, 1, 255, 0, 235, coring=false, dither=true)
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    levels has a dither=true parameter now in avisynth 2.6.x
    Thanks for the update.
    Quote Quote  
  15. Originally Posted by poisondeathray View Post
    levels has a dither=true parameter now in avisynth 2.6.x ...
    Yeah, thanks from me too. I didn't know that and I have a project at the moment where I can use that new feature.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!