Log in

View Full Version : FFMPEG -me_method definitions


Klagar
4th October 2010, 15:58
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 ! :)

AlekseiV
4th October 2010, 20:55
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

Dark Shikari
4th October 2010, 20:58
Do not attempt to mess with -me_method and -dia_size in ffmpeg's mpegvideo encoder. There be dragons.

Klagar
6th October 2010, 16:30
@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)... :)

J_Darnley
6th October 2010, 19:37
@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 (http://x264dev.multimedia.cx/archives/102#comment-1094) on his diary:
"-dia_size 1040 means “exhaustive search of radius 16″, or in x264, –me esa –merange 16"

Klagar
6th October 2010, 21:40
Would that mean that -dia_size 520 means exhaustive search of radius 8 ?

J_Darnley
7th October 2010, 09:47
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.

Dark Shikari
7th October 2010, 09:59
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.)

Klagar
7th October 2010, 13:41
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 ???

AlekseiV
7th October 2010, 15:18
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)

Dark Shikari
7th October 2010, 15:37
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.

jethro
7th October 2010, 17:41
Found on FFMPEG-devel


> >>
> >>> 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

akupenguin
7th October 2010, 17:55
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.