VideoHelp Forum
+ Reply to Thread
Results 1 to 27 of 27
Thread
  1. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    Hello All,

    I am working on a video with 3 different video feeds. 2 were shot with MiniDV cameras and one other angle was given to me from a video camera that records straight to .MPG (how dumb is that!?)

    So here's the problem..I want to include this angle in certain parts of my video but it requires a re-encode of the MPEG2 which of course results in sucktacular quality.

    I attempted to get artsy and show one of my angles at the bottom corner of the screen and the MPEG angle at the top, both at about 60% size and sort of overlapping on the corners (this was done in premiere cs4). The result was good looking video with the DV footage and blocky nasty video with the MPG.

    My next step was to attempt resizing the MPG to 50% to see if the resizing algorithm likes that nice half size better, but if that doesn't work I was wondering if they make an application like womble that would let me take 2 mpeg files (of the same res/bitrate of course) and swap back and forth, then do a stream copy of the single mpg?

    I know I could use a single video track and try to splice the MPEG file in but I'm pretty sure my chances of making it look 100% seamless is zero. I've only done that sort of thing on movies where there's a scene change or the screen goes all white/black with no music.

    Anyways..just looking for suggestions on how to handle this silly MPG in my DV world .

    Currently I do my edits in premiere, output to uncompressed avi (the mpeg encoder in adobe's media encoder isn't very good), then uncompressed avi to mpeg2 for DVD (This is where I would match the bitrate to the bitrate of existing MPG file)
    Quote Quote  
  2. Member
    Join Date
    Jan 2007
    Location
    Republic of Texas
    Search Comp PM
    I have had MANY projects where I was forced to incorporate MPEG-2 footage in with the DV-AVI. I just convert the MPEG-2 footage to DV-AVI using VirtualDub-MPEG2 with the Cedocida DV codec. Thereafter, all footage is edited in the same, uniform format in Premiere.

    If the source MPEG-2 video looks good, the bump-up to DV should be acceptable. You should not get "sucktacular" quality if the footage has enough bitrate and is not re-encoded more than once.

    Also, if you are bringing in highly-compressed source footage, what point is there to exporting the final project to uncompressed avi? If you want to use an uncompressed format (essential for layering and effects), it should happen as early as possible, like the point of capture -- not when the entire project is finished and ready to be exported.
    Quote Quote  
  3. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    thanks filmboss. I'll convert the mpeg2 to dv.

    I guess I exported to uncompressed .avi before my mpeg encode because I thought it would have the most "headroom" and therefore be the least likely to degrade my video quality any more.

    My thoughts have been wrong before, however .
    Quote Quote  
  4. Member
    Join Date
    Jan 2007
    Location
    Republic of Texas
    Search Comp PM
    It's great to use uncompressed avi; just convert all your footage clips to that format BEFORE bringing them into the editing project. When finished editing, just go straight out from the project timeline to mpeg-2, or whatever final playback source you need.
    Quote Quote  
  5. He's using uncompressed export in order to avoid AME MPEG2
    Quote Quote  
  6. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    yep..AME encoder is too soft for me. I use an standalone encoder that gives a much better end result..I think converting the mpeg2 to DV is just what i need to get everything aligned in the editing. My concern was that it would take a big quality hit. Looking at the MPEG captured from the camcorder it looks like it's at something like 5.5Mbps??? I'm not sure if it's VBR or what but it seems a bit low...well it was sitting on a tripod in a static position so maybe not..I just want to use the angle more but I've been shying away from it because it looks bad trying to go from MPEG -> MPEG no matter how to slice it...so hopefully MPEG -> DV -> MPEG will do the trick...

    I am just assuming the uncompressed avi step presents little to no quality hit on the video?
    Quote Quote  
  7. Originally Posted by greymalkin
    yep..AME encoder is too soft for me. I use an standalone encoder that gives a much better end result..I think converting the mpeg2 to DV is just what i need to get everything aligned in the editing. My concern was that it would take a big quality hit. Looking at the MPEG captured from the camcorder it looks like it's at something like 5.5Mbps??? I'm not sure if it's VBR or what but it seems a bit low...well it was sitting on a tripod in a static position so maybe not..I just want to use the angle more but I've been shying away from it because it looks bad trying to go from MPEG -> MPEG no matter how to slice it...so hopefully MPEG -> DV -> MPEG will do the trick...

    I am just assuming the uncompressed avi step presents little to no quality hit on the video?

    I might be misunderstanding what you are trying to do.

    MPEG2=>DV=>MPEG2 adds unecessary quality loss

    The MPEG2 source is low quality to begin with. Re-encoding it with a lossy format like DV-AVI will only make it worse. I see no point in rendering the MPEG2 footage to DV-AVI then importing that, because that is an extra stage of generation loss. The only time you might do this is if you pre-process this (e.g. use some avisynth filters or deblocking filters to clean it up), but even then I wouldn't use DV-AVI, I would use a lossless import like huffyuv , lagarith, or even uncompressed

    If you are not prefiltering , or cleaning up the footage and content with the MPEG2 as is , just import as native MPEG2. The quality loss upon final render is unavoidable, but why complicate things and suffer quality loss converting that to DV-AVI first?

    There is no advantage to converting the MPEG2 footage to uncompressed first (unless you are prefiltering) ; to PP CS4, it will "look" the same whether native MPEG2, or uncompressed. But there will be lower quality if you convert to DV-AVI for import.
    Quote Quote  
  8. Video Restorer lordsmurf's Avatar
    Join Date
    Jun 2003
    Location
    dFAQ.us/lordsmurf
    Search Comp PM
    Convert to uncompressed or lossless (HuffYUV), not DV. DV is still compressed, will yield quality loss.
    Want my help? Ask here! (not via PM!)
    FAQs: Best Blank DiscsBest TBCsBest VCRs for captureRestore VHS
    Quote Quote  
  9. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    poison,
    I realize I will take a quality hit regardless of what I do, just noticed that the resize using the built in "Scale" parameter in premiere looked fine on the DV footage whereas the MPG2 file looked jaggy/ugly.

    I know adding an extra step such as converting MPG -> Uncompressed will not help the quality any, I was hoping it would allow the editor to perform the resize with the same good results as what I got with the DV video.
    On top of that, my hope is the PROPERLY scaled down MPG (approx. 50% of original size) should compensate for some of the quality loss during final encode, giving the appearance of sharpness, etc.

    I originally didn't even want to include the MPG video in my edit, but try to make a multi-angle dvd so It would be a bit more interactive and I wouldn't have to re-encode the MPG at all, but apparently that is a nightmarish task all in it's own. I believe the bitrate needs to match between video streams which would cause me to have to encode the DV video at about 5.5Mbps...which is unacceptable to me!
    Quote Quote  
  10. Originally Posted by greymalkin
    poison,
    I realize I will take a quality hit regardless of what I do, just noticed that the resize using the built in "Scale" parameter in premiere looked fine on the DV footage whereas the MPG2 file looked jaggy/ugly.
    To summarize, Premiere has big issues with interlaced resizing. This has been discussed in several forums. A lot of info in this thread
    https://forum.videohelp.com/topic373212.html
    http://www.precomposed.com/blog/2009/07/hd-to-sd-dvd-best-methods/

    Since the MPEG2 footage is poor to begin with, the macroblocking and noise artifacts will be compounded. Even if you resized DV-AVI, it will be worse than if you used proper methods outside of Premiere


    I know adding an extra step such as converting MPG -> Uncompressed will not help the quality any, I was hoping it would allow the editor to perform the resize with the same good results as what I got with the DV video.
    On top of that, my hope is the PROPERLY scaled down MPG (approx. 50% of original size) should compensate for some of the quality loss during final encode, giving the appearance of sharpness, etc.
    That's the key, don't do any interlaced resizing in premiere. Period.

    I haven't seen your MPEG2 footage, but I suspect you could clean it up with avisynth or vdub filters, (and do a proper resize) before importing into your project

    I originally didn't even want to include the MPG video in my edit, but try to make a multi-angle dvd so It would be a bit more interactive and I wouldn't have to re-encode the MPG at all, but apparently that is a nightmarish task all in it's own. I believe the bitrate needs to match between video streams which would cause me to have to encode the DV video at about 5.5Mbps...which is unacceptable to me!
    I don't see the reason why you have to match bitrates? Am I missing something? All NLE's decompress the image internally, so there is no need to match bitrates. If your final output is DVD compliant MPEG2 , you can use around 8-9Mbps video upon export or your final encode. You can use different formats, different bitrates on the same timeline. You might get "red render bar" on those sections that don't match your DV-AVI timeline, but you are rendering those sections anyway, so it doesn't make a difference. In fact , since you are not exporting DV-AVI, you have to render the whole project anyway!
    Quote Quote  
  11. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    poisondeathray,

    Thanks again for your time. I should have asked last time about MPEG resizing outside of Premiere. I'll definitely look into the links you provided.

    For the last part, I was talking about multi-angle DVD authoring and not the editing phase. I thought there was some sort of bitrate matching as well as other steps on the final DVD-Ready MPG files to make them viable for a multi angle dvd. I could of course be wrong about that . This was an abandoned concept, however, as I would prefer to just have everything in a single video stream once I tame the mpg angle.
    Quote Quote  
  12. OK, I know almost nothing about multi-angle DVD authoring, so disregard anything I said if it has to do with that.

    But I am very familar with PPCS4 quirks and workarounds. Those links above deal with HD=>SD , but just to show you a DV-AVI example, I resized 4:3 NTSC DV to 640x480 (1:1) using 1) avisynth, 2) Adobe (frame blend on) 3) Adobe (frame blend off). The zip file is attached below .

    Everything was done losslessly, even .png compression. If you notice the difference is quite dramatic. Remember this is before MPEG2 compression.

    The slight difference in AR is due to Rec. ITU-R BT.601 vs. MPEG4 Specification , vs. Generic or "math" specifications. Avisynth uses generic specifications, I think Adobe uses BT.601 . This is an entirely other big topic... but anyway...

    The key concept here is interlace resizing requires deinterlace=>resize=>reinterlace

    Most NLE's use very soft resizing algorithms (like bilinear), and very poor quality deinterlace algorithms. Either they blur (blend), or leave jaggies.

    The fact is Adobe's Mainconcept MPEG2 encoder isn't that bad. It's Premiere's resizing and deinterlacing algorithm that is bad.

    adobe%20resizing%20comparison.zip
    Quote Quote  
  13. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    thanks again!

    avisynth has always intimidated me, so I think I'll give it a shot resizing in vdub using one of it's "smart" resizers or another filter that will give me good results. Unfortunately I have to start with MPEG but I won't compress to MPEG (or any other lossy format) again until the final render before authoring.

    This should work just fine as I don't need it to grow/shrink in the editor, I have the DV angle shrink down to about 60% and then the MPG video fades into the (now blank) corner. Then I fade out the MPG and grow the DV back to 100%.
    Quote Quote  
  14. Are you doing a keyframe resize? like gradual shrink / grow transition? or is the transition only the opacity? If the former, then it would be more difficult to do with avisynth

    Is your MPEG2 interlaced? If not, there is no special treatment, you can use a straight resize. You will still get better results using avisynth, because of sharper resizing algorithms

    Avisynth > than vdub for this. Vdub's bundled deinterlacers are quite low in qualilty as well. Remember interlaced resizing requires bob-deinterlacing=> resizing => re-interlacing. If you don't do it in this order, you will get a big mess of artifacts
    Quote Quote  
  15. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    for the MPG I am only doing opacity keyframes, so a static 50% size is fine. The shrink/grow keyframe is hapening to the DV footage only and is working quite well. The DV video sort of "retracts" to the bottom right corner as the (formerly) MPG video will simply fade in/out. I'm assuming since it's 50% of the project resolution the rest of the frame will be transparent, allowing the layer below to still be visible.

    The MPEG2 is interlaced. It came directly from a camcorder of unknown make/model. It was an HD camcorder that records to HDD, but the guy set it to record in SD mode. The resulting MPG file was copied directly off his Camcorder to my laptop for later editing. I'm quite sure it's a "go straight to dvd, do not pass go, do not collect $200" file

    OK, I'll bite the bullet and give avisynth a try. I'm not a stranger to programming or command line applications, and I'm sure it's just a couple lines to do what I need to do. I'll do a little reading on avisynth as I'm sure the answer is readily available here.

    edit: boy, people sure like to argue about who's script is better :P
    Quote Quote  
  16. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    ok so just to confirm my workflow..I would

    1) use DGIndex to index my MPG and generate the needed ".d2v" file (I do not care about the audio)

    2) use avisynth (with appropriate plugins/filters) make a script (.avs) like

    LoadPlugin("...\DGDecode.dll")
    MPEG2Source("stupidTroublesomeVideo.d2v")
    <deinterlacer filter>(parameters)
    LanczosResize(320,240)
    <interlacer filter>(parameters)

    3) Use Premiere avisynth import filter to import the .avs file.
    4) Re-do my edits on the newly imported file

    what deinterlace/interlace filters do you recommend?
    Quote Quote  
  17. Depending on how "bad" your MPEG2 footage is, you might want to clean it up a bit too

    The deinterlace filter has to been in bob mode, with the correct field order.

    You can use NNEDI2 alone or yadifmod+NNEDI2. If you have a bit noisy footage, TempGaussMC_Beta1() is really good at getting rid of jaggies, but denoises a bit. There are some examples and syntax of using yadifmod + NNEDI2 in that thread link above. In that specific example, there was a field order swap as well (conforming everything to BFF, like DV) , you might not have to (or want to) do that

    You don't have to use the .avs import plugin, you could encode it to a lossless intermediate as another option. Just a reminder when you use the .avs import plugin, you often have to interpret the footage AR in the clip bin in PP.
    Quote Quote  
  18. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    ok, the video source isn't noisy at all so I'll just incorporate the NNEDI2 syntax in there for the deinterlace. I read that it was used for upsampling so I didn't know if I should use it for "shrinking" the video . For the deinterlace I suppose that's what the "Seperate Fields" and "Set Every" is for..and the parameters just somehow show that you are using BFF or TFF?
    Quote Quote  
  19. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    let's have another stab at it using the script from your link and other links/learnings I found along the way [comments in brackets]:

    If MPG is TFF
    Code:
    AssumeTFF()
    interp=NNEDI2(field=3)
    YadifMod(order=1, field=-1, mode=1, edeint=interp)
    Spline36Resize(320,240) [Is this better than LanczosResize?]
    SeparateFields()
    SelectEvery(4,0,3) [I don't understand what this is doing]
    Weave() [stick and move, mac, stick and move]

    AssumeTFF() [If TFF Source, use these 2 lines to change to BFF?]
    JDL_ReverseFieldDominance(bobfirstlast=true)


    If MPG is BFF
    Code:

    AssumeBFF()
    interp=NNEDI2(field=3) [Which field for BFF?]
    yadifmod(order=0, field=-1, mode=0, edeint=interp)
    Spline36Resize(320,240)
    SeparateFields()
    SelectEvery(4,0,3) [do the params need changing for BFF?]
    Weave()


    yes I'd prefer outputting to uncompressed .avi then importing into premiere, I just saw how to do that via vdub.
    Quote Quote  
  20. spline36 produces less ringing than lanczos, but the difference is very very small. You won't notice the difference 99.9999% of the time

    It depends on what you Assume for field order, and what you want it to become. You can use use SelectEvery(4,1,2) to change the order; there is more info here
    http://forum.doom9.org/showthread.php?t=135690

    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -> TFF
    AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -> BFF
    AssumeTFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -> BFF
    AssumeBFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -> TFF

    Yadifmod has to be mode=1 in either case for bob, order=0 means BFF, order=1 means TFF

    NNEDI2(field=3) is bob mode, but TFF
    NNEDI2(field=2) is bob mode, but BFF

    NNEDI2 when used with yadifmod has to match both the rate and the field order


    So for TFF, ending up with TFF:

    AssumeTFF()
    interp=NNEDI2(field=3)
    YadifMod(order=1, field=-1, mode=1, edeint=interp)
    Spline36Resize(320,240)
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()


    For BFF , ending up with BFF:

    AssumeBFF()
    interp=NNEDI2(field=2)
    yadifmod(order=0, field=-1, mode=1, edeint=interp)
    Spline36Resize(320,240)
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Quote Quote  
  21. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    I hereby declare this day poisondeathray day in my house!

    I just created the .d2v file and I'm off to learn the wonders of avisynth. The file is TFF and the rest of the video in my sequence is BFF, so after your TFF block of code should I use the ReverseFieldDominance line as well? Is this a necessary step? I would imagine all the video's in my editor should ideally have the same field order...
    Quote Quote  
  22. No you don't need that. This is much simpler: If the MPEG2 file is TFF to begin with , just use SelectEvery(4,1,2) instead and you will end up with a BFF file, ie.

    AssumeTFF()
    interp=NNEDI2(field=3)
    YadifMod(order=1, field=-1, mode=1, edeint=interp)
    Spline36Resize(320,240)
    SeparateFields()
    SelectEvery(4,1,2)
    Weave()
    Quote Quote  
  23. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    cool thanks..I'm also assuming I need to have a LoadPlugin()
    for each of the 3 .dlls (DGDecode.dll, yadifmod.dll,nnedi2.dll)?
    Quote Quote  
  24. They are autoloading .dll's if put in the avisynth/plugins directory , except yadifmod , which must be loaded manually
    Quote Quote  
  25. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    you are quick! OK I hope this is the end of my 101 questions!

    oooh I spoke too soon..I am a filthy, filthy liar.

    Just real quick..when I import my script into virtualdub I notice the video in the output window is darker than the video in the input. I could fix with the brightness/contrast filter, but just wondering what might have caused that to happen. Is there some sort of colorspace conversion? I know in the DGIndex there was a setting that said something like YUV -> RGB and it was set to PC Scale..perhaps that's the culprit..

    we're processing away at a blistering 3.89fps!
    Quote Quote  
  26. If you are doing all this filtering in avisynth, and using vdub in video=>fast recompress mode (only using it for encoding, no internal vdub filtering) , there is no colorspace conversion or levels shift with those filters. Everything stays in the original colorspace

    IIRC , the appearance has to do with the graphics card and video overlay and the way vdub handles the display. The underlying levels are not altered . However, if you do use an internal filter and full processing mode, there is a YUV=>RGB conversion , then you need to decide what matrix you are using. If you don't specify the conversion in avisynth, vdub will assume rec.601 (I think) , this means that it will clamp to 16-235. The levels may change then; for example, DV footage commonly has highlights >235

    Kind of related, but a bit off topic, but another quirk of PP , is that it too clamps all non native YUV formats , except uncompressed (i.e. those that it doesn't have a preset for). So even if you have a lagarith or huffyuv lossless intermediate (either YUY2, YV12, or RGB) - to PP it's *not quite* lossless. e.g. if you have overshoots >235 , it will clamp to 235 and you will lose them (although 99.9999% of the time it will be not noticeable). The only formats that it doesn't do this to are v210 (uncompressed 10-bit) , and the native formats it has presets for.
    Quote Quote  
  27. Member
    Join Date
    Oct 2004
    Location
    United States
    Search PM
    More great info!

    I processed the first video overnight and it looks great!
    I'm going to go back and run the script again at 75% (540,360)..now that I know I can get the video looking good I might make it the dominant view while the 2 streams are shown together .
    Quote Quote  



Similar Threads

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