VideoHelp Forum
+ Reply to Thread
Results 1 to 29 of 29
Thread
  1. When encoding in Virtualdub, do you ever have to worry about the frame rate of the source file or does Virtualdub always guess the right frame rate?
    Quote Quote  
  2. Usually, your source file contains header information about the frame rate.

    Cheers
    Quote Quote  
  3. WMV-files do not. I've checked with MediaInfo. When disguising it as an .avi using a fake .avs script, Virtualdub automatically encodes these specific WMV-files I want to encode as 25 fps files.

    Also, I've never specified the FPS for the files I encode in Virtualdub. I just want to know if Virtualdub always automatically set the correct frame rate for me.
    Quote Quote  
  4. It's not so likely that your files really don't have FPS information, how else should a player know how to handle them?

    If this avisynth script passes the information in the right way I can't confirm (it should), but if in doubt you could also use a Virtualdub version that directly reads WMV:
    https://www.videohelp.com/tools/Virtualdub_1.4c-ASF

    Cheers
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by FallenAngelII
    WMV-files do not. I've checked with MediaInfo. When disguising it as an .avi using a fake .avs script, Virtualdub automatically encodes these specific WMV-files I want to encode as 25 fps files.

    Also, I've never specified the FPS for the files I encode in Virtualdub. I just want to know if Virtualdub always automatically set the correct frame rate for me.
    Then something's wrong with MediaInfo or your AVS scripts, etc.

    WMV does specify FPS. Get a copy of "Windows Media ASF View 9 series", a utility that shows the guts and "chunks" of a WMV, just like a RIFF viewer does with AVI.

    Scott
    Quote Quote  
  6. Could people just answer the question I posed: Does Virtualdub always automatically get the FPS rate right?
    Quote Quote  
  7. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    codecpage kind of answered you.

    Virtualdub takes its cue from the headers of the AVI. So it's dependent upon the "truth" of what's listed in the headers. It can't guess beyond that.

    Now, there are a couple of places in the headers where, if you derive from one place, it might not match what's listed in another. With this possible conflict, I don't know which one Virtualdub chooses as its default. However, there are ways to get it to "assume" it's a particular setting.

    Short answer: probably

    What are you trying to do? Or are you having problems with a file?

    Scott
    Quote Quote  
  8. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    Virtualdub states that it does not support WMV (even if you can get a WMV file to open with an avs script) and Virtualdub-MPEG2, although it supports WMV, warns that the audio and video may not be in sync if the files are VFR which a lot of WMV files are.

    Your best bet for WMV is TMPGEnc.

    Also, I've never specified the FPS for the files I encode in Virtualdub. I just want to know if Virtualdub always automatically set the correct frame rate for me.
    I guess you answered your own question if Virtualdub always gets it right.

    To learn more about Virtualdub, visit the Virtualdub forum where you can get answers directly from the creator...

    http://forums.virtualdub.org/
    Quote Quote  
  9. How the heck does Variable Frame Rate work?
    Quote Quote  
  10. I've converted many WMV files to AVI via AVISynth and VirtualDubMod or VirtualDub. You may need to add an AssumeFPS() to the script, or add the frame rate and convertfps=true to the DirectShowSource() line:

    DirectShowSource("file.wmv", fps=23.976, convertfps=true)

    This will handle variable frame rate WMV files. You need to specify the correct nominal frame rate, of course.

    If you are frameserving from AVISynth to Virtualdub, VirtualDub has no idea whether the source is WMV, AVI, RMVB or whatever. It simply receives a stream of frames and believes whatever AVISynth tells it about the properties of the video. It's up to the AVISynth script to get the properties right.
    Quote Quote  
  11. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    Hi, jagabo

    Could you explain please how to write this assumeFPS?

    I have a wmv clip that after converting to xvid avi has its audio out of sync.

    I tried this script (and many other things) DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true), but the result is always out of sync.

    I wrote 29.890 because is the fps virtualdub says it has.

    I wish I could get a sync avi with this assume fps script!
    Quote Quote  
  12. Originally Posted by Talayero
    Could you explain please how to write this assumeFPS?
    AssumeFPS(29.97) # or whatever frame rate is necessary

    This is telling AVISynth to forget what it thinks the frame rate is and use 29.97 instead.

    Originally Posted by Talayero
    I tried this script (and many other things) DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true), but the result is always out of sync.

    I wrote 29.890 because is the fps virtualdub says it has.
    What do you mean? VirtaulDub doesn't open WMV files. If you got this after opening an AVISynth script, it's what AVISynth thinks the frame rate is.

    I suggest you try 29.97 since that is a common frame rate. Or calculate how far out of sync the audio and video are at the end, then adjust the frame rate based on that calculation. So if the video is 3600 seconds long but the audio ends 30 seconds before the video, the frame rate should be: 29.89 * 3600 / 3570 = 30.14.

    When encoding, WMV drops frames and tells the player to continue displaying the last frame when the action gets too intense for the bitrate. So during high action sequences the frame rate is often cut in half. Media Players seem to handle this correctly but AVISynth and VirtualDub don't. The convertfps instruction in DirectShowSource() tells AVISynth to compensate for the variable frame rate.

    You can also try using VirtualDubMPEG2 -- it can read WMV files directly.
    Quote Quote  
  13. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo
    What do you mean? VirtaulDub doesn't open WMV files.
    Sorry, I meant VirtualDubMPEG2. This is the one that told me that my wmv was 29.89 fps and also I used this VirtualDubMPEG2 to load the script with the convertfps, but it didn't fix the out of sync. So I don't know which other script I could use to try to get an xvid mp3 avi without the out of sync.

    May be: DirectShowSource("clip.wmv",convertfps=true,assume fps=29.890,audio=true)?

    instead of: DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true), that is the one that gives me an out of sync avi.
    Quote Quote  
  14. DirectShowSource doesn't have a named argument, "AssumeFPS". If you want to use AssumeFPS, you'll have to stick it in the body of the script like so:

    DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true)
    AssumeFPS(29.97)

    You could have figured that out yourself:

    http://avisynth.org/DirectShowSource
    Quote Quote  
  15. Is your audio off by a contant amount for the entire video, or does it start out ok and get more and more out of sync as time progresses?

    If the former use VirtualDub's audio skew ability (audio -> interleave...) to shift the audio forward or back.

    If the latter, do as I said and calculate how much you need to adjust the frame rate and reencode with the adjusted frame rate. Or just set fps=29.97 because that's probably what it really is.

    DirectShowSource("clip.wmv",convertfps=true,fps=29 .97)

    Or you could export the audio, use an audio editor to change the duration of the audio, then import (or mux) it back into VirtualDub.
    Quote Quote  
  16. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    Thank you both for your explanations.

    Sorry if I look like a little bit thik, but wmv is not my cup of tea. I don't master either avisynth scripts.

    I can say that the audio starts ok and gets more and more out of synk, and that the script I used [DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true)] didn't fix it. I also used the same script but with 29.97fps and the result was the same, out of sync.
    I read in another thread that adding the assumefps could change things for good. I don't know.

    I think I could do two things before giving up:

    One, using this script:

    DirectShowSource("clip.wmv",convertfps=true,fps=29 .890,audio=true)
    AssumeFPS(29.97) or AssumeFPS(29.980) I don't know.

    Two, to change the duration of the audio, as jagabo said, using cool edit pro for instance. But I frankly didn't understand which duration I should choose. The duration of the video once has been converted to xvid using some script?

    Thank you for your patience. I didn't know that converting wmv to avi was so difficult. I'm experiencing that out of sync issue very often when I try to convert wmv clips. Wmv stinks, I think.
    Quote Quote  
  17. WMV is always a PITA.

    Obviously 29.89 is not the right frame rate. Using AssumeFPS() will not fix things until you find the correct frame rate.
    Code:
    DirectShowSource("clip.wmv",convertfps=true,fps=29.890) 
    AssumeFPS(29.890)
    is the same as
    Code:
    DirectShowSource("clip.wmv",convertfps=true,fps=29.890)
    alone. Since the output of DirectShowSource() is specified as 29.890 fps, adding AssumeFPS(29.890) does nothing. And:
    Code:
    DirectShowSource("clip.wmv",convertfps=true,fps=29.890) 
    AssumeFPS(29.97)
    is the same as
    Code:
    DirectShowSource("clip.wmv",convertfps=true,fps=29.97)
    Here'a a little trick you can try to resync the audio:

    Download and install AVIFRate. Open your out-of-sync AVI file with AVIFRate and change the frame rate to what you estimate it should be. Save the result (the frame rate is just a number near the start of the file so this only takes a microsecond). Open the result and play it with a media player. See if the audio and video are in sync. If they're still off reestimate a new frame rate and repeat.

    Once you have the audio and video in sync open the AVI file with VirtualDub. Put both audio and video in Direct Stream Copy mode. Save as AVI. This will remultiplex the audio and video so that the audio packets are right next to the corresponding video frame. This doesn't make much difference for playback from a hard drive, but if you ever try to play from a CD or DVD you'll need it.
    Quote Quote  
  18. Since the output of DirectShowSource() is specified as 29.89 fps, adding AssumeFPS(29.89) does nothing.

    In your first examples, AssumeFPS(29.89) wasn't used. AssumeFPS(29.980) was used. And it does do something. A typo, I think. Your second 2 examples are the correct ones as you can set the desired framerate within DirectShowSource.
    Quote Quote  
  19. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    jagabo,

    That would work if the OP had an AVI out of sync, but he's got WMV, so AVIFrate won't work with it.


    Here's my suggestion.
    WMV doesn't really play well with others. OK. So banish it to where it does fine on it's own...

    Open the WMV in WMM. Load to timeline, Save MOVIE as DV-AVI NTSC.

    Now you got an AVI you can work with...

    Yeah, it's an extra step and you've got to have room for the larger file, BUT IT WORKS! I've yet to see WMM have trouble with any NON-DRM WMV file.

    Scott
    Quote Quote  
  20. Originally Posted by Cornucopia
    jagabo,

    That would work if the OP had an AVI out of sync, but he's got WMV, so AVIFrate won't work with it.
    I was suggesting he use AVIFRate on the out-of-sync AVI he has already produced from the WMV. Whether this works or not depends on why his audio and video are out of sync. If the (probably) missing frames are roughly equally distributed throughout the video it will work. If the missing frames are all in one place (or a few palces) it will not work well -- the sync will be good at the beginning and end but off in the middle.
    Quote Quote  
  21. Originally Posted by manono
    Since the output of DirectShowSource() is specified as 29.89 fps, adding AssumeFPS(29.89) does nothing.

    In your first examples, AssumeFPS(29.89) wasn't used. AssumeFPS(29.980) was used. And it does do something. A typo, I think.
    Yes, it was a typo. I fixed it.
    Quote Quote  
  22. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    I found yesterday a program that converted my wmv clip to xvid mp3 without showing out of sync.

    I had tried before all the suggestions I had read in this and other threads and no one worked right, I don't know why, may be because of my specific wmv clip that has a variable fps, resulting of dropping frames. I must say itīs a clip resulting of joining a lot of small wmv files, each one of these with a different fps (29.275,30.698,etc) having the joined file 29.89 fps.

    That's what I had tried before: I converted the wmv to dv-avi ntsc with WMM, but the resulting 7GB dv-avi was already out of sync. I tried again those scripts adding assume fps, and the result was out of sync too.

    Then I found this program, Replay Converter, that I don't think is a very good program, I must say, because you can't configure almost anything, you can't choose freely the bitrate nor the number of xvid passes, nor the resizing. A pity. But I loaded in it my wmv and after the conversion I had a perfectly sync xvid. Besides, I hadn't realized that it was configured to get a pal avi and my resulting xvid was a 25 fps avi.

    So, that program converted my 29.89 fps wmv to a 25 fps xvid avi that was absolutely not out of sync. Perfect. The only and big problem is you can't choose the options of conversion you'd like to. Specific bitrate, specific resize, etc.

    I'd like to be able to do the same that this program does but using some script of mine outside of the program. I found in my computer one script used by this Replay Converter: DirectShowSource("d:\clip.wmv",fps=24,convertfps=t rue,pixel_type="RGB"), but I think it doesn't help to know what it really does to accomplish the conversion. It wonders me too that it says 24 fps but at the end I get a 25 fps.
    Quote Quote  
  23. Originally Posted by Talayero
    I must say itīs a clip resulting of joining a lot of small wmv files, each one of these with a different fps (29.275,30.698,etc) having the joined file 29.89 fps.
    You should have mentioned this in the beginning. It's no surprise you're having so much trouble. How do you come to the conclusion the average frame rate is 29.89?
    Quote Quote  
  24. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    It's what virtualdubmpeg2 says in Video framerate (No change. Current: 29.89 fps)
    Quote Quote  
  25. Since VirtualDubMPEG2 cannot produce a file with the audio and video in sync, why would you have any confidence in that number?

    I've never had a WMV file that's been pieced together from several smaller files of different frame rates. I'm not sure that AVISynth would handle it correctly. Can you provide a copy of the WMV file so I can try some things out?
    Quote Quote  
  26. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    I think the fact of a wmv being divided into several small files is just to make it easier to share, by mail etc. There are programs like ASF tools that split and join wmv files. I don't have many clips with that format but it's true that quiet a few of them have a non standard fps. When I converted them to avi, some were sync and some others out of sync.

    I made a research looking for and trying programs that convert wmv to avi and there are an amazing lot of them. Finally I found out that Replay Converter, the only one for the moment that made the conversion without out of sync issues, had some custom options (hard to find at first sight) that enable to choose the wanted bitrate and resizing. There's no option to choose one or two passes, but it doesn't matter to me because the quality of the resulting xvid was good. Besides, one hour to convert a 30 minutes clip with my 3,01 GHz processor, that means two passes or that the program is as slow as a tortoise
    Quote Quote  
  27. What is the frame rate of your final AVI file with the audio in sync?

    Oh, nevermind. You already said it was 25 fps because you accidentally told it you wanted PAL output.
    Quote Quote  
  28. Member
    Join Date
    Dec 2003
    Location
    Spain
    Search Comp PM
    Yes, I repeated with 25 fps, because it had worked when I chose it accidentally.

    But I tried again chosing 30 fps. By the way, the fps options of this program are:10,12,15,20,24,25,30. I don't know why not 29.97 and why yes 10,12,15,20.

    Anyway, both the 25 and the 30fps converted xvid avi were in sync and with fluent image. The only curious thing is that Gsopt says: User data/ Metadata: [JUNK] odmldmlh, and I had never seen that before.
    Quote Quote  
  29. The userdata field is available for whatever information a program wants to put there. You usually see the name and version number of the program or somesuch. It's nothing to worry about.
    Quote Quote  



Similar Threads

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