Hi everyone!
I have couple of Children's DVD here at home (Learn to Count, ABC, etc). I sometimes play it for the kids, but I want to get ride of my DVD Player (I have a Kodi now for streaming). The initial idea was to just copy the .vob files from the DVD into my hard-drive and be done with it. But I noticed the files are too big for my taste. Especially when the content is Children's stuff that isn't very high quality to begin with.
I'm considering using FFMPEG to re-encode them. I know that re-encoding music files (lossy to lossy) is a big no no. I assume it's the same for Video? But since all I own is a Lossy .vob files from the DVD, I guess I'm going to try it anyway just to save some space.
I used FFMPEG in the past to convert Loseless VHS Videos to Lossy format like so:
So obviously, the source is going to be vob files instead of AviSynth script. But what about the rest? Couple of questions:Code:ffmpeg64 -i "E:\test\test.avs" -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -vf setsar=12/11 -c:a libfdk_aac "results.mp4"
1. Preset slow and crf 18 sounds a bit like over-kill for a Children's DVD. What would be a saner option?
2. I assume, I don't have to state YUV 420 because unlike the VHS capture I captured at 422, DVDs are at 420 by default?
3. what about setsar? I'm using is to have an proper aspect ratio when the TV scale it up. But 12/11 is for PAL capture (576x720). Do I even need to set it on DVD content?
4. Is there any other DVD specific options I should be aware of and state to FFMPEG when handling DVD?
5. The DVD disk I was checking was interlaced. Are all DVDs interlaced? or some are progressive? Will interlaced content will benefit from de-interlacing with QTGMC (and in that case, I assume I will need to write AviSynch script that loads the VOB file).
6. Does FFMPEG support adding couple of .vob files into a single mp4 file? or I need to do that in AviSynth?
Thanks!
+ Reply to Thread
Results 1 to 30 of 89
-
-
You can not simply copy the vobs from the dvds to your hard drive. You have to RIP (the correct useage word) first.
Yes. Makemkv can do this in one step, RIP and create the mkv container.
If you want .mp4 then handbrake is also an option. Then you simply load the entire RIPPED folder and it can create a single .mp4 -
You can not simply copy the vobs from the dvds to your hard drive. You have to RIP (the correct useage word) first.
Yes. Makemkv can do this in one step, RIP and create the mkv container.
If you want .mp4 then handbrake is also an option. -
If your media player plays the vobs without ANY picture disturbance then you can copy them straight to the hard disk. But typically there will be some copy-protection and you see missing pixels.
Mkv is just a container. You are left with the original mpeg2 video as is on the dvd. No re-encoding done.
Why not de-interlace for mp4 ? Check out dvd-rips (the modern useage of the word now) and, typically, many will be created by Handbrake or similar tools and will be de-interlaced. Of course the re-encoding also means you get a smaller file than with makemkv.
If you still want to use ffmpeg then there are several GUI's available so you do not have to concern yourself with the command-line. Also bear in mind that many of the stand-alone conversion 'one-click' programs also make use of ffmpeg. I can not recc a GUI since I do not use these (or ffmpeg directly for that matter) but there are active topics that discuss these. -
Well, I didn't play all the Video - but the section I did see didn't have any missing pixels. Probably this "Learning to Count" DVD isn't copy-protected. So Ripping is basically the process of taking copy-protected video file and make them viewable video files, cool.
Mkv is just a container. You are left with the original mpeg2 video as is on the dvd. No re-encoding done.
but there are active topics that discuss these.
Thank you! -
Here is the topic that discusses GUI's
https://forum.videohelp.com/threads/400709-GUI-for-ffmpeg -
Just for clarity why de-interlacing is suggested.
Your DVD is either 720*480 or 720*576. The actual display is different (640*480 or 768*576). If you plan to create a mp4 with different parameters you MUST de-interlace BEFORE you resize. -
-
Nope.
Your DVD is either 720*480 or 720*576. The actual display is different (640*480 or 768*576). If you plan to create a mp4 with different parameters you MUST de-interlace BEFORE you resize.
Also, the DVD may contain progressive video but flagged as interlaced (typical for PAL DVDs with movies). If so, deinterlacing of progressive footage is not recommended. -
[QUOTE=Okiba;2610948]
I was checking it's interlaced with MediaInfo - will media Info let me know if it's really progressive?
Also you will see the typical combing when you watch interlaced video on your PC with any deinterlacer of the player disabled. -
That is fair enough. Should have made it more clear when I mentioned the actual display where the vertical resolution is untouched. Just that these days with larger screens it is more 'tempting' to resize with a 4:3 video typically resized, for example, to 720*540.
Just trying to put the OP on the correct path and avoid disappointment. But, for clarity sake, how would one know that the video is already progressive (the OPs disks are not movies but could be animations)
Edit: I see that last point has already been addressed. -
Yeah, animations can be tricky. Also, I should have mentioned that movies on NTSC DVD are often hard- or soft telecined which would require IVTC rather than deinterlacing.
Perhaps the OP uploads a sample to collect better advice. -
Also you will see the typical combing when you watch interlaced video on your PC with any deinterlacer of the player disabled.
Yeah, animations can be tricky.
So It looks like the plan is something like that:
1. Ripping the DVDs with MakeMKV. If I want the retain the quality 1 to 1 with the DVD. That's all I really need to do. However, if I want to to de-interlace it, or compress it a bit more -
2. I can load up the MKV file with Avisynth, de-interlacing with QTGMC, and output a mp4 out of it.
I guess there is no need to state the output file being 4:2:0, as all the DVD I checked were 4:2:0 already. So the only open questions left I need to figure out, is what the SAR parameter should be in order to maintain a proper aspect ratio when the source upscales the DVD resolution. I will also check the FFMPEG GUI thread mentioned above.
Thanks guys! -
720x480 NTSC 4:3 DVD: SAR = 8:9
720x480 NTSC 16:9 DVD: SAR = 32:27
720x576 PAL 4:3 DVD: SAR = 16:15
720x576 PAL 16:9 DVD: SAR = 64:45 -
Thank you jagabo, and hi again
Is there any formula I can refer in the future for figuring out the SAR myself?
Besides that, I did a bit reading for the sake of learning more. It seems like FFMPEG is able to Rip DVD by basically concatenating the vob file. But as mentioned above, it seems like ripping also take care of the copy-protection, so I assume that concatenating option only work with non copy-protected DVDs. So it seems more reasonable to use the recommended MakeMKV.
Then, it seems like AviSynth is able to read .mkv using FFMpegSource2. So I can write an AviSynth script that will de-interlace the DVD using QTGMC (with casual preset like fast), and create a smaller mp4 out of it using the FFMPEG command line:
ffmpeg64 -i "E:\test\test.avs" -c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p -vf setsar=16:15 -c:a libfdk_aac "results.mp4"Last edited by Okiba; 16th Feb 2021 at 13:39.
-
Rip using a real decrypter, not something that repackages it into an MKV. Then use DGIndex to join the VOBs and to create a D2V project file so you can use MPEG2Source in an AviSynth script.
However, if I want to to de-interlace it
So it seems more reasonable to use the recommended MakeMKV.
So I can write an AviSynth script that will de-interlace the DVD using QTGMC... -
Had some free time. MakeMKV works like a charm and very easy to use. Here's the AviSynth script I used to de-interlace the MKV output into lossy mp4 file if anyone find it interesting:
Code:SetFilterMTMODE("QTGMC", 2) FFMpegSource2("E:\title_t00.mkv", atrack=1) Crop(8, 0, -8, 0) AssumeTFF() QTGMC(Preset="Fast", EdiThreads=3) Prefetch(3)
Code:ffmpeg64 -i "dvd.avs" -c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p -vf setsar=8/9 -c:a libfdk_aac "results.mp4"
Thanks!
EDIT: Just missed your post manono.
Rip using a real decrypter
MPEG2Source
Once again, don't blindly deinterlace. Do that only with pure interlaced sources, not film sources.
IVTCLast edited by Okiba; 16th Feb 2021 at 14:07.
-
Never deinterlace when you can IVTC, Any deinterlacer - even the best ones such as QTGMC - damages the video. An IVTC, on the other hand, does no damage to the original frames.
How can I tell if a video is "Pure interlanced source"?
And I trust MKVs about as far as I can throw them. MPEG2Source is far and away the best way to open DVD sources. That's after decrypting the DVD using DVDDecrypter, DVDFab or somesuch.
I think it was mentioned once SRestore after De-interlacing has the same effect of IVTC? or am I'm wrong?
...but I probably should test it with SRestore, see if 29FPS looks better as this is a cartoon. -
In theory, on DVD the full 720x480 frame constitutes the 4:3 image. That makes the SAR 8:9. But... When analog tape is digitized they follow the ITU specification. That spec captures the 4:3 analog frame in a 704x480 digital frame with 8 extra pixels of padding at the left an right edges. So the ITU capture has a SAR of 10:11 and the full 720x480 frame is slightly wider than 4:3. When those caps are made into DVDs the difference between the MPEG spec and the ITU spec is often ignored. The full 720x480 is simply written to the DVD and flagged as 4:3 DAR.
In short, if you have 8 pixel borders at the left and right it's usually a dead giveaway that you're working with an ITU cap and you should use the 10:11 SAR.
The general equation that relates display aspect ratio, the frame size, and the sampling aspect ratio (sometimes called pixel aspect ratio) is:
Code:DAR = FAR * SAR DAR = display aspect ratio, the final shape of the picture FAR = frame aspect ratio, ie, width:height of the digital frame in pixels SAR = sampling aspect ratio, the relative distance between samples horizontally and vertically (ie shape of individual pixels)
Code:DAR = FAR * SAR DAR / FAR = SAR 4:3 / (704:480) = SAR 4/3 / (704/480) = SAR 4 * 480 / 3 / 704 = SAR 10 / 11 = SAR 10:11 = SAR
ffMpegSource2() is not always frame accurate. Complex AviSynth scripts may end up reading frames out of order and ffMpeg2Source() may not deliver the right frame every time. DgIndex/Mpeg2Source() works better. Unfortunately the pair doesn't work well with MKV files. So the output of MakeMKV will have to have the MPEG2 video extracted as an MPG file.
The best way to analyze for this is to open the video and apply Bob() or SeparateFields():
Code:Mpeg2Source("filename.d2v") Bob() # or SeparateFields()
The Wikipedia article is pretty good: https://en.wikipedia.org/wiki/Telecine -
Thank you both. I was able to rip a Vob file with DVDDecrypter, and now using MPEG2Source instead of FFMpegSource2. And thank you jagabo for the SAR formula. Stored it aside on my note. Will write a Python script to do it automatically when I'll have more free time
With SeparateFields() I was able to indeed note the 3:2 movement. Strangely enough, I couldn't with Bob() (with Bob() a movement occurred every 5 frame). So yea, not really interlaced.
In fact, your kids probably won't appreciate the difference between a good IVTC and QTGMC. You might just make your life easy and convert them all with QTGMC and leave them at 60p.
But sometimes you may get a video that is very hard or impossible to IVTC.You should probably perform an IVTC as 23.976fps is probably the correct framerate.
Code:AssumeTFF() QTGMC(Preset="Fast", EdiThreads=3) TFM().TDecimate()
Untouched samples are worth 1000 words.
Thank you!Last edited by Okiba; 17th Feb 2021 at 04:45.
-
No, you use only TFM().TDecimate(). QTGMC() has a special cleanup mode that's sometimes useful for otherwise damaged material.
Code:TFM() TDecimate() QTGMC(InputType=2) # cleanup only, no deinterlacing
Code:TFM(clip2=QTGMC(FPSDivisor=2)) # use QTGMC() for fixup when field matching fails TDecimate()
Code:four film frames: 1 2 3 4 broadcast as fields, top field first: 1T 1B 2T 2B 3T 3B 4T 4B captured normally as top field first frames: [1T+1B] [2T+2B] [3T+3B] [4T+4B] # all frames look progressive captured "incorrectly" as bottom field first frames: [1B+2T] [2B+3T] [3B+4T] [4B+5T] # every frame looks interlaced when there's motion
SRestore() is for PAL/NTSC conversions with field blending (this is a common method of frame rate conversion; if you use a simple Bob() you'll see some blended frames, some clean frames). First you double frame rate deinterlace, then you run SRestore():
Code:QTGMC(preset="fast") # or Yadif(mode=1) SRestore(frate=X)
Sometimes there is just too much blending or some other damage. There may be no way to restore the original film frames. Attempting to do so may leave lots of blended frames, jerky video, or other damage. In cases like that using just QTGMC() will look no worse than watching the original DVD, usually better because QTGMC() is a better deinterlacer than that in any TV or DVD player. -
No, you use only TFM().TDecimate(). QTGMC() has a special cleanup mode that's sometimes useful for otherwise damaged material.
use QTGMC() for fixup when field matching fails
Sometimes you come across a PAL video that simply has the wrong fields merged into frames
SRestore() is for PAL/NTSC conversions with field blending.
Oh, so SRestore is not another method of IVTC, but rather another tool to fix another problem that happens due to PAL/NTSC conversion (but because it used about QTGMC, is half the frame-rate back to the frame-rate used in Cartoons).
Just for the sake of testing, I compared the same 10 second of a cartoon once with QTGMC().SRestore(), to TFM().TDecimate() - and during playback, I didn't notice a difference. Perhaps I will see one if checking it frame by frame - or perhaps my eye isn't trained enough
So I think a decent scenario would be: Try to SeparateFields(). If every frame moves, De-interlace normally with QTGMC. If after QTGMC you seeing frame blending, use SRestore. If It's 3:2, use TFM().TDecimate(). Any other pull-downs, play around with CyclesX/Y.
I wonder if there's out there in a wild any example for how NTSC/PAL conversion blended frames looks like or any video that compare QTGMC().Srestore() vs TFM().TDecimate() that make difference more noticeable?
EDIT:
Compared TFM().TDecimate() to QTGMC().Srestore() frame by frame. With QTGMC.Srestore I get movement every 2 frame. With TDecimate() I mostly get movement every 2 frames, but sometimes, I will see movement frame and frame.Last edited by Okiba; 17th Feb 2021 at 09:48.
-
-
With most cartoons character animation is done at 8 or 12 fps so fewer cell have to be drawn. Panning shots, where they pan over a large background are shot at 24 fps (character motion on top of that will still be 8 or 12 fps). So you expect to see motion with every frame during panning shots. Character animation usually shows motion every two (12 fps animation) or three (8 fps animation) frames.
-
I'm assuming he's comparing the same sections and getting a steady 12fps (2-2-2-2) when using SRestore, but sometimes movement every frame (2-1) with TDecimate. There should also be some threes in there to compensate (2-1-3-2-1-3) or some such. If he's comparing different sections of the episode then, yes, it's an apples to oranges comparison as different sections were drawn to be displayed at different framerates. He should still be using TDecimate's Mode=1 for any animations as I've seen plenty of 2-1-3-2-1-3 when it should be 2-2-2-2-2-2 if not using it.
Last edited by manono; 17th Feb 2021 at 20:14.
-
-
Yea, I am comparing the same sections, and getting a steady 2-2-2-2 with SRestore. Using TDecimate(Mode=1) did make TDecimate more steady - but I do see movement every 1 frame once in a while (even though much rarely compared to the default mode). It's the same frame however I'm seeing with SRestore - so no information is being lost. What is the end goal here? steady 2-2-2-2? is that true for any IVTCing?
In that case, is it better to just use SRestore? (where it's steady 2-2-2-2) (as a rule of a thumb).
Thanks for the blending video!
By the way, back to the DVD ripping question above - I use IFO mode with Decrypter (or else I get audio out of sync issue). The end results are multiple vob files. How do you guys keep your source videos? Leave couple of Vob files? basically the output of Decrypter? or do you change the container to something that is easier to work with? (and maybe concatenating all the vob files into a single file?).Last edited by Okiba; 18th Feb 2021 at 09:36.
Similar Threads
-
help DVDRip encoding of .VOB files using LINUX tools?
By precipizio in forum DVD RippingReplies: 1Last Post: 16th Apr 2020, 10:38 -
Splitting or trimming raw VOB or MPG files without re-encoding?
By DF001 in forum Capturing and VCRReplies: 3Last Post: 14th Mar 2020, 22:53 -
Multiple .VOB file to one file?
By neworldman in forum Video ConversionReplies: 12Last Post: 4th Jan 2017, 02:00 -
vob to mp4 - encoding using vdub to mimic HB settings
By wolfdogg in forum Video ConversionReplies: 27Last Post: 24th Dec 2016, 21:03