News:

--

Main Menu

XviD aspect bugs ?

Started by kapetr, January 19, 2015, 12:00:17 PM

Previous topic - Next topic

Jan Gruuthuse

@kapetr: perhaps a rename of thread should be appropriate? A more fitting header?

kapetr

Quote from: poutnik on February 07, 2015, 07:28:10 AM4
You want constant size, not constant quality, so you use ABR. But you use Q limitation. so you do not want constant size either. Your goal is not clear. 
My goal is all time the same - to set upper limit of size. I have e.g. +- 4000kb/s mpeg2 source and I want "invest" maximally e.g. 1200 kb/s of target ABR. The target may be smaller - but if not and I get better quality then expected = no problem. But I do not want to get e.g. 2000 kb/s or even more. It has no sense for me to transcode and get just small  saving of space.
Is it now clear ?

And till now I have get no approach how to get what I want with CRF.

P.S.: thanks for anchors - will take a look

kapetr

#77
Quote from: Jan Gruuthuse on February 07, 2015, 04:33:47 PM
@kapetr: perhaps a rename of thread should be appropriate? A more fitting header?
Better to split it. Maybe some of Avidemux could see original topic to make changes to Avidemux.
But I don't know how to split. I you can - then it would by fine - I thing from Reply #45 (or #50). Thanks.

poutnik

Aside of conditional de-interlacing, light filtering and resizing, my goal is similar to your one.

But I guess your goal is  not just to make the size smaller, but also to keep quality above acceptable level.
ABR goes partially against your goal, as it sets not only maximum but also minimum bitrate ( putting aside Q limitation now ), ignoring quality levels.
Q limitation ignores visual quality levels as well, as it depends on video.

With near the same resolution ( 848x576 is 100.3% of 704x576 ) as original and CRF26, I get by rule of thumb usually 1/4-1/3 of original MPEG2 bitrate.
Note that some channels like CT2 have 3500-4000 kb/s , while for others like Prima ZOOM have usual bitrate even about 2500 kb/s.
For 2500 MPEG2 is 1500 H264 rather overkill.

Try for video sample a set of CRF numbers, and choose the one with optimal trade off between subjective visual quality and size.
Than keep this CRF for all your encoding.

I got for CRF26 typically 500-1400 kb/s. The question is. if your  maximum target is "maximal average bitrate" or "average average bitrate" ?
In my humble opinion, the more reasonable is the latter.
The latter for CRF26 may be about 800-900 kb/s.

If I were you, I would try CRF26 as first guess. IF you get for a serie of encodings avg bitrate too low, you may increase it or vice versa.
Remember the rule of thumb CRF difference 6 make size ratio about 1 : 2 
( Note that it is exponential , so CRF increment make size smaller  typically by 12%)

kapetr

#79
Quote from: poutnik on February 08, 2015, 12:44:18 PM
I got for CRF26 typically 500-1400 kb/s. The question is. if your  maximum target is "maximal average bitrate" or "average average bitrate" ?
In my humble opinion, the more reasonable is the latter.
The latter for CRF26 may be about 800-900 kb/s.

I thing you talk about a point I had want discuss too. I do not understand, why ADM in "encoding status windows" uses designation "average bitrate". I thing it shows ABR for a very small time interval (? 1s) - thus it would be "more true" to name it "current bitrate".

I have mean of course (using your words) "average average bitrate"  - I mean ABR of whole video..
If I use e.g. ABR 1200 => the indicated bitrate is sometimes even over 3500kb/s, sometimes under 100kb/s.

Note - as I wrote - I have no problem (I'm glad), if target video has better quality. Only what I want is not to exceed selected ABR. With CRF I would get sometimes smaller files - but they would be worser.
I still thing that ABR with Q limits is simpler and safer way to reach what I want in 1-pass encoding.

You prefer constant quality - that is good thing. But you get with CRF for difficult video bigger ABR then I would accept and for simple video smaller ABR, but you pay with worse quality.

[Jinak Ã...â,,¢eÃ,,eno: mÃ...¯Ã...¾u sice vysledovat CRF tak, aby ABR nepÃ...â,,¢ekraÃ,,ovalo tÃ...â,,¢eba 1200kb/s (pro videa nároÃ,,ná na kompresi), ale pak pÃ...â,,¢i tomto CRF budu koukat (v pÃ...â,,¢ÃƒÂ­padÃ,,› dobÃ...â,,¢e komprimovatelných videí) na stejnÃ,,› "zmrÃ...¡ená" videa pÃ...â,,¢i bitrate (sice jen) 400kb/s, aÃ,,koli jsem byl ochoten investovat 1200kb/s a mohl tak mít kvalitu mnohem lepÃ...¡Ã­. A já k tomu navíc pÃ...â,,¢idávám tu limitaci Q, aby nedocházelo k pouÃ...¾ití nesmyslnÃ,,› nízkých Q, resp. tak vysokých, Ã...¾e by jiÃ...¾ kvalita nebyla akceptovatelná. Zejm. tím dolním limitem pak mohu "naÃ...¡etÃ...â,,¢it" bitrate pro nároÃ,,né úseky - kodér je myslím dost inteligentní a i nad rámec bufferu ví, Ã...¾e má naÃ...¡etÃ...â,,¢eno a mÃ...¯Ã...¾e tedy v pÃ...â,,¢ÃƒÂ­padÃ,,› nutnosti pouÃ...¾Ã­t vyÃ...¡Ã...¡Ã­ bitrate déle.]

To get best for size-money is of course 2-pass encoding. But it is time expensive. The ABR+Qlimits approach is of course not as good as, but in most cases good enough (for my case of usage).

poutnik

#80
Quote from: kapetr on February 08, 2015, 07:15:09 PMI thing you talk about a point I had want discuss too. I do not understand, why ADM in "encoding status windows" uses designation "average bitrate". I thing it shows ABR for a very small time interval (? 1s) - thus it would be "more true" to name it "current bitrate".

It seems to be 1s bitrate average, what is rather useless information.

QuoteI have mean of course (using your words) "average average bitrate"  - I mean ABR of whole video..
If I use e.g. ABR 1200 => the indicated bitrate is sometimes even over 3500kb/s, sometimes under 100kb/s.

No, by "average average bitrate" (AABR) I mean average bitrate of average bitrates of all videos in storage. By "maximal average bitrate" (MABR) I mean maximal acceptable average bitrate for 1 video. :-)  I think your real goal is to have AABR not higher then 1500 kb/s.

CRF will you provide you for the same AABR better quality for complex videos than ABR,
while it safes bitrate on low complex videos where your eyes would not appreciate extra quality.

Another option for you is to set bitrate variance of ABR - MeGUI name, in ADM it is called Average bitrate tolerance on Quantizer tab of X264 settings.  MeGUI has for it default value 1%, what is quite strict, good for streaming, bad for scene adaptation. I would try to use 20-40%. ADM has as default 100%, what leads me to suspicion it may have little different meaning. MeGUI hints say 0% means strict average bitrate, while 100% rathe constant quantizer.

QuoteNote - as I wrote - I have no problem (I'm glad), if target video has better quality. Only what I want is not to exceed selected ABR. With CRF I would get sometimes smaller files - but they would be worser. I still thing that ABR with Q limits is simpler and safer way to reach what I want in 1-pass encoding.

You prefer constant quality - that is good thing. But you get with CRF for difficult video bigger ABR then I would accept and for simple video smaller ABR, but you pay with worse quality.
Simple and safer way is to use ABR tolerance parameter.

I do not understand why you do not want to accept lower AABR with occational bigger MABR ? IMHO it is good business.  Do you say you prefer accepting rather bad quality but not crossing your target ? CRF will give you better quality with the same AABR. You scarify quality of complex videos to waste it on simple videos where you will not notice it.

Hm, pokud Ti vyhovuje kvalita bitrate 1500 kb pro narocna videa, vyhovuje Ti kvalita i CRF26, u kterehoz jsem mel max 1450. A pokud Ti vyhovuje tato kvalita pri CRF26 u narocnych videi, vyhovuje Ti take u jednoduchych, kde Ti staci treba jen 500. A kdyz to zvednes treba na CRF24, budes mit treba 600-1800, s prumerem treba 1100-1200,
s kvalitou vyssi nez s ABR a AABR nizsi nez s ABR

--EN version of above-
If quality of bitrate 1500 for xomplex video is acceptable for you, is acceptable even CRF26, where are observed maximum 1450. ( Note that with the same bitrate CRF mode provide always better quality than ABR ). And if the quality is acceptable for complex vide, is acceptable for simple video as well, where 500 is sufficient. And if you raise quality to CRF24, you will get estimated bitrate variability 600-1800, wit average about 1100-1200. With quality better than with ABR and with A-ABR smaller than with ABR.
--------
QuoteTo get best for size-money is of course 2-pass encoding. But it is time expensive. The ABR+Qlimits approach is of course not as good as, but in most cases good enough (for my case of usage).
CRF gives the same best for the size as the 2-pass ABR encoding, if you choose in 2pass the size of CRF encoding. But it is not the case of 1pass ABR. 1pass ABR rate control is  worse than 2pass ABR rate control. Generally, ABR has sense only if you must fit particular size, or streaming bandwidth. ( together with VBV )

The ABR rate control buffer is relatively short for 1pass ABR. If the video complexity is more or less constant, it gives comparable results as the same size CRF or 2pass ABR. But if video complexity changes are significant and last longer than few seconds, 1pass ABR adapts quantizers to keep the bitrate. I have read somewhere 1pass ABR control  rate buffer frame size = sqrt ( processed frames ). So for 60 min video it is sqrt(90000)=300, i.e. 12 s for 25 fps. 

Note that the encoder does not know the total length of the movie in 1pass encoding.

poutnik

#81
As illustration of Effect of ABR with bitrate variance, here are 3 bitrate profiles:

The upper chart belongs to video encoded as CRF26, with one of the highest bitrates I noticed - 1421 bp/s
The middle chart belongs to the same video encoded as ABR 1421 bp/s at MeGUI default bitrate variance 1%.
The bottom chart belongs to the same video encoded as ABR 1421 bp/s, bit wit bitrate variance 40%.

Note that bitrate profile of the 2nd ABR is much closer to the one of CRF26.


kapetr

#82
QuoteNo, by "average average bitrate" (AABR) I mean average bitrate of average bitrates of all videos in storage. By "maximal average bitrate" (MABR) I mean maximal acceptable average bitrate for 1 video. :-)  I think your real goal is to have AABR not higher then 1500 kb/s.
No - My goal is AABR=MABR=1500kb/s. (Velmi zjednoduÃ...¡enÃ,,› Ã...â,,¢eÃ,,eno. Videa pÃ...â,,¢ibývají, maÃ...¾ou se, ... TakÃ...¾e kódovat s kalkulací nÃ,,›jakémo AABR pro fleÃ...¡ku je uÃ...¾ z principu nesmysl.)

Quote from: poutnik on February 09, 2015, 07:51:23 AM
Hm, pokud Ti vyhovuje kvalita bitrate 1500 kb pro narocna videa, vyhovuje Ti kvalita i CRF26, u kterehoz jsem mel max 1450. A pokud Ti vyhovuje tato kvalita pri CRF26 u narocnych videi, vyhovuje Ti take u jednoduchych, kde Ti staci treba jen 500. A kdyz to zvednes treba na CRF24, budes mit treba 600-1800, s prumerem treba 1100-1200,
s kvalitou vyssi nez s ABR a AABR nizsi nez s ABR

Ne, stále mi nerozumíÃ...¡ - neÃ...â,,¢ÃƒÂ­kám, Ã...¾e mnÃ,,› 1500kb/s u "nároÃ,,ného" videa nÃ,,›jak extra vyhovuje. Jen je snesitelné - za cenu, jiÃ...¾ jsem ochoten zaplatit. Tím pádem u "nenároÃ,,ného" videa dostanu za investovanou Ã,,Ã¡stku 1500kb/s lepÃ...¡Ã­ kvalitu, neÃ...¾ mi dá CRF - 500kb/s.
Jak jsem uvedl - náÃ...¡ pÃ...â,,¢ÃƒÂ­stup se liÃ...¡Ã­ - ty chceÃ...¡ konst. kvalitu, já konstantní ABR (pÃ...â,,¢esnÃ,,›ji Ã...â,,¢eÃ,,eno - konstantní úsporu cíl/zdroj).

poutnik

#83
Ne, Tvým cílem je úspora místa, a dÃ,,›láÃ...¡ to velmi neefektivním zpÃ...¯sobem. 

Radeji vyplacas bitrate tam, kde to nepoznas, abys pak skudlil tam, kde to poznas, misto naopak.
To plati jednak pro srovnani videi mezi sebou, druhak tez v ramci jednoho videa a malou ABR bitrate variance.
Dost nelogicke.

MenÃ...¡Ã­ ale konstantní úspora s  velmi promÃ,,›nlivou kvalitou je podle Tebe lepÃ...¡Ã­
neÃ...¾ vÃ,,›tÃ...¡Ã­, ale variabilní  úspora s vyrovnanou a celkove lepsi kvalitou.

Na fleshku se vejde klidne 20 filmu, a tam o AABR lze mluvit docela dobre.
Takze misto 20 filmu s ABR 1500 s kvalitou velmi kolisavou se ti tam vejde s CRF24 treba 25,
s kvalitou vyrovnanou a celkove lepsi.

Tuhle jsem vcera vyrobil s CRF26 velmi pekne dokumentarni video s BR cca 550 kb/s
dokonce s doublerate 50 fps ( MeGUI QTGMC script )

---- Added EN translation for general audience --------

No. Your goal is space saving, and you do it by very ineffective way.

You prefer wasting of bitrate on places where you will not notice it, to have to save it, where you will notice it, instead of the opposite. It is valid for both comparison between videos and as well within the same video ( in case of low ABR tolerance value ). Quite illogical.

You suppose smaller, but constant space saving with very variable quality is better, than bigger, but variable space saving with balanced and overall better quality.

Flash storage can hold easily up to 20 videos, so talking A-ABR makes good sense. Instead of 20 videos with ABR1500 with very variable quality, you may fit it with about 25 videos encoded by CRF24. with balanced and overall better quality.

Just as example, yesterday I have made with CRF26 very good documentary video with bitrate about 550 kb/s, even with doublerate 50 fps via Avisynth script QTGMC ( in MeGUI ).


Jan Gruuthuse

Why switching to Czech language? Not very polite to your host! Kindly hold your MeGUI discussions somewhere else.

poutnik

#85
I have just reacted to czech post portions, as KaPetr has obvious difficulties with English. In fact, I almost never know if I read/write in Czech or English. Original intentions was not to have it all in Czech, but once written, I have let it so.

It is not MeGUI discussion, but discussion related to optimal X264 usage in ADM. The fact I use X264 mainly in MeGUI is irrelevant, as the principles are front-end independent. QTGMC script is not MeGUI script, but Avisynth script, usable by ADM via AVS proxy, AFAIK even in Linux under Wine . I mentioned both just as a side note in X264 rate control context.

So, unless usage of ADM is to be degraded to being just a TS/H264 cutter, it is still ADM relevant.

Jan Gruuthuse

As most of us are not fluent in Czech, even google isn't, there is no point in posting these here.
Use PM for chat in Czech.

poutnik

#87
I have added EN translation. This approach is fully accepted in most web forums in case of issues with official language.
Aside of that, AFAIK PM does not allow attachments and adds nothing for contribution to general audience.

BTW, Forums are by their nature primarily aimed to topic discussion.
For bug reports are better suited Bug Trackers, like e.g. BTMantis.

As a note for moderators, I suggest mine and KaPetr X264 rate control related posts should be moved here :
http://avidemux.org/smuf/index.php/topic,16358.0.html

kapetr

Quote from: poutnik on February 15, 2015, 04:36:41 PM
You prefer wasting of bitrate on places where you will not notice it, to have to save it, where you will notice it, instead of the opposite. It is valid for both comparison between videos and as well within the same video ( in case of low ABR tolerance value ). Quite illogical.
I is not so.

Maybe for "difficult" video I could get better output with CRF resulting in target ABR 1200kb/s then with ABR 1200kb/s mode (also resulting in 1200kb/s ABR). That is probably true (even with Q limits).
But for more "simple" videos it gives to me better quality using ABR 1200kb/s then CRF resulting in target ABR 500 kb/s. And - even by simple video - by low 1200kb/s can be no word about wasting.

poutnik

#89
You have agreed with me in last post, even if you may do not know it yet.

As for redistribution of bitrate within a single video,  the same principles apply as well for redistribution of bitrate between different videos.

You can consider particular videos on you flash USB stick as parts of 1 supervideo, filling all your storage.

If CRF raises its avg BR from 1200 to 1800 for 1 part and decrease to 600 for other part,
it manages at the same size  constant quality as for single video,
the same noticable increase of quality in one part( compared to ABR ) as for single video
the same not noticeable decrease of quality on the other part as for single video.

It is the same as within a single video, where you have already agreed CRF would provide better quality for the same size than ABR.

This allows you for several videos together  to reach even better quality with even smaller total size.