1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

720p frame rate Virtualdub

Discussion in 'Video - Software discussion' started by maggas, Jan 16, 2009.

  1. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    The 720p HDTV I record is 50fps, and I would like to encode it at 25fps. Usually the channels I record are 1080i and I set the deinterlace filter on before encoding. Is there some sort of 'deprogressive' filter that converts the 50fps back to their original 25?

    At the moment all I can find is to decimate the frame rate by 2, but I'm not sure this is the right way to go about it...
     
  2. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    If you scan through the video one frame at a time, do you see
    2 duplicate frames, followed by another two duplicate frames, etc,
    etc? If so, decimate by 2 seems reasonable. What is the result like?
     
  3. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    I did scan through the video, and it does look like the frames come in pairs (DVB is PAL so no weird NTSC sequences if that's what you were getting at). The final result does look good I guess, just paranoid that it's not quite right perhaps :)

    How is 720p content usually reverted back to 25fps from 50fps? Not talking about VirtualDub in particular...
     
  4. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    I'm really not sure what the preferred method is, but decimate
    by 2 seems to be the logical solution.
    In general though, film-based source (24fps) is sped up to 25 then
    each frame is duplicated to give the 50. Is this what you
    have?

    Post a short clip if you like http://savefile.com/
    Myself and others will take a look.
     
  5. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
  6. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    Hello -
    took a look - it's not too bad. The scene at 25 seconds where the young
    girl turns her head looks slightly jerky. Is it that way in the source?
    But the rest of it looked pretty nice.

     
  7. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
  8. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    maggas, the source explains the problem.
    Decimate by 2 is not going to work optimally with this clip.
    It's a mix, the duplicate / unique pattern changes throughout the
    source. You need to find an avisynth expert to assist.
    The best pace I can think of is either the forum at doom9,
    and/or the "advanced video conversion" at videohelp.com
    http://forum.doom9.org/forumdisplay.php?f=33
    http://forum.videohelp.com/

     
  9. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    Ah that does suck a bit! I don't suppose there is a filter in VirtualDub that detects the pattern and halves the framerate? I have looked at the forums you recommended and have asked there too, thanks again.
     
  10. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    maggas, the 50 fps clip you provided complicates any analysis
    because some parts of it are intentionally in slow motion and
    the duplicate frame counts are out of whack.

    In any event, avisynth and perhaps something like Fdecimate
    may help. I'm not an avisynth xpert, but something simple like
    this may help:

    DirectShowSource("F:\abc.m2v",fps=50,audio=no,convertfps=true)
    FDecimate(metrics=true)
    #FDecimate(rate=25,threshold=5)

    Save this in an .avs file and open with virtualdub.
    Look at it one frame at a time. A threshold value wil show,
    and for duplicate, or barely moving frames, the value is
    usually somewhere between 1 - 4. When you've figured out the range,
    use the # to comment out the line and uncomment the 2nd
    Fdecimate, Set the threshold to just above the value you saw
    in the range above. Save the .avs. open in Virtualdubub
    and check the result.
     
    Last edited: Jan 23, 2009
  11. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    I had to add ConvertToYUY2() before the FDecimate(metrics=true) just so you know!

    I stepped through the video frame by frame (well not the entire video haha, just a few randomised 10second clips throughout the video - just guessing this is what is usually done?) and wrote down the lowest metric that corresponded to an actual different frame (3.3). I also calculated the highest metric that corresponded to no frame change (2.8).

    Then I picked a number approximately in between (3)
    FDecimate(rate=25,threshold=3)

    Then I'm guessing that frames under the metric of 3 are dropped, and those above 3 are kept, and then it adds/drops additional frames to achieve 25fps?

    Hopefully I'm on the right track!

    EDIT Here is my result: http://www.savefile.com/files/1979408

     
    Last edited: Jan 24, 2009
  12. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    Haven't had time to look at your latest yet, but in regards to the
    earlier 50 fps sample, I also tried convertfps=false
    on the Directshowsource and the result was that a particular
    section decimated better.
    It's supposed to be a factor if the source
    has variable frame rate - anyway, if a bit gives you trouble, try
    that. Your understanding and usage of the "metrics" is the same
    as mine.
    Didn't you get any response from the the other forums? That's where
    the Avisynth heavyweights are.
     
  13. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    Haven't got a reply from other forums yet, just waiting at the moment. Could you explain what difference using convertfps=false as opposed to true?
    I made the following .avs file:

    DirectShowSource("E:\abc.mpg",fps=50,audio=no,convertfps=true)
    ConvertToYUY2()
    FDecimate(rate=25,threshold=2.9)
    BicubicResize(736,414)
    Crop(8,8,-8,-6)

    and then I opened the .avs file with Virtualdub and compressed to H264
     
    Last edited: Jan 24, 2009
  14. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    For some reason I'm unable to open your new-test-abc.avi
    in virtualdub, so haven't looked frame by frame. Looks
    good in WMP though.
    Convertfps=true, apparently becomes a factor if the source has
    variable frame rate, and this setting adds frames to
    make it seem like Constant frame rate.
    Here's the official lingo:
    http://avisynth.org/mediawiki/DirectShowSource

    What are you using in virtualdub to encode H264? FFDSHOW?

    Edit - as soon as I used directhshowsource/avisynth to access your
    avi file I could review it in Virtualdub. It looks good.
     
    Last edited: Jan 24, 2009
  15. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
  16. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
  17. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    Thanks for that! Also earlier you said
    How did you know this?
     
    Last edited: Jan 26, 2009
  18. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    You know what that was? It was the slow motion scene -
    which necessarily had more duplicate frames.

    I think Fdecimate handled it OK?
     
  19. maggas

    maggas Member

    Joined:
    Jan 3, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    11
    To be honest I'm not sure of anything any more, some content seems to have more than 25fps. If I make the same file at the original 50fps and then the decimated 25fps (obviously having the effect of about half the file size), the decimated one seems jittery
     
  20. davexnet

    davexnet Active member

    Joined:
    Jul 7, 2003
    Messages:
    1,856
    Likes Received:
    0
    Trophy Points:
    66
    Doesn't a certain flavor of PAL 720p actually have 50 unique progressive
    frames p/s ?
    If you decimate it, you're actually throwing away real
    (not duplicate ) frames - but what else can you do? This shouldn't
    necessarily produce a jerky output - although it wont be as fluid as
    the original.

    Try and narrow down what the source that's giving you problems actually
    is by viewing frame by frame - just enough that you recognize the frame
    pattern.
    http://www.mediacollege.com/video/format/hdtv/720p.html
    This thread may be of interest:
    http://forum.videohelp.com/topic333774.html
     
    Last edited: Jan 29, 2009

Share This Page