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 > MPEG-4 AVC / H.264
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th October 2010, 15:58   #1  |  Link
Klagar
Registered User
 
Klagar's Avatar
 
Join Date: Sep 2010
Posts: 46
FFMPEG -me_method definitions

Hi !

One of the many parameters in FFMPEG is the -me_method, which is set to determine the Motion Estimation method used in encoding. But I can't seem to find nowhere (other forums, wikipedia, what-have-you) the definitions of the various methods available. Could anyone enlighten me on the subject ?

Here is the list of available methods and their short description from the mencoder's manual :

zero : zero motion estimation (fastest)
full : full motion estimation (slowest)
epzs : EPZS motion estimation (default)
esa : esa motion estimation (alias for full)
tesa : tesa motion estimation
dia : dia motion estimation (alias for epzs)
log : log motion estimation
phods : phods motion estimation
x1 : X1 motion estimation
hex : hex motion estimation
umh : umh motion estimation
iter : iter motion estimation

They are supposedly ordered from lowest to highest quality.

If anyone can provide me insight on the basic workings of any one (or many) of these methods and how they affect encoding concretely, I'd be a happy guy !
But please, if anyone is to tell me that learning the inner details of the thing is pointless, provide me with some reason for it ; it just doesn't suit me to refuse to learn something on the grounds that "somebody told me it wasn't altogether that important".

Thanks as always !
Klagar is offline   Reply With Quote
Old 4th October 2010, 20:55   #2  |  Link
AlekseiV
Registered User
 
Join Date: Jan 2010
Posts: 92
Quote:
Originally Posted by Klagar View Post
They are supposedly ordered from lowest to highest quality.
nope, that's an unordered list

x264's ME methods in order from best quality to worst:
SATD Exhaustive (tesa)
Exhaustive (esa/full)
Uneven Multi-Hex (umh)
Hexagon (hex)
Diamond (dia/epzs)


can't tell you more than that (since that's all i know), hopefully that helps you do something
AlekseiV is offline   Reply With Quote
Old 4th October 2010, 20:58   #3  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Do not attempt to mess with -me_method and -dia_size in ffmpeg's mpegvideo encoder. There be dragons.
Dark Shikari is offline   Reply With Quote
Old 6th October 2010, 16:30   #4  |  Link
Klagar
Registered User
 
Klagar's Avatar
 
Join Date: Sep 2010
Posts: 46
@Dark Shikari : Can you tell me why exactly ? There must have been some use for these parameters if they ever decided to implement them to begin with, no ?
@AlekseiV : Thanks for the alternate listing. I'll make sure to run some tests to see if it matches my results (though personally I would trust your list over the mencoder's any day of the week)...
Klagar is offline   Reply With Quote
Old 6th October 2010, 19:37   #5  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Quote:
Originally Posted by Klagar View Post
@Dark Shikari : Can you tell me why exactly ? There must have been some use for these parameters if they ever decided to implement them to begin with, no ?
Here is a classic quote from his reply to comments on his diary:
"-dia_size 1040 means “exhaustive search of radius 16″, or in x264, –me esa –merange 16"
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 6th October 2010, 21:40   #6  |  Link
Klagar
Registered User
 
Klagar's Avatar
 
Join Date: Sep 2010
Posts: 46
Would that mean that -dia_size 520 means exhaustive search of radius 8 ?
Klagar is offline   Reply With Quote
Old 7th October 2010, 09:47   #7  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Quote:
Originally Posted by Klagar View Post
Would that mean that -dia_size 520 means exhaustive search of radius 8 ?
No, I think it's more likely to try something else with a radius of 8. The upper bits seem to be some kind of bizarre undocumented flags.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 7th October 2010, 09:59   #8  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Klagar View Post
Would that mean that -dia_size 520 means exhaustive search of radius 8 ?
No. That means that a dragon comes out and eats you.

(The only safe way to understand the mpegvideo internals is to read the source. This protects you from dragons. Mostly.)
Dark Shikari is offline   Reply With Quote
Old 7th October 2010, 13:41   #9  |  Link
Klagar
Registered User
 
Klagar's Avatar
 
Join Date: Sep 2010
Posts: 46
But I liiiiiiiiiiiiiiiiiiiike dragons !!!!
Why are there so many parameters in FFMPEG that nobody can even understand, let alone explain to anyone else ? If there were one or two, I'd understand, but... soooo many ???
Klagar is offline   Reply With Quote
Old 7th October 2010, 15:18   #10  |  Link
AlekseiV
Registered User
 
Join Date: Jan 2010
Posts: 92
It's open source. Open source doesn't go in for easy-to-use user interfaces.

(It's a very large open source project.)
(ffmpeg actually has the worst documentation/UI of any program I've ever seen)
AlekseiV is offline   Reply With Quote
Old 7th October 2010, 15:37   #11  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by AlekseiV View Post
It's open source. Open source doesn't go in for easy-to-use user interfaces.

(It's a very large open source project.)
(ffmpeg actually has the worst documentation/UI of any program I've ever seen)
I'd say it's moreso due to the fact that bikeshed discussions make fixing the interface very difficult, combined with the fact that mpegvideo doesn't really have any active maintainers and has kind of just accumulated over the years.
Dark Shikari is offline   Reply With Quote
Old 7th October 2010, 17:41   #12  |  Link
jethro
Registered User
 
Join Date: Mar 2006
Posts: 102
Found on FFMPEG-devel

Code:
> >>
> >>>  if(c->dia_size==-1)             ==> funny_diamond_search
> >>>  else if(c->dia_size<-1)       ==> sab_diamond_search
> >>>  else if(c->dia_size<2)        ==> small_diamond_search
> >>>  else if(c->dia_size>1024) ==> full_search
> >>>  else if(c->dia_size>768)    ==> umh_search
> >>>  else if(c->dia_size>512)    ==> hex_search
> >>>  else if(c->dia_size>256)    ==> l2s_dia_search
> >>>  else                                        ==> var_diamond_search
jethro is offline   Reply With Quote
Old 7th October 2010, 17:55   #13  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
log, phods, and x1 don't exist. I'm not sure if they ever were implemented; if so, they've long since been deleted as obsolete. But they haven't been removed from the public API because that wouldn't be backwards compatible.
akupenguin is offline   Reply With Quote
Reply

Tags
encoding, estimation, ffmpeg, motion, video


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:31.


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