digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Mimicking Motion Adaptiveness blur with Mencoder. (http://www.digitalfaq.com/archives/encode/10063-mimicking-motion-adaptiveness.html)

kwag 06-03-2004 08:43 PM

Mimicking Motion Adaptiveness blur with Mencoder.
 
@All,

This is still experimental, but here's the first version, which I've been playing for the last couple of hours, and it seems to be doing it's job :)
The functions used are shape adaptive blur

Here's your filter line, suitable for DVD encodings:

hqdn3d,sab=0.5:0.5:1,noise=3th

Note:
That's line goes AFTER your scaling and cropping commands, and BEFORE the final expand command.

When I finish optimizing the values, I'll post it on the optimal script section, just like the MA script posts.
In the mean time, have fun, and post your comments here :!:

Questions :?:
RTFM ;)
http://www.mplayerhq.hu/DOCS/man/en/manpage.html#GENERAL%20ENCODING%20OPTIONS%20(MENCO DER%20ONLY)


-kwag

maurus 06-04-2004 06:13 AM

We remove also the current two unsharp filters?

-Maurus

Dialhot 06-04-2004 06:27 AM

You do noise on Chroma also ? Won't this be noticiable ?
Eye is far more sensitive to noise in chroma than in luma.

kwag 06-04-2004 09:27 AM

@Maurus,

It's already been taken care of, by the shape adaptive blur and the smart blur.
It basically does the same as unsharp, but more efficiently, because shape adaptive blur is not static, but dynamic (adaptive).

@Phil,
Yes, but the noise level is so low that it can barely be seen by the eye. But the noise on the luma+chroma channels gave me a more flat Q curve, that when applying luma noise only.
Do a small sample, and check it with Bitrate Viewer. You should see a more flat qreen line.

-kwag

incredible 06-04-2004 12:21 PM

Quote:

Originally Posted by kwag
Do a small sample, and check it with Bitrate Viewer. You should see a more flat qreen line.

Does that mean also a higher Q on dark parts where these parts "before" ading the chroma-noise ended up in lower Q. As this would be risky on underwater parts.

If not that would mean the average of the Q is rised a minimal bit (just IMHO!).

So a flat Q curve is not the factor on which we should end up, more Q dynamic means less bitrate chaotic-dynamics as the encoder gots room to breath in its quantisation which "would" calm the Bitrate dynamic a little IMHO :)

kwag 06-04-2004 01:10 PM

@Inc,

Yes indeed, the bitrate is more balanced and distributed.

@All,

I've been doing some serious reading and parameter optimizing, and here's my latest stuff (not final yet!, and probably never will :lol:).

Following are two samples, one 704x480 at an average bitrate of 698Kbps, and another sample, also 704x480 but target average bitrate of ~6,000Kbps, which in reality came out to 1,437Kbps, because quality factor was fulfilled by the encoder, and no need to go higher in bitrate. Both are from the same "Red Planet" test clip, for consistency. Average bitrate measured with Vdub, because average given by Bitrate Viewer is always incorrect (gives lower values).

672Kbps (Real 698Kbps) average bitrate graph:

http://www.digitalfaq.com/archives/i.../2004/06/5.png
Sample here:
http://s2.yousendit.com/d.aspx?id=BF...A956C60D831C05



1,340Kbps (Real 1,437Kbps) average bitrate graph:

http://www.digitalfaq.com/archives/i.../2004/06/6.png
Sample here:
http://s2.yousendit.com/d.aspx?id=47...C50CDBB2CA6261

And here are the settings used for the samples:

Code:

hqdn3d=2:2:2,sab=1:1:8,smartblur=.5:.5:20,noise=3th:3th
And the common encoding parameters:
Code:

lavcopts=vcodec=mpeg2video:vstrict=-1:vmax_b_frames=2:vrc_maxrate=9800:aspect=1.3333:keyint=18:vrc_buf_size=1835:preme=2:precmp=2:autoaspect=1:vrc_eq=tex:scplx_mask=0.01:vqmin=2:mbqmin=1:lmin=0.01
Both samples were encoded using a set MAX bitrate limit of 9,800Kbps.
The small sample had set 700Kbps as vbitrate and the large sample had 6,000Kbps set as vbitrate.
For obvious reasons, filtering, the peak bitrates can't reach higher values, because the material is being blured on motion areas, in a similar way like the MA script. Actually the blur is on objects, so it's not on the complete picture, which is really what we want.
But the results I got with these values, could be the bitrate normalization that we are all looking for ;)

-kwag

Prodater64 06-04-2004 01:49 PM

@Kwag: Are these parameters for DVDs sources, AVIs sources or both?


--------------------------
Visit: Intermediate guide: MencodeMe/Win32 - Avisynth - MakeAvis by Prodater64.
Visit: KVCD - MencodeMe - Auxiliar Task - KVCD Docking Gate by Prodater64.
Visit: Mencoder scripting with AVSEdit and Guide for Multiple Files by Prodater64.
Visit: Mini-guide quick and easy - DVD to (S)KVCD with MencodeMe by Maurus.
Visit: Mencode-me: a newbie oriented GUI - 0.23 is out! by VMesquita.
--------------------------

http://www.digitalfaq.com/archives/error.gif

incredible 06-04-2004 02:05 PM

Kwag, why did you set Vqmin=2???
Ok, the manual says dont go under but as we figured out a vqmin=2 would result in blocks on dark underwater scenes for instance as the quantizer wont go under the q=2 limit (vqmin) on these scenes and mencoder on these scenes at q=2 produces blocks!

Try one at vqmin=1 (for shure) and lmin=0.1 (play with lmin) and tell me your results


EDIT:
Yep as I did assume, i saw the 670kbit one and it gots a lot of blocks especially in dark areas thats cause of an average Q of 5!!

The high avg sample still gots blocks on dark scenes as you set vqmin=2 and cause of the "flat" q curve.

The high one you could encode only using vqscale=2 that would be the same :)

kwag 06-04-2004 02:33 PM

Quote:

Originally Posted by Prodater64
@Kwag: Are these parameters for DVDs sources, AVIs sources or both?

From the first post: "Here's your filter line, suitable for DVD encoding" ;)

-kwag

kwag 06-04-2004 02:52 PM

Quote:

Originally Posted by incredible
Kwag, why did you set Vqmin=2???

It happens when a finger hits the incorrect key :!: :x
Thanks for pointing it out. It should be 1, not 2.
All other parameters are correct. I just verified them.

-kwag

kwag 06-04-2004 03:14 PM

Much better :)
This is from another encode (The first 3 minutes of "Space Cowboys" )

http://www.digitalfaq.com/archives/i.../2004/06/7.png

Dialhot 06-04-2004 04:33 PM

Quote:

Originally Posted by kwag

----
A link is valid for 7 days or 25 downloads, whichever occurs first.
Once the link expires, the file is automatically deleted and cannot
be recovered
----

That is what I just downloaded from the link above. Now we have the answer to "how much time a link can be DLed".

kwag 06-04-2004 04:45 PM

It would be great if everyone that downloads it, automatically puts it on the E-Mule "Incomming" folder. That way, we automatically start sharing sample files :)
W can use the site 'yousendit.com" as initial distribution, and then all (most?) people that download it, share it :!:

-kwag

Dialhot 06-04-2004 04:56 PM

It would be great if ytou can check in you waiting queue and set me as a friend. You sent me only 138KB before dropping me of your DL queue :-)

Prodater64 06-04-2004 06:03 PM

Quote:

Originally Posted by kwag
It would be great if everyone that downloads it, automatically puts it on the E-Mule "Incomming" folder. That way, we automatically start sharing sample files :)
W can use the site 'yousendit.com" as initial distribution, and then all (most?) people that download it, share it :!:

-kwag

I like that idea. I'm downloading just now.


--------------------------
Visit: Intermediate guide: MencodeMe/Win32 - Avisynth - MakeAvis by Prodater64.
Visit: KVCD - MencodeMe - Auxiliar Task - KVCD Docking Gate by Prodater64.
Visit: Mencoder scripting with AVSEdit and Guide for Multiple Files by Prodater64.
Visit: Mini-guide quick and easy - DVD to (S)KVCD with MencodeMe by Maurus.
Visit: Mencode-me: a newbie oriented GUI - 0.23 is out! by VMesquita.
--------------------------

http://www.digitalfaq.com/archives/error.gif

audioslave 06-04-2004 10:46 PM

@kwag
This is great! :D I was wondering if you could post your complete command line, please? Your 2 pass *.bat with this new MA routine...

BTW How much do the 2 methods of encoding (With MA/No MA) differ in time? In other words: Is the line with the MA mimicking much slower?

kwag 06-05-2004 12:40 AM

Quote:

Originally Posted by audioslave
@kwag
This is great! :D I was wondering if you could post your complete command line, please? Your 2 pass *.bat with this new MA routine...

Hi audioslave,

Just put the filter line I posted above, between the crop, scale and expand.
My resizing values won't make sense to you, because they are different for every movie. Use PackShot or MencodeME to get your initial configuration file, and then edit the file with the parameters I posted above. All samples were 2-pass.
Quote:


BTW How much do the 2 methods of encoding (With MA/No MA) differ in time?
It's much slower with the adaptive filters, just as it is with the MA script.
Quote:

In other words: Is the line with the MA mimicking much slower?
Yes it is. By about half :!:

-kwag

Dialhot 06-05-2004 02:57 AM

Quote:

Originally Posted by kwag
Yes it is. By about half :!:

If you want an other option that will divide the speed again by 2, use -mbd=2

I'm curious about the result on the bitrate but I don't have the time to test it (btw if someone can share a source sample he use for its test, I can't find any that gives me enought underflowbuffer to do some research on how tp avoid them).

Koekies 06-06-2004 06:17 AM

I just encoded a movie with the mencoder pre alpha build and your filter the quality is great the bitrate is just way to low :S and the noise=3th didn't seem to work. And I made a couple of mistakes it turned into a 720x480 movie and I don't know why can anybody tell me what I've done wrong.
Thanks in advance

batfile
Code:

Mencoder.exe -include temp.conf -lavcopts vbitrate=796:vpass=1 "C:\CI3\VIDEO_TS\VTS_01_1.VOB" -o "C:\CI3\VIDEO_TS\VTS_01_1.m2v"
Mencoder.exe -include temp.conf -lavcopts vbitrate=796:vpass=2 "C:\CI3\VIDEO_TS\VTS_01_1.VOB" -o "C:\CI3\VIDEO_TS\VTS_01_1.m2v"
pulldown.exe "C:\CI3\VIDEO_TS\VTS_01_1.m2v" "C:\CI3\VIDEO_TS\film.m2v" -framerate 23.976 -prog_seq p prog_frames -drop_frame true

conf file
Code:

vf=kerndeint=15:0:1yuvcsp,pullup,softskip,scale=720:480::0:9,crop=672:378:24:16,hqdn3d=2:2:2,sab=1:1:8,smartblur=.5:.5:20,noise=3th:3th,expand=704:480
of=rawvideo=1
ovc=lavc=1
nosound=1
sws=9

lavcopts=vcodec=mpeg2video:vstrict=-1:vmax_b_frames=2:vrc_maxrate=2200:aspect=1.3333:keyint=18:vrc_buf_size=1835:preme=2:precmp=2:autoaspect=1:vrc_eq=tex:scplx_mask=0.01:vqmin=1:mbqmin=1:lmin=0.01:
intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79:
inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44
ofps=23.976

Oke nevermind the bitrate that was my mistake :oops: but can anybody tell me why its 720x480?

Prodater64 06-06-2004 06:35 AM

Quote:

Originally Posted by Koekies
...
conf file
Code:

vf=kerndeint=15:0:1yuvcsp,pullup,softskip,scale=720:480::0:9,crop=672:378:24:16,hqdn3d=2:2:2,sab=1:1:8,smartblur=.5:.5:20,noise=3th:3th,expand=704:480
of=rawvideo=1
ovc=lavc=1
nosound=1
sws=9

lavcopts=vcodec=mpeg2video:vstrict=-1:vmax_b_frames=2:vrc_maxrate=2200:aspect=1.3333:keyint=18:vrc_buf_size=1835:preme=2:precmp=2:autoaspect=1:vrc_eq=tex:scplx_mask=0.01:vqmin=1:mbqmin=1:lmin=0.01:
intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79:
inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44
ofps=23.976

Oke nevermind the bitrate that was my mistake :oops: but can anybody tell me why its 720x480?

Hi:
Maybe
Quote:

vf=kerndeint=15:0:1,yuvcsp,...

--------------------------
Visit: Intermediate guide: MencodeMe/Win32 - Avisynth - MakeAvis by Prodater64.
Visit: KVCD - MencodeMe - Auxiliar Task - KVCD Docking Gate by Prodater64.
Visit: Mencoder scripting with AVSEdit and Guide for Multiple Files by Prodater64.
Visit: Mini-guide quick and easy - DVD to (S)KVCD with MencodeMe by Maurus.
Visit: Mencode-me: a newbie oriented GUI - 0.23 is out! by VMesquita.
--------------------------

http://www.digitalfaq.com/archives/error.gif


All times are GMT -5. The time now is 04:25 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.