VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. I have a video file ripped from a DVD, but the quality of the stream doesn't look very good, and I am trying to repair it to make it less bad.

    This is the data reported by ffprobe:
    Code:
    Input #0, matroska,webm, from 'A1_t00.mkv':
      Metadata:
        encoder         : libmakemkv v1.17.8 (1.3.10/1.5.2) darwin(arm64-release)
        creation_time   : 2024-12-23T09:03:25.000000Z
      Duration: 00:04:52.29, start: 0.000000, bitrate: 7183 kb/s
      Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], SAR 853:720 DAR 853:480, 29.97 fps, 29.97 tbr, 1k tbn
          Metadata:
            BPS-eng         : 5640915
            DURATION-eng    : 00:04:52.292000000
            NUMBER_OF_FRAMES-eng: 8760
            NUMBER_OF_BYTES-eng: 206099325
            SOURCE_ID-eng   : 0100E0
            _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.8 darwin(arm64-release)
            _STATISTICS_WRITING_DATE_UTC-eng: 2024-12-23 09:03:25
            _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
          Side data:
            cpb: bitrate max/min/avg: 7900000/0/0 buffer size: 1835008 vbv_delay: N/A
      Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default)
          Metadata:
            title           : Stereo
            BPS-eng         : 1536000
            DURATION-eng    : 00:04:52.260000000
            NUMBER_OF_FRAMES-eng: 8768
            NUMBER_OF_BYTES-eng: 56113920
            SOURCE_ID-eng   : 01A0BD
            _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.8 darwin(arm64-release)
            _STATISTICS_WRITING_DATE_UTC-eng: 2024-12-23 09:03:25
            _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Compression Artifacts:
    The file contains different levels of blocking, color banding etc. in different places. Color banding is most noticeable around the outer parts of the background, which is a gradient.
    Example clips in the attachments of this post. The clips are cut from the source clip using ffmpeg with -c:v copy option, and without audio.

    I tried using the deblock filter in handbrake, but the filter makes non-problematic sections look outright broken, which is unacceptable.

    "Interlacing":
    The metadata of the stream shows that it is interlaced. I tried deinterlacing with BWDIF, YADIF, nnedi3, QTGMC but all of them made it look worse than the original. When played back in both VLC and IINA, disabling the deinterlacing of the player and playing frame by frame, there are no frames that look like they are interlaced, so I don't know what is the deal with this part.

    AviSynth producing weird output aspect ratio:
    When trying QTGMC, the output aspect ratio is different from the input aspect ratio. A friend suggested that it might be because the SAR is not 1:1 on this video. Is there any way to correct this?
    Image Attached Files
    Quote Quote  
  2. Treating the files as progressive, I see no combing => those are progressive, so deinterlace seems like a mistake. The flags are simply wrong.
    If you have a newer GPU you could use some anime machine learning based filters,...

    Cu Selur

    Ps.: in my book, those are not 'heavy' compression artifacts
    Image Attached Files
    Last edited by Selur; 14th Feb 2025 at 18:04.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. The videos are encoded as if they are interlaced (how the codec handles them internally) but contain progressive frames. You can treat them as progressive.

    Banding can be reduced by debanding at higher bit depths the reducing the bit depth back to 8 with dithering.

    Code:
    ConvertBits(10)
    Gradfun3Plus()
    ConvertBits(8, dither=0, dither_bits=8)
    DCT blocking can be reduced with a deblocker like deblock_qed(quant1=50, quant2=50). Higher quantizers give more deblocking but a blurrier results. Lower values give less deblocking but a shaper result. Set them to your liking.

    You can preserve the aspect ration by specifying the SAR when you encode. For example, --sar=32:27 with x264.
    Quote Quote  



Similar Threads

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