A fork of x264 video encoder supporting custom saliency maps as an additional input to improve quality of salient objects.
An example (click to see the full-size images):
|Ordinary x264||Saliency-aware x264|
You could download a build for Windows here or build it on your own.
Then you could compress videos taking into account their visual attention distribution as follows:
x264.exe "source.avi" --output "source-saliency-aware.mkv" --bitrate 1000 --saliency "saliency.avi" --saliency-s0 75% --saliency-bitrate 40%
The first three parameters are the same as in ordinary x264 encoder:
"source.avi"is a path of source video;
--outputspecifies a path of the compressed video;
--bitratespecifies the average bitrate of the compressed video.
The next three parameters are the most interesting, they are responsible for saliency-aware compression:
--saliencyspecifies a path to a video with saliency of source video, the more bright pixels the more bitrate they will get;
--saliency-bitratespecify how much bitrate salient areas will get, in this example 25% of the most salient pixels will get 40% of the bitrate;
- you can find more information about these parameters in
x264.exe --help-> section
How it works
You could read explanation of the algorithm in the original article "A semiautomatic saliency model and its application to video compression". The paper is available here.
More details are available at project page.