VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 43
  1. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Hi all,

    I very recently started experimenting with cleaning up video, as I'm more into the audio side of things. I'm utterly confused about how to successfully "fix" some footage, due to the issue of when it should/shouldn't be compressed, as well as how to deal with the problem.

    1. I took a clip from a DVD I own, using DVD Shrink, making sure that no compression was applied. If there's a more ideal method please let me know. Now, if I understand correctly this means that I took MPEG-2 footage that was compressed in order to fit into a VOB...? If so, then fine... I now have a M2V. So, I have a video clip that was already compressed but was extracted with no compression applied.

    2. There are some filters in VDub that I would like to use on this footage. However, VDub requires that a file be in AVI format before it can accept it as its input. This would mean that I have to compress footage that was already compressed just for the sake of having VDub accept it. Therefore image quality has become compromised.

    3. I now have an AVI as the result of running some filters on this footage. Now, it's time to import the AVI into Photoshop for some further cleaning that I'd like to do.

    4. I clean up the video, then export it, compressing it yet again. The picture quality is becoming noticeably worse.

    5. I take the resulting AVI and convert it back to a M2V for authoring. Of course during the authoring process the M2V will be compressed again in order to fit into a VOB, correct?

    I'm sorry for the confusing steps I outlined that most likely left you scratching your heads. I suppose the main point I'm trying to make is that I'd like to apply some filters found in VDub, as well as some tools found in Photoshop in order to work on this footage. My obvious dilemma is that I don't understand how to handle the compression issue. I'd like to use the VDub filters and the tools found in Photoshop with as little compression as possible, in order to preserve the image's integrity as much as possible.

    You guys are the ones that know all about this stuff. Am I making it more difficult than it has to be? Am I overanalyzing/overlooking something? Please advise.

    Thanks so much for your help again,

    Justin
    Quote Quote  
  2. There is lossy and lossless compression

    As an analogy - lust like in the audio world, FLAC is lossless, MP3 is lossy

    Same in video, there are forms of lossless compression. They can undergo infinite generation without quality loss (in absence of colorspace changes)

    Examples of lossless compression in video world: lagarith, huffyuv, ut video codec.

    If you are going in/out of multiple programs, use either lossless compression or uncompressed to avoid additional generational compression losses (otherwise it would be similar to saving mp3 as mp3 again and again - it gets worse each generation as you throw out information)

    One option is to use avisynth to frameserve into vdub without using large intermediate files. This way you don't have to waste time encoding to some AVI intermediate, and you lose no extra quality

    You will find many filters in vdub , avisynth that are better suited for most types of video clean up compared to photoshop. Only if you are doing frame-by-frame edits, would photoshop play a larger role in most cases
    Quote Quote  
  3. VirtualDub can open MPG and VOB files directly if you have the MPEG 2 source plugin. But you won't want to do this unless you're dealing with black and white video because VirtualDub screws up the colors with YV12 sources.

    A better approach is to use DgIndex to build an index file of your VOB source then use AviSynth to open the video for VirtualDub. Create an AviSynth script (a plain text file with the extension .AVS) that looks like:

    Mpeg2Source("filename.d2v")
    where filename.d2v is the name of the index file created by DgIndex. Then open that AVS script in VirtualDub as if it was a video file. If your going to use this method you might as well have DgDecode perform deblocking. And if the video is interlaced, conversion to YUY2 so VirtualDub doesn't screw up the chroma channels:

    Mpeg2Source("filename.d2v", CPU=2, UpConv=1)
    CPU=2 enables deblocking of the luma channel (see the docs for other options), UpConv=1 converts from YV12 to YUY2.

    You can output from VirtualDub using an lossless codec like HuffYUV or Lagarith. Or, if your MPEG 2 encoder supports it, you can frameserve (pass video directly from one program to another) directly from VirtualDub to the encoder.
    Quote Quote  
  4. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Only if you are doing frame-by-frame edits, would photoshop play a larger role in most cases
    Hi,
    Thanks for your reply. After using the VDub filters I am going to do some frame by frame work in Photoshop
    Quote Quote  
  5. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    VirtualDub can open MPG and VOB files directly if you have the MPEG 2 source plugin. But you won't want to do this unless you're dealing with black and white video because VirtualDub screws up the colors with YV12 sources.

    A better approach is to use DgIndex to build an index file of your VOB source then use AviSynth to open the video for VirtualDub. Create an AviSynth script (a plain text file with the extension .AVS) that looks like:

    Mpeg2Source("filename.d2v")
    where filename.d2v is the name of the index file created by DgIndex. Then open that AVS script in VirtualDub as if it was a video file. If your going to use this method you might as well have DgDecode perform deblocking. And if the video is interlaced, conversion to YUY2 so VirtualDub doesn't screw up the chroma channels:

    Mpeg2Source("filename.d2v", CPU=2, UpConv=1)
    CPU=2 enables deblocking of the luma channel (see the docs for other options), UpConv=1 converts from YV12 to YUY2.

    You can output from VirtualDub using an lossless codec like HuffYUV or Lagarith. Or, if your MPEG 2 encoder supports it, you can frameserve (pass video directly from one program to another) directly from VirtualDub to the encoder.
    I like how this sounds, but here's an error message when attempting to use your suggestion:

    Avisynth open failure:Script error:There is no function named "Mpeg2Source"

    I should note that when it comes to Avisynth, I have no idea what I'm doing. Am I just missing a plug-in or such?
    Quote Quote  
  6. Copy DgDecode.dll (part of the DgMpgDec package) into the AviSynth plugins folder. That's the filter that has the Mpeg2Source() command. AviSynth automatically loads filters in its plugins folder.
    Quote Quote  
  7. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    Copy DgDecode.dll (part of the DgMpgDec package) into the AviSynth plugins folder. That's the filter that has the Mpeg2Source() command. AviSynth automatically loads filters in its plugins folder.
    Okay; got further, but here's the latest error: "Script error: the named argument "UpConv" to Mpeg2Source had the wrong type".
    Quote Quote  
  8. UpConv=1 should work. If you can't get it working for some reason use this instead:

    Mpeg2Source("filename.d2v", CPU=2)
    ConvertToYUY2(interlaced=true)
    AviSynth will do the conversion to YUY2 instead of DgDecode.
    Quote Quote  
  9. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Ugh. Here's the latest error: "MPEG2Source: couldn't open source file or obsolete D2V file". I don't know why it can't open it or why it'd be obsolete :/
    Quote Quote  
  10. did you move the file or change directory structure ?

    the .d2v file has to be in the same directory when you indexed it

    delete the old .d2v file and re-index the mpeg2 file
    Quote Quote  
  11. also is this a film source? is it interlaced or telecined dvd ? If it's telecined, you would inverse telecine to return the progressive frames - it's hard to work in photoshop on fields or combed frames (you should work on progressive frames)

    if you don't know what it is see this guide
    http://neuron2.net/faq.html#analysis
    Quote Quote  
  12. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    also is this a film source? is it interlaced or telecined dvd ? If it's telecined, you would inverse telecine to return the progressive frames - it's hard to work in photoshop on fields or combed frames (you should work on progressive frames)

    if you don't know what it is see this guide
    http://neuron2.net/faq.html#analysis
    I can't even get as far as the first example in that guide. It gives me the "couldn't open/obsolete" error.
    Here are some shots of the steps I've been taking. Maybe it'll help:
    Image
    [Attachment 4540 - Click to enlarge]

    Image
    [Attachment 4541 - Click to enlarge]

    Image
    [Attachment 4542 - Click to enlarge]

    Image
    [Attachment 4543 - Click to enlarge]

    Image
    [Attachment 4544 - Click to enlarge]

    Image
    [Attachment 4545 - Click to enlarge]

    Image
    [Attachment 4546 - Click to enlarge]
    Quote Quote  
  13. Maybe you have some version problem? Did you just recently install AviSynth and DgMpgDec? Or was some of it installed long ago?
    Quote Quote  
  14. make sure the dgdecode.dll matches the same one from the zip file you used for dgindex

    this is from the author regarding that error message:

    The possible causes are:

    1. The D2V file is empty.

    2. You moved or deleted one or more of the source files after making the D2V file.

    3. You are picking up a wrong version of DGDecode, possibly from your plugins directory. Search your hard disk for all copies of DGDecode.dll and delete or rename all of them except the newest one that matches DGIndex.

    4. Your input stream does not contain a sequence header. Make sure that the first MPEG1 file can be opened in VirtualDub.
    Quote Quote  
  15. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    Maybe you have some version problem?
    Seems likely - the upconv parameter changed from bool to int at version 1.4.1
    Quote Quote  
  16. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Whew. Okay. Eureka! Both the scripts that jagabo and poisondeathray provided are working now. I read that guide and used the script it provided to test out my video. According to the site's description, it's "3:2 pulled-down progressive video". As I stepped through a hectic scene the frames did move in a 1-1-1, 2-2, 3-3-3, 4-4 manner. I also tested the field order and it's top-field first. I did the testing that the site provided and TFF looked correct; BFF jumped back and forth like the site said it would.
    I'm sorry but I lost my train of thought (big surprise) ... now that I know the type of video and field order, what would be the best way to go about using the VDub filters and the frame by frame work in Photoshop?
    Quote Quote  
  17. Get TIVTC package and unzip the dll to the plugins directory . As usual it comes with full documentation

    http://www.missouri.edu/~kes25c/
    http://avisynth.org/mediawiki/TIVTC

    MPEG2Source()
    AssumeTFF()
    TFM()
    TDecimate()

    This will inverse telecine , and give you 23.976 progressive fps (actually 24000/1001)
    Quote Quote  
  18. If DgIndex showed your source to be FILM you can use its Video -> Field Operation -> Forced Film setting. That will give you 23.976 fps film frames right out of Mpeg2Source().

    If it shows as interlaced but you find the 3:2 field repeat pattern you should use Video -> Field Operation -> Honor Pulldown Flags. Then add TFM().TDecimate() to the Avs script:

    Mpeg2Source("filename.d2v", CPU=2)
    AssumeTFF() #if your video is top field first, BFF is the default
    TFM()
    TDecimate()
    That will restore the 23.976 fps progressive film frames from the hard pulldown source. You'll need to get the TIVTC filter package and install it in AviSynth's plugins folder:

    http://avisynth.org/mediawiki/TIVTC/TFM

    If all fields are different you have interlaced Video and you use this script:

    Mpeg2Source("filename.d2v", CPU=2, UpConv=1)
    and handle the video as interlaced in VirtualDub.

    Now that you have a script and can open it in VirtualDub...

    Use the Histogram filter in AviSynth first to check your source for illegal brightness values.

    Mpeg2Source(...)
    Histogram()
    Open that in VirtualDub, it will show you a waveform monitor graph of the source:

    http://avisynth.org/mediawiki/Histogram

    Scrub through your video make sure you don't have lots of peaks and troughs in the tan areas of the graph. Assuming there aren't any, you are free to start adjusting things in VirtualDub. If there are you should make some adjustments in the AviSynth script before using it in VirtualDub. We'll discuss that later if you run into it.

    By the way, you might find Widows Explorer easier to deal with if you disable the "Hide extensions for known file types" option. Given the way Windows works it makes no sense to hide them.
    Last edited by jagabo; 3rd Dec 2010 at 22:00.
    Quote Quote  
  19. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Thanks guys; just wanted to stop by and see what your replies were; still groggy so I won't understand 'til I have some caffeine in me. I'll check everything out and report back. Thanks again
    Quote Quote  
  20. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Get TIVTC package and unzip the dll to the plugins directory . As usual it comes with full documentation

    http://www.missouri.edu/~kes25c/
    http://avisynth.org/mediawiki/TIVTC

    MPEG2Source()
    AssumeTFF()
    TFM()
    TDecimate()

    This will inverse telecine , and give you 23.976 progressive fps (actually 24000/1001)
    Okay. Done. The fps has been restored to 23.976.
    Quote Quote  
  21. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    If DgIndex showed your source to be FILM you can use its Video -> Field Operation -> Forced Film setting. That will give you 23.976 fps film frames right out of Mpeg2Source().

    If it shows as interlaced but you find the 3:2 field repeat pattern you should use Video -> Field Operation -> Honor Pulldown Flags. Then add TFM().TDecimate() to the Avs script: < It does show this >

    Mpeg2Source("filename.d2v", CPU=2)
    AssumeTFF() #if your video is top field first, BFF is the default < Therefore, be sure to specify TFF? Since my video is top field first? >
    TFM()
    TDecimate()
    That will restore the 23.976 fps progressive film frames from the hard pulldown source. You'll need to get the TIVTC filter package and install it in AviSynth's plugins folder:

    http://avisynth.org/mediawiki/TIVTC/TFM

    If all fields are different you have interlaced Video and you use this script: < Not sure what you mean by all fields being different...? >

    Mpeg2Source("filename.d2v", CPU=2, UpConv=1)
    and handle the video as interlaced in VirtualDub.

    Now that you have a script and can open it in VirtualDub...

    Use the Histogram filter in AviSynth first to check your source for illegal brightness values.

    Mpeg2Source(...)
    Histogram()
    Open that in VirtualDub, it will show you a waveform monitor graph of the source:

    http://avisynth.org/mediawiki/Histogram

    Scrub through your video make sure you don't have lots of peaks and troughs in the tan areas of the graph. Assuming there aren't any, you are free to start adjusting things in VirtualDub. If there are you should make some adjustments in the AviSynth script before using it in VirtualDub. We'll discuss that later if you run into it.

    By the way, you might find Widows Explorer easier to deal with if you disable the "Hide extensions for known file types" option. Given the way Windows works it makes no sense to hide them.
    Confusion again: I've tried each example method you guys have provided and they all seem to show the same results. I'm not sure which is a straight answer < I don't mean to sound like an assh*le, but I don't know how else to word that. From the tests I did before I found out that the video is 3:2 pulled progressive, top field first. So that's all I need to know how to deal with. I'm sorry as I again notice how arrogant I sound. I'm just trying to sort of "weed out" the confusion and stick to what I know only needs to be applied to a 3:2 p-down progressive, TFF video.
    Quote Quote  
  22. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Also, not as if you need more to deal with, but why does the video look so awful in VDub? That is, it's nice that it's no longer showing interlacing, but the image quality looks like its been through hell...?
    Quote Quote  
  23. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    BTW, I checked the histogram and there are a few brief moments of "non-valid CCIR-601 ranges". However, like you said, I shouldn't even get into that yet.
    Quote Quote  
  24. Originally Posted by takearushfan View Post
    Also, not as if you need more to deal with, but why does the video look so awful in VDub? That is, it's nice that it's no longer showing interlacing, but the image quality looks like its been through hell...?
    It shouldn't look too much different than playing with a media player. What exactly is wrong with it?
    Quote Quote  
  25. Originally Posted by takearushfan View Post
    From the tests I did before I found out that the video is 3:2 pulled progressive, top field first. So that's all I need to know how to deal with. I'm sorry as I again notice how arrogant I sound. I'm just trying to sort of "weed out" the confusion and stick to what I know only needs to be applied to a 3:2 p-down progressive, TFF video.
    Open the VOBs in DGIndex and run the Preview. In the information screen on the right if it says Film and Progressive, you can set the Field Operation to Forced Film and get a D2V that's already 23.976fps with no need to apply the IVTC. If the Preview says NTSC and Interlaced and you've also confirmed it's hard pulldown, then you use Honor Pulldown Flags and apply IVTC in the script. If you can use Forced Film, it's more 'guaranteed' than is any IVTC, and will encode faster also.
    Quote Quote  
  26. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by manono View Post
    Originally Posted by takearushfan View Post
    From the tests I did before I found out that the video is 3:2 pulled progressive, top field first. So that's all I need to know how to deal with. I'm sorry as I again notice how arrogant I sound. I'm just trying to sort of "weed out" the confusion and stick to what I know only needs to be applied to a 3:2 p-down progressive, TFF video.
    Open the VOBs in DGIndex and run the Preview. In the information screen on the right if it says Film and Progressive, you can set the Field Operation to Forced Film and get a D2V that's already 23.976fps with no need to apply the IVTC. If the Preview says NTSC and Interlaced and you've also confirmed it's hard pulldown, then you use Honor Pulldown Flags and apply IVTC in the script. If you can use Forced Film, it's more 'guaranteed' than is any IVTC, and will encode faster also.
    It says NTSC, Interlaced and Top Field Order and yep, I ran the script to confirm that it's 3:2 pulldown. So, use the "Honor Pulldown Flags", which is enabled by default (when I run it anyhow) and apply the IVTC? I think you already answered my question in your post; just making sure
    Quote Quote  
  27. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by takearushfan View Post
    Also, not as if you need more to deal with, but why does the video look so awful in VDub? That is, it's nice that it's no longer showing interlacing, but the image quality looks like its been through hell...?
    It shouldn't look too much different than playing with a media player. What exactly is wrong with it?
    Well, it looks fine at times but bad at others. To be fair, for the most part it looks fine. Though there are some times, mainly during a shot with little movement where it has a sort of "low-res" look to it, as if the colors aren't blending smoothly. I could provide a screenshot if you want...?
    Quote Quote  
  28. It says NTSC, Interlaced and Top Field Order and yep, I ran the script to confirm that it's 3:2 pulldown. So, use the "Honor Pulldown Flags", which is enabled by default (when I run it anyhow) and apply the IVTC? I think you already answered my question in your post; just making sure
    yes , you're doing it correctly

    Well, it looks fine at times but bad at others. To be fair, for the most part it looks fine. Though there are some times, mainly during a shot with little movement where it has a sort of "low-res" look to it, as if the colors aren't blending smoothly. I could provide a screenshot if you want...?
    post something to illustrate

    are you saying it's different in a media player than using a script in vdub ?
    Quote Quote  
  29. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Yes, it looks clean in any media player, until I apply a script. However, for some reason this latest work that's the result of your guys' help isn't nearly as bad as it used to be. The difference still is there though. I'll post a shot when my damn antivirus is done bogging down my computer.
    Thanks
    Quote Quote  
  30. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Hi there. This is odd. The playback quality seems to be sporadic. I mentioned in my last post about how it didn't look too bad, but you could still see a hint of what I was referring to. However, when I played it this time around it looked very bad. I've attached a sample shot.Image
    [Attachment 4558 - Click to enlarge]
    Quote Quote  



Similar Threads

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