[FFmpeg-devel] two-pass-stats with x264

Thorsten Jordan tjordan
Wed Nov 14 09:28:58 CET 2007


some more questions to the public:

It is impossible to use the normal AVCodecContext.stats_in/stats_out
values to get 2-pass statistics to x264 and back, because x264 always
writes them to a file itself.

I would need to define that filename (not for the exact name, but the
path prefix! doing chdir() temporarily wont do it) and this isn't possible.

Possible solutions:

1) put a filename to AVCodecContext.stats_in for both passes and let
libx264.c set up the filename from that when flags PASS1/PASS2 are used
and codec is h264. Hackish though...

2) put a new attribute to AVCodecContext "const char* stats_filename" to
transport that information (together with a new flag). Used for x264 encode

2)b) same as 2) but when this technique is used let avcodec handle the
file itself (like x264). Using standard-C-lib fopen/fprintf/fscanf etc.
Would probably need another new member for the file handle.

Now the questions: would any of these solutions have a chance to get
accepted? or this is of too low public interest or too hackish?

Thanks for feedback...

Greetings, Thorsten

More information about the ffmpeg-devel mailing list