VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 41
Thread
  1. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Frequently I will have DV footage that I need to crop and then compress with the On2 codec to a 320 x 240 frame size. I have read that this encoder works best with multiples of 16 for frame sizes. I'm wondering where this multiple of 16 thing comes into play? Does that mean that my input video should have a frame size that is a multiple of 16? Meaning that I should pay attention to the dimension after I crop? or does it mean that just my final frame size needs to be a multiple of 16...like 320 x 240?

    Thanks...
    Quote Quote  
  2. the size of the output video is best at multiples of 16. both your input and output values are fine.
    Quote Quote  
  3. Many codecs will break up the input video into macroblocks of 16x16 blocks when they do their analysis, vp6 definitely does this. Using Non-mod16 resolution means less efficiency (therefore less quality at the same bitrate). So you should resize to dimensions evenly divisible by 16. (final frame size)
    Quote Quote  
  4. I don't know about On2 in particular, but with other codecs that work in 16x16 blocks (MPEG1, MPEG2, MPEG4.2, MPEG4.10, etc) the quality/size difference between mod16 and non-mod16 is quite small unless you are working with very small frame sizes.
    Quote Quote  
  5. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    So it makes sense to me that the final video frame is divisible by 16 (i.e. 320 x 240.) Still confused about my input video- my original DV footage is 720 x 480, so when I crop I usually take 16 pixels off top, bottom, left, and right leaving 688 x 448 which is divisible by 16. What I'm ultimately looking for is the right number that I should crop with...it gets confusing to me with non square pixels and square pixels...I arrive at cropping with the 16 number on each side by taking 720 subtracting 16 twice and then seeing if it is divisible by 16. Should I be doing it this way or should I be subtracting from 640 and then seeing if it is divisible by 16?
    Quote Quote  
  6. Crop the frame proportionally. Since the frame is 720x480 (1.5:1) crop the left/right sides by 1.5 times as much as the top/bottom. For example, 12 left, 12 right, 8 top , 8 bottom. Then resize to 320x240 (assuming a 4:3 DAR source). If your source is interlaced you will want to deinterlace first.
    Quote Quote  
  7. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Thank you...

    Just curious...what is DAR stand for?

    Also, along time back I read that it is best to keep my original footage in it's native form (interlaced in my case) all the way to the final encode and let the encoder do the deinterlacing? I usually export all of my footage from Premiere keeping the interlacing intact and then let my Flash Video Encoder or Windows Media Encoder do the deinterlacing. Is this still the best workflow or should I be deinterlacing upon export from Premiere?
    Quote Quote  
  8. DAR = Display Aspect Ratio -- the aspect ratio the video is to be displayed at. DV DAR is either 4:3 or 16:9.

    If you are going to reduce at 720x480 interlaced frame to 320x240 you have to deinterlace. Deinterlacing is best done before resizing. Resizing interlaced video requires special techniques to keep the two fields from co-mingling. Even when done correctly it introduces more artifacts than if you deinterlace first.

    The very best deinterlacer is AviSynth's TempGaussMC_beta(). A distant second would be AviSynth's Yadif(). Premiere probably has pretty poor deinterlacing.
    Quote Quote  
  9. Originally Posted by jagabo
    Premiere probably has pretty poor deinterlacing.
    Yes, it is very poor. It drops 1/2 the fields and has very bad interpolation. It leaves jaggies everywhere which "eat up" bitrate - very bad choice for streaming video
    Quote Quote  
  10. By the way, the general rule of keeping interlaced video interlaced is a good one. But this case is an exception. You are going to downsize the frame so you want to deinterlace before resizing.
    Quote Quote  
  11. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    So in my work flow, you are recommending exporting from Premiere, running this DV AVI file through AviSynth and deinterlacing it, and then compressing it with my FLV encoder? I know that it is probably best practice to export to an uncompressed format but since time and space are in issue I always export from Premiere to a DV avi file. Would I import and export out of AviSynth the same way?
    Quote Quote  
  12. You could use the Premiere AVS Import plugin, but Premiere does an extra colorspace conversion (slight degradation in quality, noticable only if you look frame by frame very closely);

    a better quality workflow (but longer time, more disk space for intermediates) would be to use avisynth to deinterlace and resize and encode to a lossless YV12 intermediate for import into Premiere (avisynth also has many more choices for quality resizers than Premiere). You could then export a lossless intermediate, or directly encode with adobe media encoder

    While we are discussing quality, you might consider h.264/aac instead of on2 vp6. It is a newer generation of flash, and vp6 is much less efficient. There are very few cases where you would choose to use vp6 (either your application needs alpha transparency preserved, or your web application is a few years old and requires it). You might need 20-30% larger bitrates (therefore filesize) if you chose vp6 instead of h.264 for the same level of "quality". This is usually important for flash/streaming video scenarios where bandwith costs $.

    If time is an issue, you can cut corners on quality and time and disk space by using the avs import plugin, and encoding directly from adobe media encoder (if you have a recent version, it supports vp6 and h.264). Also tempgaussmc_beta1 is very very slow. We're talking 1-2 fps for just the deinterlacing, but the difference in quality is amazing. Yadif is about 10-15x faster and still very good quality, but leaves tiny artifacting (still much better than Premiere deinterlacing), and yadifmod+nnedi is about 2-3x faster than tempgaussmc_beta1 but close in terms of quality. You have to make the final choice on where you are willing to "cut corners" for your workflow
    Quote Quote  
  13. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Thanks so much for the in depth answer. The problem that I'm running into it that I use a Matrox realtime card, so I really need to keep my native footage at 720 x 480 interlaced to work with my timeline in realtime. I guess a perfect solution would be if I installed this Premiere AVS Import plugin and it would let me export with it? Deinterlaced? From there I could reimport it and encode it with Adobe Media Encoder? From and earlier post I was told never to do the deinterlacing and resizing in the same step...
    Quote Quote  
  14. Sorry, not sure how it will work with the matrox card. Does it only work for certain types of footage?

    You would normally deinterlace, then resize, it's not in the same step, but can be done in the same script in order of operations. I personally would use avisynth for this, because there are dozens of choices and the quality really is much much better. This is done before importing into premiere.

    The premiere avs import plugin is only for import.

    What kind of editing are you doing? If it's just simple cuts it should be ok, but all effects and overlays, titles etc. should be done on progressive footage especially if your end goal is progressive. Interlaced material is just horrible for effects. If you import interlaced, add your effects , then deinterlace, it won't be look very good - edges get artifacts, and your titles aren't as crisp.

    What version of Premiere are you using? Adobe Media Encoder is part of Premiere in earlier versions, a separate application in CS4

    You might consider upgrading your PC, because standard DV is easy to edit in real time on modern PC's (unless you have like 50 layers and dozen effects). You shouldn't need GPU assist.
    Quote Quote  
  15. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    I've done a little exploring and is AviSynth used with Virtual Dub Mod. I have used that program before. Looking at the Virtual Dub Mod user interface there is an Filter section that I can apply deinterlacing. My best shot might be to bring in my interlaced dv file into this program and deinterlace it saving to an uncompressed RGB file. From there bring it into my encoding program and resize it?

    I'm using CS3 and because my target Flash Player has to be a bit older I can't quite use the H.264 codec yet. Maybe in the not so distant future.
    Quote Quote  
  16. Originally Posted by bsuska
    I've done a little exploring and is AviSynth used with Virtual Dub Mod. I have used that program before. Looking at the Virtual Dub Mod user interface there is an Filter section that I can apply deinterlacing. My best shot might be to bring in my interlaced dv file into this program and deinterlace it saving to an uncompressed RGB file. From there bring it into my encoding program and resize it?

    I'm using CS3 and because my target Flash Player has to be a bit older I can't quite use the H.264 codec yet. Maybe in the not so distant future.
    Are you referring to the export from Premiere or preparing the input to Premiere?

    Ideally you wouldn't use RGB, because DV is YV12, and the YV12=>RGB->YV12 conversion is lossy. Ideally you would use a YV12 lossless intermediate (e.g. lagarith or huffyuv in YV12), and the tests I have done show that Premiere can keep the same YV12 colorspace without conversion with many effects (some effects might require colorspace conversion).

    Also the internal deinterlacers in VDubMod aren't that great, and vdubmod hasn't been updated in years. I would use yadif with avisynth. The newer vdub has yadif internally, but if you use internal filters, it undergoes an RGB colorspace conversion. You avoid this if you use an .avs script and use "fast recompress" mode in vdub

    The script might be as simple as this for yadif. It doesn't have to be that difficult or exotic. You could write the lines in notepad, change the extension to .avs, changing paths and filenames to match. If your listed PC specs are accurate, you might want to avoid TempGaussMC_Beta1 and yadifmod+nnedi, they will be unbearably slow

    Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
    AVISource("video.avi")
    Yadif(mode=0,order=0) #bottom field first
    LanczosResize(320,240)
    Quote Quote  
  17. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    I'm talking about exporting from Premiere.
    Do you have a download link for yadif? Where from there would I add this code?
    It looks to me that this code will resize and deinterlace? So essentially it is okay to do this all in one step?
    Quote Quote  
  18. You need to install avisynth first
    http://avisynth.org.ru/yadif/yadif.html

    The code is just an .avs file (essentially a text file, see the post previous). It's not one step, yadif come before the resize, so it is processed in that order

    I strongly advise against doing it the way you are planning. Unless you are only doing simple edits like cutting, you should deinterlace before importing into Premiere. Also if you export DV-AVI out of Premiere you have an extra stage of quality loss.
    Quote Quote  
  19. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Which version of avsynth is best to install AviSynth 2.0.08, AviSynth 2.5.8, or AVS 2.5.8 RC5?

    I then would install the YADIF plugin?

    Deinterlacing my DV footage before import would add a lot of work for my workflow since I need to create NTSC (interlaced Mpeg-2) DVD out of this same footage...
    Quote Quote  
  20. 2.5.8 is stable, not sure about 2.5.8 rc5

    To install yadif, put the .dll in the plugins folder, the script above will load the plugin

    Ok that makes more sense if you have a multiple formats for 1 project. You should definitely leave it interlaced for the DVD. It's up to you where you want to take shortcuts, we are just providing information so you can decide what works best for you in terms of tradeoffs and your goals. You can do some small tests on short videos to see if that particular workflow is "good enough" for you.

    The only thing you should 100% avoid is using Premiere or Adobe Media Encoder for deinterlacing.
    Quote Quote  
  21. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Okay...

    When I export out of Premiere I should use the Huff or Lagarith codec? I tried following directions from the AviSynth site and created a text file, but when I tried opening this AVS file in VirturalDub Mod it told me the file needed to be YUV (I assume this is a setting). I've since downloaded Virtual Dub and will try and open the .avs file in that. What do I do once I open the file? How does it know where to save the deinterlaced file?
    Quote Quote  
  22. Originally Posted by bsuska
    When I export out of Premiere I should use the Huff or Lagarith codec? I tried following directions from the AviSynth site and created a text file, but when I tried opening this AVS file in VirturalDub Mod it told me the file needed to be YUV (I assume this is a setting). I've since downloaded Virtual Dub and will try and open the .avs file in that. What do I do once I open the file? How does it know where to save the deinterlaced file?
    Well huffyuv and lagarith are lossless in .avi container.

    So you could use an avs script to deinterlace that ; not sure what you did in premiere, or if you did an RGB conversion (some filters may need it), so if your export wasn't already YV12, you may need to add that line to the bottom. Also use virtualdub, not virtualdubmod

    Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
    AVISource("exportedpremierevideo.avi")
    Yadif(mode=0,order=0) #bottom field first
    LanczosResize(320,240)
    ConvertToYV12()

    You should be able to open that .avs file directly in vdub (if you have huffyuv or lagarith installed). You would use video=>fast recompress, then select the compression. File=>save as will give you a dialog box to location. What final encoder are you using? If it accepts .avs scripts directly you can avoid the extra vdub steps and use the .avs directly as input (ideal, instead of using 2 lossless intermediates)
    Quote Quote  
  23. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Thanks again for the help...I'm going to try tackling this again tomorrow. Just downloaded Virtaul Dub...one thing I don't see that was in Virtual Dub Mod was the "Save As" command. In Virtual Dub Mod is seemed that I had a choice of codec to save to. In Virtual Dub I don't see any parameters for the type of AVI file I'm saving. Any ideas?
    Quote Quote  
  24. video=>compression (select lagarith, or huffyuv etc....)

    Set the mode to video=>fast recompress if you are using .avs input, and no vdub internal filters

    file=> save as avi
    Quote Quote  
  25. Originally Posted by bsuska
    When I export out of Premiere I should use the Huff or Lagarith codec? I tried following directions from the AviSynth site and created a text file, but when I tried opening this AVS file in VirturalDub Mod it told me the file needed to be YUV
    Yes, it's likely Premiere was exporting RGB. In both the HuffYUV and Lagarith codecs you can control what happens with RGB sources. They can leave the video as RGB and compress it, or they can convert to YUY2 and compress. Lagarith also gives you the option of converting to YV12 -- but I would use YUY2 instead because it may not handle interlaced YV12 properly.

    I just checked: Lagarith's RGB to YV12 conversion does screw up the chroma channels of interlaced sources. It works fine for progressive sources though.
    Quote Quote  
  26. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    As regards the original request, I would STRONGLY recommend the following procedure:

    1. (for 4:3 video) Crop 8 pixels off each side. 720 - 8 - 8 = 704. This is the native NON-overscanned sampling of 601 and DV. This is also evenly divisible by 16 (44). YOU DON'T NEED TO DO ANYMORE CROPPING.
    2. 704x480 is the non-square pixel frame equivalent of a square-pixelled 640x480. 640x480 just happens to be 2x320 and 2x240!!!(Actually, it was that way on purpose). So you do an even 2x size reduction on each axis (which will be much sharper than an odd divisor). Now you've got square pixel 4:3 320x240.

    3. If you do fully anamorphic 16:9 DV, it'll also be 720x480 framesize, but with a different PAR. But, reading the info above makes me disinclined to believe that's how you're shooting. There are other non-full widescreen ratios as well, but I think that's getting even further afield.

    Anytime you encode, you should pay attention to the dimensions as they pertain to the chosen codec. Some use 16x16 macroblocks, some 16x8 or 8x16, some 8x8, etc. (MPEG4 has much more choices available than 2 or 1). You said On2, but that doesn't say WHICH On2 codec: Vp3, Vp4, Vp5, Vp6, Vp7, Vp8?
    The last 2 are probably MPEG4-based, unlike the others, so they'll have more leeway as well.

    As regards efficiency, I would say 320x240 IS a small enough size where every bit counts...

    Scott
    Quote Quote  
  27. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Hey Scott...

    Yes, I am shooting with the 4 x 3 and would like to ultimately encode with the On2 VP6 codec.

    Your numbers all seem to add up, but then only problem is that sometimes my video has garbage at the top and bottom of the frame. Hence, my needing to crop at all.

    Man, I cannot believe how much work it is proving to be not use the deinterlacers in Premiere/Flash Video Encoder/ etc. Why don't they just implement a good one!
    Quote Quote  
  28. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Thanks for all of the help, but I guess after all of this I still can't figure out the best workflow.

    Do I crop coming out of Premiere and encode to an interlaced Lagarith codec and then import into Virtaul Dub and deinterlace. Then export to Lagarith again and then bring into Flash Media Encoder and resize and compress to OnVP6?

    I get that I should use Virtual Dub and Yadiff to do my deintelacing, but which programs should I be using for the cropping and resizing?

    Thanks.
    Quote Quote  
  29. You can use avisynth to do the crop and resizing, the resize was already in the sample script above, LanczosResize(320,240). You can choose another resizer if you want: e.g, Spline36Resize would give you a miniscule better results, but significantly slower, and there are other choices as well.

    Crop(left,top,-right,-bottom)

    So if you used Cornucopia's numbers:
    Crop(8,0,-8,0)

    Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
    AVISource("exportedpremierevideo.avi")
    Yadif(mode=0,order=0) #bottom field first
    Crop(8,0,-8,0)
    LanczosResize(320,240)
    ConvertToYV12()

    Virtualdub isn't doing anything here, everything is done in the script. Vdub is just acting as a front end to encode your lossless intermediate

    If Flash Media Encoder accepts avs scripts, you could encode directly and avoid the vdub step and 1 intermediate
    Quote Quote  
  30. Member
    Join Date
    May 2006
    Location
    United States
    Search Comp PM
    Cool thanks...

    Last question...

    The whole YV12 thing...

    What color space is DV and do programs care?...obviously Avisynth does.
    Quote Quote  



Similar Threads

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