Since there's been a non-zero interest in evaluating my encoder, here's a short guide on how to build and invoke the encoder.
nihav-encoder
nihav-encoder
to encode into AVInihav-encoder
to encode into EA formatnihav-encoder
Since distributing binaries in modern Internet is considered dangerous, here are build instructions instead:
git://git.nihav.org/nihav.git
nihav-encoder
git repository from git://git.nihav.org/nihav-encoder.git
into already existing nihav
directory (or edit paths to it in Cargo.toml
)cargo build --release
(though I heard that RUSTFLAGS='-C target-cpu=native' cargo build
improves performance significantly in this case)NihAV is a research framework and thus it has support mostly for exotic formats and lacks on common ones. If you want to encode VP6 you need to feed nihav-encoder
the format it understands, namely:
I420
)Additionally please remember that VP6 requires picture dimensions to be multiple of 16.
nihav-encoder
to encode into AVIGeneral command line looks like nihav-encoder --input input.y4m --output output.avi --ostream0 encoder=vp6,...
You can additionally specify -an
to drop audio streams if you do not want them to be present in output file.
Supported encoder options:
bitrate
— tells encoder to target this bitrate (in kilobits per second);quant
— tells encoder to use fixed quantiser (in 0-63 range, the bigger the better);version
— tells encoder to generate specific version of the bitstream. Version can be vp60
, vp61
or vp62
;huffman
— tells encoder to code coefficients with Huffman codes instead of default bool coder.E.g. if you want to encode VP 6.1 with Huffman coding and bitrate around 50kbps you should invoke nihav-encoder --input input.y4m --output output.avi --ostream0 encoder=vp6,version=vp61,huffman,bitrate=50000
You can also add --verbose
option to see the encoding progress.
nihav-encoder
to encode into EA formatThis command line should produce compatible file but it has not been tested if the result works in the original games:
nihav-encoder --input input.avi --output output.vp6 --output-format ea --ostream0 timebase=32767/983019,encoder=vp6,version=vp61,quant=60
In theory it can also encode files with a separate alpha mask stream, for that you should provide encoder with an input file that has two video streams and invoke it like this:
nihav-encoder --input input.avi --output output.vp6 --output-format ea --ostream0 timebase=32767/983019,encoder=vp6,version=vp61,quant=60 --ostream1 timebase=32767/983019,encoder=vp6,version=vp61,quant=60
Putting two streams can be done e.g. with avconv
(or ffmpeg
) like:
avconv -i input1 -i input2 -an -c:v copy -map 0 -map 1 output.avi
(or you can use -c:v rawvideo -pix_fmt yuv420p
to make sure output file contains raw video streams).
Alternatively you can invoke encoder with two input files directly:
nihav-encoder --input1 video.avi --input2 alphamask.avi --output output.vp6 --output-format ea --ostream0 timebase=32767/983019,encoder=vp6,version=vp61,quant=60 --ostream1 timebase=32767/983019,encoder=vp6,version=vp61,quant=60
Back to the main page