Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th November 2015, 00:49   #1  |  Link
Xma1
Registered User
 
Join Date: Nov 2015
Posts: 1
how can you compress lossless specific area

Hi all,

I have a project where I is an important area (eg sheet of paper with the text) should compress with good quality in the HEVC video that background but with bad quality.

The range varies from frame to frame, but I know location of each area. How can I tell the HEVC where it qt is set to 0, and where it is on 51.



Best Regals
Mark Tamaev
Xma1 is offline   Reply With Quote
Old 24th November 2015, 01:01   #2  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
try zones
Quote:
--zones <zone0>/<zone1>/...


Tweak the bitrate of regions of the video. Each zone takes the form:

<start frame>,<end frame>,<option> where <option> is either q=<integer> (force QP) or b=<float> (bitrate multiplier).

If zones overlap, whichever comes later in the list takes precedence. Default none
or qpfile
Quote:
--qpfile <filename>


Specify a text file which contains frametypes and QPs for some or all frames. The format of each line is:

framenumber frametype QP

Frametype can be one of [I,i,K,P,B,b]. B is a referenced B frame, b is an unreferenced B frame. I is a keyframe (random access point) while i is an I frame that is not a keyframe (references are not broken). K implies I if closed_gop option is enabled, and i otherwise.

Specifying QP (integer) is optional, and if specified they are clamped within the encoder to qpmin/qpmax.
__________________
powered by Google Translator
Motenai Yoda is offline   Reply With Quote
Old 24th November 2015, 17:57   #3  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Motenai Yoda View Post
try zones

or qpfile
Those are per-frame settings, not to define a region in a frame.

The old VC-1 PEP/CineVision PSE had the ability to override settings per macroblock in a frame. It's not conceptually hard, but needs an API and some tweaks (potentially challenging) to the rate control algorithms).
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 24th November 2015, 18:57   #4  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
The only way to do this in x265 is to write a program to call the internal C++ API and set *quantOffsets for each frame, or to modify the command-line to read the data from a file or whatever. There's no way to do it through the standard command-line.

There may be other implementations that build in the capability, I don't know them.
foxyshadis is offline   Reply With Quote
Old 25th December 2015, 16:27   #5  |  Link
HarryM
Registered User
 
Join Date: May 2002
Location: Czech rep.
Posts: 390
If you need it - you can override it by blurring (or using another filter heavily helping to compression, etc.) of the specific area of frame. The blurred area needs logically much less bitrate.

Analogy of this, i was using at divxrip compression - main part of movie resized by lanczos, and begin/final credits by bilinear (bilinear is much more compressible than lanczos).
__________________
Czech DivX/XviD discussion club

Last edited by HarryM; 25th December 2015 at 16:32.
HarryM is offline   Reply With Quote
Old 27th December 2015, 19:46   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Also, if you have highly detailed but static elements that you want to preserve, try --cu-lossless. That will try using lossless encoding for blocks, and pick it if it has the best RDO. It should be helpful for things like line art and other synthetic areas with flat colors, sharp edges, and no noise.

@HarryM, I find area to be better than either for scaling credits for big ratios. With moving text, aliasing errors can wind up being different as sub-pixel alignment varies.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 30th December 2015, 05:44   #7  |  Link
x265_Project
Guest
 
Posts: n/a
As FoxyShadis alluded to, in the x265 API we have a feature that supports "region of interest optimization". See x265.h, line 214.

/* An array of quantizer offsets to be applied to this image during encoding.
* These are added on top of the decisions made by rateControl.
* Adaptive quantization must be enabled to use this feature. These quantizer
* offsets should be given for each 16x16 block. Behavior if quant
* offsets differ between encoding passes is undefined. */
float *quantOffsets;

We will add the capability to support this (one set of offsets for the whole encode) in the command line when we get a chance.
  Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.