VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 24 of 24
Thread
  1. I'm trying to export long sequences of frames from a DVD, and I want to preserve every single tiny pixel present in the original DVD's files. Here's the method I'm using -- could I please get a critique?

    1) rip the DVD's .VOB to my computer. (I had been using MacTheRipper, but want to switch to a PC-based program. What's the current "best" ripping software, that copies .VOBs exactly without any quality or info loss?)

    2) Index the .VOB with DGIndex. Select IEEE-1080 for the iDCT algorithm, select Force Film, and disable the audio. Generate a .d2v file.

    3) Write a short AviSynth script pointing to the .d2v using MPEG2Source, and open the script in VirtualDub.

    4) Scrub through the footage in VirtualDub, determine the frame numbers of the sequence I want to export, and modify my AviSynth script using Trim.

    5) Run the script again; I should now see just the scene I want to export all the frames of.

    6) in VirtualDub, select "Export Image Sequence", and select lossless .tif files. Run it, and generate frames!


    Is this correct? Did I do anything along the way that degrades the quality of the DVD's image? Is there a better way to do this?

    Thank you!!
    Quote Quote  
  2. you can directly drag and drop the VOB file to virtualdub .. use [Mark in] [Mark out] to indicate the sequence ..

    Last edited by sekininsha; 23rd Mar 2020 at 19:02.
    責任者
    Quote Quote  
  3. You cannot really export YV12 frames from a DVD to RGB images losslessly. There will always be a lossy YUV to RGB conversion and lossy 4:2:0 to 4:4:4 chroma upscaling.
    Quote Quote  
  4. Originally Posted by bentley View Post
    6) in VirtualDub, select "Export Image Sequence", and select lossless .tif files. Run it, and generate frames!


    tiff supports YUV and subsamping (eg. ffmpeg can export YUV image sequence) , but vdub's image sequence is RGB

    Code:
    ffmpeg -h encoder=tiff
    
        Supported pixel formats: rgb24 rgb48le pal8 rgba rgba64le gray ya8 gray16le
    ya16le monob monow yuv420p yuv422p yuv440p yuv444p yuv410p yuv411p

    But it depends on how you are using the image sequence, and what programs you are using

    Most programs do not support YUV tiff, and will convert to RGB . And that YUV=>RGB is usually not lossless for a number of reasons. (it can be lossless, if conversion is done in float, and the recieving program can work in float)

    It's usually better to use YUV video instead of image sequence, because there is a higher chance it will be handled properly
    Quote Quote  
  5. Thank you all, this is very helpful!

    From what you're saying, the step that causes the quality loss is using VirtualDub as the frame exporter. It *is* possible to export the frames losslessly as YV12 .tifs, but I need to use another method. Is that correct?

    Poisondeathray, you mentioned using ffmpeg to export the frames as YV12 .tifs. Would you mind showing me an example script to do that? I'm still very new to AviSynth.
    Quote Quote  
  6. Originally Posted by bentley View Post
    From what you're saying, the step that causes the quality loss is using VirtualDub as the frame exporter. It *is* possible to export the frames losslessly as YV12 .tifs, but I need to use another method. Is that correct?

    Poisondeathray, you mentioned using ffmpeg to export the frames as YV12 .tifs. Would you mind showing me an example script to do that? I'm still very new to AviSynth.
    Yes, you need another method

    BUT - WHY are you doing this ? How are you going to use it ?

    The compatibility issue is important. Don't expect to open the tiff in any random program. ffmpeg can read the image sequence as YV12, but most programs cannot

    What is the background information ? There are probably better/ smarter ways to go about this

    eg. ffmpeg
    If the script output is YV12, the tiff sequence will be YV12
    Code:
    ffmpeg -i input.avs -start_number 0 output_%06d.tiff
    Quote Quote  
  7. Wow, very quick response, thank you!

    In that example script, "input.avs" should become my AviSynth script, correct? Do I need to modify anything else in your example? (And if I've already used Trim to specify my start and end frames, i should leave the "-start_number" as 0, yes?)


    Background info: I plan to heavily rearrange the .tifs (delete some, duplicate some, change the order of some, etc etc all kinds of stuff), then use them as the individual frames of a new movie.

    I don't want to lose any image or color detail, because my next step is to upscale this new movie using Topaz Video Enhance AI. I want that upscaler to have as much unaltered image data as possible to work with.

    (I'm testing the upscaling software on various weird situations, which is why I need the freedom to rearrange the frames willy-nilly. And why I'm not just using AviSynth to, say, slow down scenes or reverse scenes or whatnot. I'm sure it sounds odd, but it makes sense in my head.)

    Next step: I need to find an image viewer that will open VY12 .tifs, I guess!
    Quote Quote  
  8. Originally Posted by bentley View Post
    In that example script, "input.avs" should become my AviSynth script, correct? Do I need to modify anything else in your example? (And if I've already used Trim to specify my start and end frames, i should leave the "-start_number" as 0, yes?)

    If you want the frame numbers to start with a different number, then enter that number


    Background info: I plan to heavily rearrange the .tifs (delete some, duplicate some, change the order of some, etc etc all kinds of stuff), then use them as the individual frames of a new movie.
    Why don't you do it in avisynth ?

    or a video editor ?

    I don't want to lose any image or color detail, because my next step is to upscale this new movie using Topaz Video Enhance AI. I want that upscaler to have as much unaltered image data as possible to work with.
    Topaz only works with RGB .

    (I'm testing the upscaling software on various weird situations, which is why I need the freedom to rearrange the frames willy-nilly. And why I'm not just using AviSynth to, say, slow down scenes or reverse scenes or whatnot. I'm sure it sounds odd, but it makes sense in my head.)
    You can use avisynth to rearrange the frames , or slow down scenes, or whatever too ...

    But you're going to have to convert to RGB at some point if the goal is to use Topaz

    EDIT: actually the video version (Video Enhance AI) can accept YUV video directly (you don't need image sequence) . Only the original GigaPixel AI requires images (and that has to be RGB)
    Last edited by poisondeathray; 23rd Mar 2020 at 15:31.
    Quote Quote  
  9. Thanks, poisondeathray!

    I did a little reading of these forums before I posted. I've seen lots of threads where a new member asks about a project, and longtime members ask followup questions and explain that there's a better/simpler way to achieve the goal. The newbie sometimes sputters "but but my way, but I wannnna", the longtime members roll their eyes, and the thread dies. I don't want to be that guy.

    But here I go anyway! Why export & rearrange the frames? Because I'm not very good/practiced at AviSynth or non-linear editing...because I'm sheltering-in-place and I think it will be fun...and because I wannnnna.

    EDIT: actually the video version (Video Enhance AI) can accept YUV video directly (you don't need image sequence) . Only the original GigaPixel AI requires images (and that has to be RGB)
    This is good to know, thanks! I had read somewhere that Video Enhance could accept "DVD formats" but they didn't specify YUV.


    Setting aside all this chat about frame exporting -- what would you say is the "best" (most lossless) way to prep a DVD's files for upscaling using Video Enhance AI?
    Quote Quote  
  10. Originally Posted by bentley View Post
    EDIT: actually the video version (Video Enhance AI) can accept YUV video directly (you don't need image sequence) . Only the original GigaPixel AI requires images (and that has to be RGB)
    This is good to know, thanks! I had read somewhere that Video Enhance could accept "DVD formats" but they didn't specify YUV.

    Setting aside all this chat about frame exporting -- what would you say is the "best" (most lossless) way to prep a DVD's files for upscaling using Video Enhance AI?


    DVD can only be YUV (all DVD's are YUV)

    But it also depends on what your DVD video is specifically. eg. is it interlaced ?

    Interlace is going to be a problem, and if it has pulldown you probably want to remove the pulldown

    (Basically , the upscaling is only going to work ideally with progressive video)

    Video Enhance AI can actually import a VOB or mpg directly .

    But you might want to prepare the video . Some DVD's might need cropping, some might need IVTC, etc... Maybe you want to prefilter. AI upscalers tend to do poorly with noise .
    Quote Quote  
  11. For the purposes of this hypothetical, let's assume that the DVD reads as 100% film in DGIndex (and I select "Force Film" anyway), so interlacing wouldn't be a worry.

    In that case, Video Enhance's biggest hurdle would be noise? So I'd want to run some sort of AviSynth smoothing/denoising filter first? How would you recommend doing that, while maintaining as much image detail as possible for upscaling?

    Thanks again for these quick and informative replies, by the way. This is all very helpful!
    Quote Quote  
  12. Just try a small test and look for problems.

    I don' t know how "clean" your DVD is or what needs to be done

    Video Enhance is not as "strong" as other "AI" methods, but it's more stable temporally - it's more suitable for general use video. Other single image based "AI" methods - including Gigapixel - tend to give more extreme results, and are more prone to problems with noise . Temporally, the results tend to flicker and are not as stable for video

    But noise is a problem in all "AI" (I'm using that term loosely; it's more neural network predictive technique) upscaling techniques, because the noise is upscaled. It can impair the results considerably. Besides weird artifacts, that's the most common complaint
    Quote Quote  
  13. Okay, so results will vary from DVD to DVD depending on the footage -- there's no all-purpose Best Setting and I'll need to experiment. Makes sense.

    Back to exporting frames: so I write an avs script pointing to the indexed .d2v file, I use Trim to indicate the frames I want, then I use ffmpeg (using your example format) to export them as tifs, correct? They'll automatically export as YV12, since that's how the frames are on the .VOB?

    What software do I use to run this avs script? Should I open it in VirtualDub as before, and frames will just start appearing in a folder somewhere? Should I use a different program?

    Also, can you recommend an image-viewing program that will open these YV12 tifs?
    Quote Quote  
  14. Originally Posted by bentley View Post
    Back to exporting frames: so I write an avs script pointing to the indexed .d2v file, I use Trim to indicate the frames I want, then I use ffmpeg (using your example format) to export them as tifs, correct? They'll automatically export as YV12, since that's how the frames are on the .VOB?
    There is no reason to use an image sequence in this scenario. You gain nothing except a lot of headache. Usually there are various pros/cons to doing something. Here it's all "cons". zero "pros"

    What software do I use to run this avs script? Should I open it in VirtualDub as before, and frames will just start appearing in a folder somewhere? Should I use a different program?
    That command with ffmpeg will run the script an output the tiffs . But there is no reason to do it this way


    Also, can you recommend an image-viewing program that will open these YV12 tifs?
    You can view them with ffplay, mpchc, basically most things that are ffmpeg based

    But there is no reason to use YV12 tiff's here

    And they get converted to RGB when you , the human, "see" something on a monitor anyways. Your display works in RGB. When you see something in say, ffplay's viewer, it's an RGB converted representation of the original YV12 data. You're not viewing the original data directly

    I think you're better off using the original format, which is MPEG2. (Every dvd is MPEG2 4:2:0). That's the original data, original compression too
    Last edited by poisondeathray; 23rd Mar 2020 at 19:02.
    Quote Quote  
  15. And I'm rather surprised that Video Enhance actually accepts a YV12 tiff sequence... but it does
    Quote Quote  
  16. Ah! So ffmpeg isn't a plugin, it's a piece of software like VirtualDub that can run AviSynth scripts. Thank you, clearly I was confused about that!

    I feel like I'm approaching "that guy"/"but I wannna" territory, so I won't keep pressing this issue. Mainly I'm simply not confident in my ability to edit the footage properly in AviSynth or a NLE, and feel like it would be "easier"/less frustrating to just rearrange all the frames manually.

    I think you're better off using the original format, which is MPEG2. (Every dvd is MPEG2 4:2:0). That's the original data, original compression too
    Can you elaborate on this? What exactly would you do? Maintaining the original data is one of my goals for sure.
    Quote Quote  
  17. Originally Posted by bentley View Post
    Ah! So ffmpeg isn't a plugin, it's a piece of software like VirtualDub that can run AviSynth scripts. Thank you, clearly I was confused about that!
    ffmpeg.exe is a standalone commandline binary, but the commonly distributed windows binaries are usually compiled with avisynth support.


    I feel like I'm approaching "that guy"/"but I wannna" territory, so I won't keep pressing this issue. Mainly I'm simply not confident in my ability to edit the footage properly in AviSynth or a NLE, and feel like it would be "easier"/less frustrating to just rearrange all the frames manually.

    But how are you going to re-arrange them manually ? What is your process? Are you going to rename individual image files one by one ? Anything other than something very simple is going to be tedious

    For most people, having it all laid out in a NLE is going to be waaaayyyyy easier (!) That's what is there for. You can "see" what you're doing


    I think you're better off using the original format, which is MPEG2. (Every dvd is MPEG2 4:2:0). That's the original data, original compression too
    Can you elaborate on this? What exactly would you do? Maintaining the original data is one of my goals for sure.

    I mean you can open the vob or mpeg2 directly in Video Enhance. But if your goal was individual images that you can reorder manually, it won't make a difference.

    The point about the original compression is you can never get it back. "Lossless" means decoded from MPEG2 to uncompressed data. That will be the same. But it will be much larger in filesize than the original MPEG2 compressed frames. If you use lossless compression it will still be much larger. But it doesn't matter really, because your goal is to upscale and you have to re-encode anyways.

    If it was me, I would do the edits in an actual editor (or avisynth if the edits were simple), and prefilter too . You can export a lossless YV12 video, such as using ut video codec, and it will accept that too.



    Have you tried this yet ? I think you will not be impressed. You almost always have to do some massaging to get decent results. Don't concentrate so much on the "original data" in this scenario - you almost always have to denoise or alter it to get better results from a DVD source. The fact is DVD's are rarely very clean. The "original data" includes all the noise artifacts which get enhanced. Just try it on a short segment.

    The problem with this approach is the training uses a bunch of generic sources. The results are not as good as if you trained on specific sources related to your specific input video
    Quote Quote  
  18. ffmpeg.exe is a standalone commandline binary
    Hmm! Never used those before (I'm a Mac guy normally), but I know how to open the command line window, so that's something.

    What is your process? Are you going to rename individual image files one by one ? Anything other than something very simple is going to be tedious
    That was my plan, yeah. I mean, I was planning on 5-second test clips, 120 frames, not tens of thousands of tifs. And I don't mind tedium. But I wouldn't worry so much about this at this point. I may take your advice and learn a NLE instead.

    You make a good point that I'm going to have to change to RGB at some point anyway, even if it's my monitor doing the work at the very end.

    Speaking of... I took another look at DGIndex's settings, and under the Video menu I saw this:

    YUV -> RGB: PC Scale / TV Scale

    I have to select one of those two; I can't say "neither." Does this mean that DGIndex is changing the colorspace from YUV to RGB as it indexes the VOB?
    Quote Quote  
  19. Originally Posted by bentley View Post


    Speaking of... I took another look at DGIndex's settings, and under the Video menu I saw this:

    YUV -> RGB: PC Scale / TV Scale

    I have to select one of those two; I can't say "neither." Does this mean that DGIndex is changing the colorspace from YUV to RGB as it indexes the VOB?

    No, it tells you in in the manual

    It's just for (a) the preview , and (b) vfapi frameserving

    It does not affect the YUV data in avisynth

    You want PC scale, because a computer monitor typically works 0-255 RGB
    Quote Quote  
  20. Thanks. In that case, where in this process of "rip DVD -> denoise/smooth/whatever -> import into upscaler -> save result" would you suggest switching from YUV to RGB colorspace -- and how best to do it?
    Quote Quote  
  21. Originally Posted by bentley View Post
    Thanks. In that case, where in this process of "rip DVD -> denoise/smooth/whatever -> import into upscaler -> save result" would you suggest switching from YUV to RGB colorspace -- and how best to do it?
    It's not going to make a big difference to the end result . You can do it yourself beforehand or let it convert YUV to RGB. There are slightly different types of algorithms you can use for the chroma resizing(upscaling) from 4:2:0 to 4:4:4 and RGB. Some might give you slightly better results, some slightly worse.

    You might want to correct for AR beforehand ; DVD's don't use "square pixel" . Although it has presets for things like 1920x1080 , that won't work for some types of DVD sources (4:3) , or ones that need to be cropped. That goes into the prep work. So you'd typically use 200%, or 400% then process it afterwards for the final format
    Quote Quote  
  22. You can do it yourself beforehand or let it convert YUV to RGB.
    By "it," you mean Video Enhance AI? It can convert YUV input to RGB output while upscaling? Neat.

    You might want to correct for AR beforehand ; DVD's don't use "square pixel"
    My DVD source is 720x480 and looks squashed. (Normal, yes?) I've read that resizing it to 640x480 would lose some of that pixel data -- giving Video Enhance less to work with -- so I had planned to upscale first, then resize the image. Is that a good way to go?

    Circling back to my first post: I need a replacement for MacTheRipper. (I'm switching over to PCs to better use AviSynth.) Is there a current "best"/most accurate program for ripping .VOBs from DVDs? Or any recommendations of favorites?

    Thanks as always!
    Quote Quote  
  23. There is one possible way you can avoid YUV to RGB conversion until after upscaling: upscale the three channels (Y, U, V) as greyscale, separately, then join them back together at the end. It would be interesting to compare the results with the regular RGB process. My guess is there will be little difference making the extra work not worth it.

    NTSC DVD is always 720x480 (the other legal frame sizes, 704x480, 352x480, 352x240, are hardly ever used on commercial DVDs). That's a frame aspect ratio of 3:2. But the display aspect ratio is always either 4:3 or 16:9. The player resizes the frame on the fly to match the display aspect ratio. So the 720x480 16:9 DVD will be stretched to 1920x1080 by an upscaling DVD player. A 4:3 DVD will be stretched to 1440x1080.
    Quote Quote  
  24. Originally Posted by bentley View Post
    You can do it yourself beforehand or let it convert YUV to RGB.
    By "it," you mean Video Enhance AI? It can convert YUV input to RGB output while upscaling? Neat.
    Yes, it works internally in RGB and will convert


    Circling back to my first post: I need a replacement for MacTheRipper. (I'm switching over to PCs to better use AviSynth.) Is there a current "best"/most accurate program for ripping .VOBs from DVDs? Or any recommendations of favorites?

    The old DVD Decrypter , DVD Shrink (set not to shrink) still work on many DVD's even today , but people also use makemkv (will put into a MKV container), anydvd ($)
    Quote Quote  



Similar Threads