VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Ok, I have been using Virtualdub for quite some time just for simple encoding and trimming, etc.... I'm pretty new to AviSynth.

    I have a DVD/DivX player, which, as the name implies, is designed to play rips as well. I have some rips that are in ffdshow, which the player doesn't seem to recognize. So I'm redoing them in plain Xvid. For most of them, this is dirt simple, just fast recompress and I've done the job with what I believe is as little damage as possible given the situation. However, there are a few (these are VHS rips, woe is me), which DRASTICALLY improve with a simple tweak/levels adjustment.

    This is where AviSynth comes in. I figure I'm doing enough decoding and re-encoding, so I don't want to eff it up even more by converting to and from colorspaces as well, so I am using AviSynth to do the tweak. I wrote the (thankfully) simple script, and it opens in Virtualdub just fine, but when I try to save the AVI with EXACTLY the same parameters, the calculated (and resulting) file size is at least double of when doing the very same operation without using AviSynth (with or without a virtualdub filter, regardless of processing mode). If someone could explain what might be going on here, I'd be eternally grateful.

    Oh, and as an aside, I also go into the Xvid options in Virtualdub, and I tried doing the Twopass bit, and I type in a precise size that I want the file to be, and it is just completely ignored...[/i]
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    It depends on what those parameters are as to why the size is changing. Quality based encoding, for example, does not produce accurate file sizes.
    Read my blog here.
    Quote Quote  
  3. If someone could explain what might be going on here, I'd be eternally grateful.
    You're inadvertently converting the audio to PCM WAV, maybe? Check the resulting AVI in GSpot.
    Quote Quote  
  4. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Hmm, ok thanks for the replies. I'll check and see if there's something in AviSynth that mentions it being necessary to specify to leave the audio alone or something, and I'll get Gspot. I'm not at my own computer now, but I'll test this out later and post the results.
    Quote Quote  
  5. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Well yep, I missed that, I looked at file information in Virtualdub, loading the file normally, and with AviSynth. With AviSynth, it is, indeed, PCM audio instead of the MP3 or whatever it was. Next question is why . I'll just recompress it, but is there anyway to get AviSynth to do direct stream copy with audio?
    Quote Quote  
  6. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    Both video and audio can be set to either Direct Stream Copy or Full Processing mode independently of each other. Only video has a Fast Recompress mode. Virtualdubmod sets audio to Direct Stream Copy by default. Virtualdub and Virtualdubmpeg-2 set it to Full Processing by default. Don't know why. Change it under the Audio menu. Full Processing without setting compression gives uncompressed PCM audio.
    Read my blog here.
    Quote Quote  
  7. I'll just recompress it
    Recompress what? The PCM audio? And degrade it even more? Just demux the original MP3 audio and mux it into the new AVI, replacing the PCM audio.

    By the way, your thread title implies there's something wrong with using AviSynth to frameserve into VDub. Nothing could be farther from the truth, and this is just another case of user error.
    Quote Quote  
  8. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Sorry, I didn't word that too clearly. I am familiar with the Virtualdub menus and how the audio and video can be set discretely, but I was more wondering about achieving what direct stream copy does to the audio (nothing) while using Avisynth. Basically, I don't understand why Avisynth insists on decompressing the audio, and I was curious if there was a way to prevent it.

    I realize that Virtualdub works well with Avisynth as a frameserver, opens the file and recognizes it perfectly well. However, what I observed was a difference with the only variable being Avisynth. I see that wording is a bit much for what my issue is, but I figured that was a way to have people look at this thread who have had experience in the applicable area.

    The solution does seem rather simple, but I do not believe it was my (user) error. If there is a setting to change this, that'd be cool, but I don't think Avisynth decompressed the audio because of something I did. If I'm wrong, do let me know what this is . Anyhoo, thanks again for the help.
    Quote Quote  
  9. AVISynth always decompresses audio to PCM. If you want the original (MP3?) audio use VirtualDubMod to demux the audio from the source AVI, then mux it with the new video. In VirtualDubMod:

    File -> Open Video File... (open original AVI with compressed audio)
    Streams -> Stream List...
    Click on audio stream and press Demux

    That will create a file with the exact audio (compressed) as the source *.MP3, *.MP2, *.AC3, whatever.

    To mux that into a file you converted already:

    File -> Open Video File... (open new AVI file with PCM audio)
    Streams -> Stream List
    Click on PCM audio and press Disable.
    Press Add, select audio file created above.
    Video -> Direct Stream Copy
    File -> Save as...

    That discards the PCM audio then muxes the compressed video and audio.

    If you use VirtualDubMod for your entire process:

    File -> Open Video File... (open original source)
    Streams -> Stream List...
    Demux audio stream
    File -> Open Vdieo File... (open AVS script)
    Streams -> Stream List...
    Disable PCM stream
    Add demuxed stream from earlier step
    Video -> Fast Recompress
    Video -> Compression...
    File -> Save as...

    You can force AVISynth to ignore the audio by adding FALSE to the AVISource() line:

    AVISource("VIDEO.AVI", false)

    If you do that you don't have to disable the audio stream in VirtualDubMod, AVISynth won't pass it along.
    Quote Quote  
  10. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    AVIsynth doesn't have a bypass. Because it is a frameserver, what the host program sees is uncompressed video and/or audio streams. It is the same if you frameserve from virtualdub. The host sees uncompressed streams because that is the point of a frameserver. If you want to keep the original audio then demux first, and mux it back into the processed video afterwards.
    Read my blog here.
    Quote Quote  
  11. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    Ah, ok, that's much clearer to me now. Thanks a bunch.

    For the record, I had managed to figure out the demux with VirtualdubMod, but not the mux part. I started poking around there since it's clear VirtulalDub only likes wav audio.

    I guess I was so focused on not converting colorspaces, that I didn't really think Avisynth would convert to uncompressed anymore than it would convert to RGB... No reason for this really, just what my bloody mind came up with . Thanks again.
    Quote Quote  
  12. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    Actually, Virtualdub works happily with other formats, but MOD is much easier to follow.

    To mux audio in Virtualdubmod, click on Streams -> Stream List, then click on ADD. Select your audio file and click OK. Click on the old audio track to high-light it, then click on Disable. Finally, right-click on your audio track and make sure it is set to Direct Stream Copy. Click OK, then click on File -> Save AVI and create your new file with new audio.
    Read my blog here.
    Quote Quote  



Similar Threads

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