[FFmpeg-user] FFV1 multi-pass: Could not allocate file buffer

Peter B. pb at das-werkstatt.com
Tue Oct 22 13:41:36 CEST 2013


Quoting Carl Eugen Hoyos <cehoyos at ag.or.at>:

> This is the relevant code:
>     *size = ftell(f);
> ...
>     *bufptr = av_malloc(*size + 1);
>     if (!*bufptr) {
>         av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");

Thanks!
Happy to see that you also point to the that piece of code. I already  
looked at it when searching for more information about what throws  
this error message.

Unfortunately, I'm not C-experienced enough to tell what "ftell()"  
actually returns in that case. It's not the filesize (which is what I  
first assumed), but in ftell's reference it says:

"Get current position in stream
Returns the current value of the position indicator of the stream.
For binary streams, this is the number of bytes from the beginning of  
the file."


> I wonder if there is anyrhing we can do...
> (But you could increase ram.)

Increasing the RAM on our machines (yes, more than one) would seem  
more like a workaround. Especially, considering that this video is  
rather "small" (18.2 GiB for 4h), compared to analog-captured VHS  
material with around 100 GiB for 4h.

:(

Maybe pass-logfiles of this size are just so rare that noone ever ran  
into allocation issues of large files?
Could the allocation mode be changed?


> Allocating 1.6G should be possible with the code in
> libavutil/mem.c (at least from a quick look).

The 1.6 GiB pass-logfile is the one that does work.
It wouldn't surprise me, since the machine I tested that on has 8 GiB of RAM.


> What does free report on your system?
> Is this 32 or 64bit?

All systems I tested this on were 64bit Xubuntu GNU/Linux.
When should I execute "free" for this:
Before, after or during execution of the 2nd pass?


Thank you very much for your help,
Pb



More information about the ffmpeg-user mailing list