VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    Currently working on my first xvid. I'm familiar with vdub, avisynth, and dgindex/dvd2avi. I'm already using avisynth and vdub to split and convert original file into separate files of certain time lengths via the *.avs. Pretty straight forward... just look at and copy down timeframes to the *.avs (x, x), then open each *.avs in vdub and process separately. Works great for mjpeg.

    But for xvid, I'm a little confused...

    My project is Canada Russia '72 miniseries from CBC here in Canada. It was 2 90min episodes. I found the dvd at video rental store in town... $3. It's a double-sided disk with both the 90min episodes.

    I started by opening the vob's in dgindex, and created the *.d2v. I then opened the *.d2v in vdub, and scrolled the timeline to somewheres near the 45min mark, and found the fade-out. Copied the timeframes start -> finish points, then repeated for the rest of the clip... resulting in 4 separate *.avs files, each covering 45min portions. I then open each *.avs in vdub, then add 'smart deinterlace' as it's ntsc interlaced, then I configure the xvid settings for both 1pass and 2pass... creating jobfiles after each. I do this for all 4 *.avs files, then I run all the jobs at once.

    This is where I'm confused though... the audio. If I make an xvid of a clip that I don't split, then it's just a matter of opening the resulting avi in vdubmod using directstream mode, then selecting the audio file using streams... then just save the final avi. Audio and video together again

    But... how the heck do I do this if I'm splitting the original file into 4 separate sections? Using vdubmod for the audio as I did above, results in the same audio portion being added to each separated xvid file. The first clip is fine, but the next 3 are screwed up... opening audio clip being used for all 4 files. Guess I thought it would know which part of the audio clip it would need automatically.

    If I import the dvd file into ulead11, it results in an mpeg, which I can then open and process in vdub as I did above for the separate timeframes, without the separation of the audio file. The result is 4 45min xvids with the proper audio files.

    But I'd like to be able to do this without the need to convert to mpeg first.

    Any ideas/suggestions greatly appreciated



    cheers
    Quote Quote  
  2. Why don't you load the whole source video and audio files into VirtualDubMod and use the mark-in and mark-out functions to mark the sections. Then do everything directly in VirtualDubMod.
    Quote Quote  
  3. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    got it...


    Code:
    #ep1_pt1.avs
    
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgmpgdec\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
    video=mpeg2source("D:\DvdDecrypted\disc01\VTS_05_1.d2v")
    audio=nicac3source("D:\DvdDecrypted\disc01\VTS_05_1 T01 2_0ch 192Kbps DELAY 0ms.ac3")
    audiodub(video,audio)
    trim(0,81469)
    Code:
    #ep1_pt2.avs
    
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgmpgdec\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
    video=mpeg2source("D:\DvdDecrypted\disc01\VTS_05_1.d2v")
    audio=nicac3source("D:\DvdDecrypted\disc01\VTS_05_1 T01 2_0ch 192Kbps DELAY 0ms.ac3")
    audiodub(video,audio)
    trim(81468,162184)
    Code:
    #ep2_pt1.avs
    
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgmpgdec\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
    video=mpeg2source("D:\DvdDecrypted\disc01\VTS_05_1.d2v")
    audio=nicac3source("D:\DvdDecrypted\disc01\VTS_05_1 T01 2_0ch 192Kbps DELAY 0ms.ac3")
    audiodub(video,audio)
    trim(162100,244968)
    Code:
    #ep2_pt2.avs
    
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgmpgdec\DGDecode.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")
    video=mpeg2source("D:\DvdDecrypted\disc01\VTS_05_1.d2v")
    audio=nicac3source("D:\DvdDecrypted\disc01\VTS_05_1 T01 2_0ch 192Kbps DELAY 0ms.ac3")
    audiodub(video,audio)
    trim(244963,324973)

    Now the correct audio sections/timelines are opened for the matching video timelines.

    I haven't processed yet, so I'm guessing that the audio will be included in the encode... no need for vdubmod afterwords. I'll see what happens



    cheers
    Quote Quote  
  4. That's a nice exercise but wouldn't it be simpler to just open the VOB in VirtualDubMod, mark-in, mark-out, and Save as AVI? Use job control if you want to perform several sections overnight.
    Quote Quote  
  5. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    Originally Posted by jagabo
    That's a nice exercise but wouldn't it be simpler to just open the VOB in VirtualDubMod, mark-in, mark-out, and Save as AVI? Use job control if you want to perform several sections overnight.

    thanks jagabo...

    sorry, didn't see your original post when I added my second post

    I'll give that a try. Didn't know you could open vob directly. I was originally going to splice in dgindex, but it doesn't have 'pin-point' accuracy as vdub does... ie: if splitting in the fade-out/fade-in frames, you can't select the 'exact' frame to cut, the utility jumps 4+ frames at a time. Otherwise that would have been great... 4 individual *.d2v's.

    By the way... I ran the above scripts last night, well... first 1 anyways - took 8hrs - but I added separatefields to the avs, then used Deinterlace - Smooth in vdub for the deinterlacing. A 10min test looked great, but the finished 45min clip resulted in hundreds of tiny blocks moving around the clip. And it came to 1.2gb's, even though I selected 700mb in the xvid settings. Here's my settings:


    separatefields

    deinterlace-smooth

    audio = source audio / full processing

    video = full processing

    xvid =

    1st pass:

    AS@L5 / H.263 / Quarter pixel / B-VOP's / 2 / 1.50 / 1.00 / Packed

    1
    31
    1
    31
    1
    31

    Twopass - 1st pass / discard 1st pass

    user defined / 6-ultra high / 4-wide search / use vhq / use chroma / 0 / 300

    ac3 / avg bitrate 192kbps

    other options / xvid

    I made sure to set the audio before clicking the 'calculate'. When trying the other night, I left the audio as 'size', not 'avg bitrate', but the files were only 455 - 510mb's... not the 716800kb's that the setting for 1 cd shows.

    So, I'm not sure why the artifacts. Either a bitrate error, or because the original video has 'grain' added to it to represent film stock from the '70's. .. It's just strange that a 10min clip looked great after processing... just having problems with the entire 45mins set for 699mb's.


    cheers
    Quote Quote  
  6. Originally Posted by greenbag
    Didn't know you could open vob directly.(with VirtualDubMod)
    It usually works. Occasionally you'll find a VOB with variable frame rate and audio and video will get out of sync. DGIndex handles that better.

    Originally Posted by greenbag
    I ran the above scripts last night, well... first 1 anyways - took 8hrs - but I added separatefields to the avs, then used Deinterlace - Smooth in vdub for the deinterlacing.
    You could do your deinterlacing in AVISynth then put VirtaulDubMod in Video -> Fast Recomrpess mode. That will speed things up and avoid picture quality loss due to YUV to RGB back to YUV conversion. LeakKernelDeint() is pretty good.

    Originally Posted by greenbag
    A 10min test looked great, but the finished 45min clip resulted in hundreds of tiny blocks moving around the clip.
    That sounds like an MPEG decoding error. Check your source file using the script. Or maybe you got an Xvid encoding/decoding problem?

    Originally Posted by greenbag
    And it came to 1.2gb's, even though I selected 700mb in the xvid settings.
    Check your output file with GSpot. It will verify the audio and video codecs and bitrates. Your Xvid settings looked ok. I wonder if this is related to the block errors. Something going wrong with the encoding causing both the errors and the over large file.

    If you don't need files of a specific size you can use Xvid in single pass target quantizer mode. Pick the quality (quantizer value) you want and encode in a single pass. It's twice as fast and you always get the quality you want. I rarely use multipass encoding anymore.
    Quote Quote  
  7. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    thanks again jagabo...

    Yeah, I just found that vdubmod and vdub-mpeg will open vob's directly... but only 1 at a time... can't append the files. If I had ripped the dvd to a single vob, it would've been easier. So, I just found projectx, and I'm about to play with it. I could use avisynth's directshowsource, but reading this method has issues.

    As for the blocks/file sizes, I 'think' it's just my bitrate... too high. In my first tests, the video looked good for the 45min clip, but that was where the audio was detached... took a few tests until I realized I needed to mux the audio back into the file using vdubmod

    Maybe if I convert the ac3 to mp3 or pcm?

    I usually just do dvd's, but trying to create files that will fit on cd's so I can upload this to a friend in the States... this dvd is only in Canada. And seeing as most of the free upload sites will only accept 100mb files, 4 cd's of 45mins each would be easier than a double sided dvd... 28 100mb files instead of 90 100mb files.
    Quote Quote  
  8. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    Well, I tried a single pass, but instead of quantizer mode, I set the bitrate for a 699mb cd, said my 45min clip was 60min, and I lowered the acm audio from 192 to 128kbps. It resulted in 930mb's. Still can't figure that out. I used the included calculator in the xvid gui, used the XviDBitCalc.exe, and I used nic's MiniCalc.exe that comes with the xvid install... they all said 1490'ish.

    So... why the heck is the file coming out so big? Is it because I'm processing the audio as well, and not muxing it separately as all the guides suggested?

    I'm going to try again, but this time, I'll select direct stream copy for the audio instead of full processing.

    By the way... I did the conversion without any deinterlacing, just testing for filesize... the picture was clean... no blocks anywhere.
    Quote Quote  
  9. Originally Posted by greenbag
    Well, I tried a single pass, but instead of quantizer mode, I set the bitrate for a 699mb cd, said my 45min clip was 60min, and I lowered the acm audio from 192 to 128kbps. It resulted in 930mb's.
    I think the problem is the 45 vs. 60 minute clip: 700 * 60 / 45 ~= 930. Someone/thing is confused about the duration of your video. What framerate does VirtualDub report for the source? When completed does the xvid file play properly? Is the length right? Audio and video in sync?
    Quote Quote  
  10. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    thanks jagabo...

    The video is 29.97fps (ntsc). The actual clip is 45mins 11secs. I set for 60mins, thinking it would lower the bitrate a bit. This is the first time I've ever used the calculators, so not sure if I'm doing it right. It looks straight forward, set the time length, set the file size (cd size), and set the audio rate... after that, it gives the bitrate... correct?

    Looking at your formula, is that supposed to be 930kbps, or 930mb's finished?

    Is that 700mb's x 60mins divided by 45mins? In other words, 700mb cd x 60min size, divided by 45min clip? So, if 50min clip, it would be 700 * 60 / 50 ~= 840?

    If the formula is for the bitrate, then the calculators are wonky. I even uninstalled xvid v1.1.2, and replaced with xvid v1.1.3... no difference.

    I'll try calculating with your formula instead.

    By the way... as for the LeakKernelDeint, it didn't like the colour format... I need to read up on that first


    cheers
    Quote Quote  
  11. Originally Posted by greenbag
    The video is 29.97fps (ntsc). The actual clip is 45mins 11secs. I set for 60mins, thinking it would lower the bitrate a bit. This is the first time I've ever used the calculators, so not sure if I'm doing it right. It looks straight forward, set the time length, set the file size (cd size), and set the audio rate... after that, it gives the bitrate... correct?

    Looking at your formula, is that supposed to be 930kbps, or 930mb's finished?

    Is that 700mb's x 60mins divided by 45mins? In other words, 700mb cd x 60min size, divided by 45min clip? So, if 50min clip, it would be 700 * 60 / 50 ~= 840?
    What I'm saying is I suspect you told the Xvid calculator that your file was 45 minutes but it is actually 60 minutes. File size = bitrate * running time. Hence, for a given bitrate, a longer running time will give a bigger size. That's why I asked to to check the runing time of the output file. Is it 45 minutes or 60 minutes?

    Originally Posted by greenbag
    By the way... as for the LeakKernelDeint, it didn't like the colour format...
    Use ConvertToYUY2() or ConvertToYV12(). MPEG decoders usually output YV12. Did you convert to RGB at some point? Avoid conversion to RGB if possible.
    Quote Quote  
  12. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    The clip is 45mins, but set for 60 thinking it would lower the bitrate, resulting in a smaller file. As for the leakkerneldeinterlace, I think it was when I was testing things out... either trying to open vob directly, or when I tried frameserving with vfapiconven.exe... it was 4am, and I can't remember

    It works fine now when opening the *.avs. LeakKernelDeint(1)

    I just ran my 45min *avs for 1hr of the estimated 3hrs, using 933kbps (used your formula and calculator)... it was looking at 800mb's. Started looking like 1.1gb's, but leveled out to 800mb's for the last 30mins or so.

    I couldn't run a vob in gspot, so analyzed in dgindex instead:


    Code:
    aspect = 16:9
    frame size = 720x480
    profile = main@main
    frame rate = 29.970030 fps
    video type = ntsc
    frame type = interlaced
    colorimetry = itv-r bt.709
    frame struct = frame
    field order = top
    coded # = 1811
    playback # = 1811
    vob cell id = 1, 1
    bitrate = 6.271 mbps
    bitrate (avg) = 6.266 mbps
    
    track 1 = ac3 2/0 192
    track 2 = ac3 2/0 192
    track 3 = ac3 2/0 192

    I just installed ac3acm codec for vdub, so I'll see if that makes a difference. As I said before, the first trials I did, were where the audio was seperate, the final file sizes were smaller... just too small. Thinking maybe vdub isn't compressing the audio correctly... will see now that the ac3acm's installed. The audio sounds fine, and no sync issues, but maybe just not compressing enough. I tried both full processing, and direct stream copy... no difference.

    I'm not resizing, unless I'm supposed to... but that shouldn't matter, should it? If so, I could resize to 640x480, but would have to do that with avisynth... if using fast recompress in vdub, I lose the filters option.

    By the way, I'm using vdub v1.7.2. The first *.avs displays Frame 81470 (0:45:18.382) [ ]
    Quote Quote  
  13. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    I'm a bonehead... forgot to compress the audio


    Was at uncompressed, now set for ac3 at 192kbps. 933kbps looking at 365 - 375mb's. Set back to the defaulted 1934... 46mins at target size of 716800 kb's. 1/2 hr in, and it's looking at 680 - 690mb's.

    Only took me 3 days to figure that out


    cheers
    Quote Quote  
  14. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    That did it... 694mb's

    Although I set the audio in the xvid configuration utility, I had forgotten to set the compression in vdub itself... woops. It was because the first trials I did, I followed a few guides where the audio was remuxed later, so I didn't need to do anything but set vdub's audio preference to 'none'.



    cheers
    Quote Quote  
  15. Originally Posted by greenbag
    I'm a bonehead... forgot to compress the audio :roll:


    Was at uncompressed
    That's why I kept telling you to check your output file with GSpot. It would have told you this right away and saved you a lot of aggravation.
    Quote Quote  
  16. Member
    Join Date
    Aug 2006
    Location
    Canada
    Search Comp PM
    Sorry jagabo, I guess I misread your suggestion... thought you had said to check the original in gspot, that's when I mentioned that I couldn't run the vob through gspot. My fault

    Wasn't a total loss... I learned something


    By the way, I came across smoothdeinterlacer_25 for avisynth (SmoothDeinterlacer.dll). It's the exact same as deinterlace-smooth for virtualdub, but takes 3 hrs less for the 45min clip. It works great at the default settings. Although LeakKernelDeinterlace works as well, I found clips were still interlaced somewhat... I didn't figure how to configure properly... need to read up more.


    cheers jagabo, and thanks again for your help
    Quote Quote  



Similar Threads

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