The Place Where Wishes Come True

Keep Fighting

Fraps Video Too Dark? How to: Decode Fraps Video Correctly

The video stream in the multimedia file recorded by Fraps is encoded in Fraps’ own codec. The color space of the video stream can be either YV12 or RGB24. There is an option in Fraps which lets you choose which color space to use.

Currently, many decoders fail to handle Fraps videos in the YV12 color space correctly, resulting in decoded pictures that appear very dark.

In either case, the video stream can be decoded correctly using AviSynth. For YV12, use:

FFIndex(INPUT)
AudioDub(FFVideoSource(INPUT), FFAudioSource(INPUT))
ColorYUV(levels="PC->TV")
ColorMatrix(mode="rec.709->rec.601", clamp=0)

For RGB24, use:

FFIndex(INPUT)
AudioDub(FFVideoSource(INPUT), FFAudioSource(INPUT))

Don’t use the following script:

AviSource(INPUT)

That uses Fraps’ own decoder, which converts YV12 to RGB24. If you later encode the video to YV12, the whole process, YV12 → RGB24 → YV12, causes quality loss. In the above two scripts, there is no unnecessary color space conversion.

It is said that by using the right parameters, both FFmpeg and x264 can decode the video stream correctly. But I haven’t tried yet.

月海的子守歌的几个版本

日语原版

长弓背负いし 月の精
梦の中より待ちをりぬ
今宵やなぐゐ、月夜见囃子
早く来んかと待ちをりぬ
眠りたまふ、ぬくと丸みて
眠りたまふ、母に抱かれて
真棹掲げし 水の精
梦の中より待ちをりぬ
今宵とりふね、うずまき鬼
早く来んかと待ちをりぬ
眠りたまふ、ゆるゆる揺られ
眠りたまふ、海に抱かれて

Moon Princess

Moon Princess

You shouldn’t sell your soul to the devil even if you hated the world.

Official Direct Download Links of Skype

These are download links of Skype I discovered. They will always be the latest version and multilingual. These are especially useful for Chinese netizens, because the official site will always redirect them to the so-called Chinese official site, where a specially made “Chinese Skype” will be served, which has long been rumored to eavesdrop its users.

Use MP4Box Without Installing GPAC

MP4Box is an essential tool to manipulate ISO base media file formats, such as MP4, 3GP, etc. Currently it is better than FFmpeg. Later on it is packed in GPAC, a multimedia framework of which the other parts don’t appear to be that useful.

To use MP4Box without installing the entire GPAC framework, you can extract relevant files from the installer using a extractor such as 7-Zip:

  • js32.dll
  • libeay32.dll
  • libgpac.dll
  • MP4Box.exe
  • ssleay32.dll

And add the directory to your path. Then you are good to go.

Almost Done

Recently I’ve been working on my program which is capable of automatically preparing movies and anime for the new iPad. I tried feeding Madoka’s opening to my program and got a somewhat nice result. You can see that my program is able to render subtitles in ASS format using custom fonts, thanks to libass.

Mahou Shoujo Madoka Magica

Serious X264 Bug: Everything Becomes Purple-ish!

Recently a serious x264 bug has been discovered. It makes your video look purple-ish. A comparison here pretty much proves it. This bug has been fixed in the latest version. Technically, all encodes encoded by x264 prior to the fix needs to be re-encoded. But I cannot find any information about the exact version number to which the fix has been applied.

Hardsubbing ASS Subtitles in AviSynth

I find that this job can be nicely done by assrender, which is based on libass. It even renders karaoke well. Its usage will be like:

LoadCPlugin("assrender.dll")
assrender("subtitles.ass", hinting=3, fontdir="font")

The fontdir option is a directory holding fonts used to render the subtitles, which you don’t want to install on your system.

Frame-accurate Decoding and Frameserving of Video Inside AVI

Basically, AVI, MKV, MP4 and FLV are handled very well by FFmpegSource2. The script can be something like this:

LoadCPlugin("ffms2.dll")
FFVideoSource("source.mkv")

Note that I’m using the newer C plugin version.

For M2TS and TS, it seems that by far DGAVCDec is the best choice. Use DGAVCIndex to index the source and you will get a DGA index file. Then write a script like this:

LoadPlugin("DGAVCDecode.dll")
AVCSource("source.dga")

Experiment With MP 4.1 and CRF 25

I accidentally encoded the fifth episode of Gekijouban Kara no Kyoukai using x264. I used the following command:

x264 --profile main --level 4.1 --preset veryslow --tune animation --crf 25 --output output.264 source.avs

And this is the comparison of Frame 16416 of the video:

Comparison of Frame 16416

Of course the quality is very shitty. The image is fuzzy. The grain is gone. The details cannot be seen clearly. But the bit rate is only 303 kbps for a 720p 8-bit H.264 video stream! That may be useful in preparing video for portable devices. I’ll experiment more to get the balance between quality and size.