VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. So here's the brief:

    I am the current admin for a certain TV show's Wiki, and am going through the process of screencapping every episode to form a "gallery" subpage.

    The series, as popular as it was and as hard as it is to believe, was never released on DVD or any other video format for its first 8 seasons. The only method to obtain them in their entirety for the longest while was through less-than-legal means. Thankfully, due to the advent of legal online streaming, everything from Season 2 has been made available for quite a while, so this is no longer a problem. However, Season 1 has not been seen since 2008 on Australian television, due to the fact one member of the famous trio was different. As a result, I have had to resort to a downloaded version of the season. Originally in .mpg format, I converted them to .mkv in MKVToolNix and am very pleased with the way they turned out, only 40MB smaller than the source files, and I presume that's mostly container-related.

    Now this recording is of very good quality, but there is one problem; naturally, due to the recording's nature, there's a channel logo/Bug/DOG on it, and it is very distracting due to being in the bottom-right corner of the screen and having such a distinctive shape. I decided I'd try and have a go at getting rid of this using the Delogo plugin for VirtualDub (an adventure in itself, but I got there in the end) and am positively surprised with the results - many frames don't even hint that there was ever a logo in that region of the screen to begin with. However, I am now completely clueless on how to reassemble the video back together as close to the way in which they were originally assembled as possible. I wouldn't consider myself proficient in this aspect by any means.

    Firstly, I tried using the default AVI export feature in VDub, but had to abort as the filesize was quickly spiralling out of control. I followed a tutorial on how to externally encode the video as an .MP4, however, the video quality is noticeably worse, deinterlacing no longer works, the aspect ratio is wrong (it otherwise automatically corrects to 16:9 from its 720 x 576 source resolution) and when left to complete the program crashes before finishing, with my only option being to pre-emptively abort. As a last ditch resort I have exported every frame as an uncompressed targa, which now takes up 200GB on an auxiliary drive. This is in case nothing can be done from within VDub and I require another program instead.

    I played around with more of the settings, resizing it with a filter to 1024 x 576, deinterlacing it using Yadif and using Lanczos resampling, but the resulting video still doesn't look as good as the .mkv I made from the original .mpg, plus the video size looks like it'll be more than double the original file, yet is lower in quality.

    All I want to know is how to reassemble the episode with the edited frames to look exactly as it used to as a 2GB .mp4/.mkv, retaining a relative filesize, framerate and appearance. I want the aspect ratio to automatically correct to 16:9, I want the video quality to remain as it was, and I want the de-interlacing to work as it did before. The only difference should be the apparent removal of the onscreen logos on the bottom right. I will gladly follow ffmpeg/AviSynth/other command-line instructions if they are detailed and function as I intend them to.

    Here's the steps I have taken thus far and expect to take:

    - Convert .mpg to mkv (done)
    - Run Delogo script on episode (done)
    - Export video in original quality with same settings and logo removed (?)

    Thanks in advance.
    Quote Quote  
  2. Originally Posted by AlexA97 View Post
    I tried using the default AVI export feature in VDub, but had to abort as the filesize was quickly spiralling out of control.
    Yeh, not used VDub for many many years but that sounds about right. If you don't select a video codec (back in the day we'd install divx/xvid) it will save as uncompressed and be massive.

    Originally Posted by AlexA97 View Post
    All I want to know is how to reassemble the episode with the edited frames to look exactly as it used to as a 2GB .mp4/.mkv, retaining a relative filesize, framerate and appearance.
    The problem is, the moment you use a video filter the video will re-encode. You will loose something. It's just a battle to get to an acceptable level where the quality difference is hopefully minimal and not noticeable.

    So I presume you want to end up with an MP4? Which video codec would be preferred?

    P.S. Just looked at your logo/delogo pics, nice
    Quote Quote  
  3. – Why did you first convert from MPG to MKV ? Not that it hurts if no transcoding was involved but I don't see the point.
    – You can set the correct aspect ratio when muxing the processed video, at the container level, using mp4box for MP4 container or mkvmerge for MKV container.
    – Resizing from 720x576 to 1024x576 will significantly increase the bitrate requirement to maintain the same visual quality, or it will significantly decrease the visual quality if maintaining the same bitrate. So it's better to keep the current size and storage aspect ratio (SAR), while setting the correct display aspect ratio (DAR) at the container level (search “anamorphic encoding”).
    – When you write “deinterlacing no longer works”, what deinterlacing do you mean ? Automatic deinterlacing during playback ? With which software / hardware media player ? If deinterlacing is required, the consensus is that QTGMC for Avisynth produces the best result among software tools (with the possible exception of high-end professional softwares) and is far better than Yadif, but also far slower. By default QTGMC doubles the framerate, which preserves the temporal resolution and therefore the smoothness of motion.
    – If I'm not mistaken, VirtualDub operates in RGB colorspace, while most Avisynth filters operate in YUV colorspace. Each colorspace conversion produces some level of quality loss, even when using lossless codecs to export intermediate files, so the workflow should be designed to minimize such conversions. In this case, I'm not sure if this is relevant, and if doing the needed steps in a different order would improve the outcome, but it's one more thing to keep in mind, generally speaking, when doing complex video processing tasks.
    – If the method to externally encode to MP4 doesn't work well you can export the footage as AVI using a lossless codec like Lagarith or MagicYUV or UTVideo or Huffyuv (in my experience Lagarith produces the smallest files among those four), then encode the lossless intermediates with a batch ffmpeg command. But newer versions of VirtualDub, developped under the name VirtualDub2, can directly encode to MP4 or MKV using x264.
    – As “video.baba” explained, there is necessarily some level of quality loss whenever a video has to be processed then recompressed. Run some tests with different CRF values and choose one that seems to be a good compromise. CRF defines a level of visual quality (or rather, a threshold of what is considered as “expendable” information : the higher the CRF value, the more visual information gets discarded, which results in a smaller bitrate and some loss of spatial / temporal detail), and the resulting file size can vary from one file to the next, depending on the average level of computational complexity of the picture. If you prefer to obtain files with the same size, you can select the average bitrate, but the encoding will be less efficient / consistent (for instance an episode consisting of mostly well lit shots with little action will have the same bitrate as an episode full of action scenes in the dark, whereas the latter would have been significantly improved visually with a higher average bitrate).
    Quote Quote  
  4. Originally Posted by AlexA97 View Post
    ...I presume that's mostly container-related.
    It's entirely container related as nothing in MKVToolNix is capable of reencoding.

    As already mentioned, changing to the MKV container was unnecessary and a complete waste of time.

    If you insist on doing the filtering in VDub (the logo removal and deinterlacing (why)), save out not as uncompressed but as lossless. Install and use the Lagarith or UT Video Codec, and in the Video portion of VDub, choose one and configure it for YV12 output. The size will still be large, but not as large as before.

    You'll be saving as an AVI. Afterwards take that AVI and reencode to MPEG-2 on the way to making another MPG. It'll never look quite as good as the original, but it should be pretty close if done right. You can probably do all that in VDub2.

    Part of this echoes what abolibibelot said.
    Quote Quote  
  5. It's entirely container related as nothing in MKVToolNix is capable of reencoding.
    Technically how is it explained ? I've read that the MKV container had “less overhead” compared to others, what does this mean more precisely ? One thing I know empirically is that a MPG file can be read from (almost) any point, even if a large chunk is missing at the begining, and there's are many MPG headers found throughout the same file (so there must be a lot of redundancy, which partly explains the size discrepancy), while video files created with other containers like AVI, MP4, MKV, get totally unreadable if only the first sector is missing / corrupted.

    You'll be saving as an AVI. Afterwards take that AVI and reencode to MPEG-2 on the way to making another MPG. It'll never look quite as good as the original, but it should be pretty close if done right. You can probably do all that in VDub2.
    Why use the relatively inefficient MPEG-2 compression format, if the goal is to get files with a good quality / size ratio to archive, possibly share, and make screencaps ?

    ...and deinterlacing (why)
    It might be a good idea to deinterlace if the resulting files are aimed for computer playback, no ?
    But now that I think of it, there's the possibility that the source material is not truly interlaced, but progressive encoded as interlaced, in which case applying a deinterlacing filter could make it look ugly.
    Quote Quote  
  6. Originally Posted by abolibibelot View Post
    Why use the relatively inefficient MPEG-2 compression format...
    Because he said his source was an MPG and he wants it back with the same specs. Me, I don't care how he reencodes it. We don't know in what format all the rest of the episodes are. MPEG-2 is perfectly capable of returning good quality.
    It might be a good idea to deinterlace if the resulting files are aimed for computer playback, no ?
    Again, I am assuming he wants them returned to the same quality as the source. And maybe with the same specs as all the other episodes in the series. And the VDub Yadif deinterlacer is inferior to what's available in AviSynth. Computer software players can deinterlace. If for something like YouTube or for playing through his website player then, yes, they should be deinterlaced.
    ...there's the possibility that the source material is not truly interlaced, but progressive encoded as interlaced...
    Yes, but unless and until we see a sample, there's no way to know for sure. He's PAL and reencoding as interlaced MPEG-2 takes care of both eventualities (either interlaced or progressive content)
    Quote Quote  



Similar Threads

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