AVI to MKV Quality Issue

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

Post Reply
Gornot
Beginner
Beginner
Posts: 3
Joined: Sun Oct 14, 2007 7:21 pm
Location: The Republic Of Serbia

AVI to MKV Quality Issue

Post by Gornot » Sun Oct 14, 2007 8:04 pm

Ok, so here's my problem... I'll try to explain it with all the details, in case someone can help me on the other issue I have which doesn't have anything to do with MediaCoder

For the past few months I've been using Gordian Knot to encode my anime AVI files to MKV. The original AVI files had (and still have) an unusual bug. When I loaded the file into GK it showed, like, only 2-3% of the real frame count, so I used an app called AVIfixed to find and fix frame errors in the file. It worked every time, but as a result, most of the audio stream disappear, as if it was muted (I checked that with Sound Forge). But, when I loaded the "fixed" AVI file and encoded it, the last 30-60 seconds in the video stream were gone (I muxed the audio stream with MKVmergeGUI, previously encoded to .m4a with Winamp). The point is that the quality was just fine, but I still don't understand what's the problem...

OK, now the MediaCoder issue...
Unlike Gordian Knot, MediaCoder encoded both video and audio streams just fine, but the resulting video was blurry. Every color transition and line looks very bad, even though I used the same setting I use with Gordian Knot, which are as follows:

Video
Format: H264
Container: MKV
Bitrate: (depends on the length, ~405 kpbs)

Audio
Encoder: CT AAC+, type: AAC+, MPEG-4 AAC
Bitrate: 48 kpbs

The resulting filesize is supposed to be 75 MB, and the settings worked perfectly, but as I said, the resulting video stream was too blurry. Is there a way to fix this or at least add some effects to the video stream (the stream is NTSC, so there's no need for deinterlacing)?

EDIT - Oh, yeah, I forgot to mention that I used a 3-pass encoding. I'm not an expert in video encoding, but I think that a 3-pass encoding should've resulted in a much higher quality, right?

User avatar
SirAuron
Expert
Expert
Posts: 798
Joined: Thu Feb 08, 2007 1:39 am
Location: Germany

Post by SirAuron » Sun Oct 14, 2007 9:51 pm

actually the difference between 2-pass and 3-pass encoding is minimal with x264. i use 2-pass and almost the same settings you do (with my anime) and the outcome looks mostly fine (500 kb bitrate would propably be better, though). maybe you could try out 2-pass and see if it works better?
MediaCoder settings:

x264 (backend/source: mencoder, fps: 23,976, Fabio Sonatti's settings) + nero aac 64 in matroska

Gornot
Beginner
Beginner
Posts: 3
Joined: Sun Oct 14, 2007 7:21 pm
Location: The Republic Of Serbia

Post by Gornot » Sun Oct 14, 2007 9:58 pm

Actually, I just finished encoding the same episode with a 2-pass encoding, and the result was the same...

User avatar
SirAuron
Expert
Expert
Posts: 798
Joined: Thu Feb 08, 2007 1:39 am
Location: Germany

Post by SirAuron » Sun Oct 14, 2007 10:31 pm

well, it was just a guess. did you try to use a higher bitrate (if the problem persists even with a higher bitrate we can be sure its not because of that).

its also possible that the latest mencoder/mplayer tryouts are the culprits.
MediaCoder settings:

x264 (backend/source: mencoder, fps: 23,976, Fabio Sonatti's settings) + nero aac 64 in matroska

Gornot
Beginner
Beginner
Posts: 3
Joined: Sun Oct 14, 2007 7:21 pm
Location: The Republic Of Serbia

Post by Gornot » Sun Oct 14, 2007 10:50 pm

I don't want to set a higher bitrate because ~405 kpbs for the video stream was just right with GordianKnot... + I calculated the precise bitrates for all the streams so I could have good quality but a lot of episodes when burning to a DVD...

I was just thinking, is it possible to make MediaCoder use some ffdshow filters while encoding, for example, the "Sharpen" filter? That would certainly fix my problem...

Oh, and by the way, 1-pass encoding gave me, strangely, the same results... :shock:

everling
Amateur
Amateur
Posts: 48
Joined: Sat Jul 22, 2006 9:39 pm

Post by everling » Wed Oct 17, 2007 5:13 pm

Normally there are some hard to notice differences between first pass and second pass x264. Between the second and third pass, usually the only way to know the difference is by seeing the PSNR/SSIM value after the video has been trancoded. You'll have to use the Console window to see those readings however, which needs to be opened before you start transcoding.

I decide whether a pass was good or not based on the SSIM value. The PSNR and SSIM values usually are different between multi-passes. If they're consistently the same, then the multi-pass is broken. In such a case, you might have to resort to using alternative methods to properly encode your video.

Personally, 75 MiB files are too small to care much for quality. 48 kbps audio tends to sound too metallic for my taste.

Regarding video quality, are you downsizing the 640x480 video to 320x240 or some other smaller dimension? Try to do an encode without changing the dimension. Sometimes the quality might be better preserved.

Regarding the sharpen filter, I think mencoder (the default encoder in MediaCoder) might have a sharpen filter. But I do not know if you can use it, there are at least two ways to produce H.264 MKVs via MediaCoder - one via mencoder and one via x264.

Regarding your problem with frame count, I have no idea.

User avatar
SirAuron
Expert
Expert
Posts: 798
Joined: Thu Feb 08, 2007 1:39 am
Location: Germany

Post by SirAuron » Wed Oct 17, 2007 7:27 pm

I think MediaCoder has a few filters hidden somewhere. You can find them here: file -> settings -> video filters. Maybe not what you are looking for, though.
MediaCoder settings:

x264 (backend/source: mencoder, fps: 23,976, Fabio Sonatti's settings) + nero aac 64 in matroska

Post Reply