[Libav-user] Access violation in av_opt_set

Aleksey Shubin x.morion.x at gmail.com
Fri Nov 9 03:44:22 CET 2012


I'm making changes in Windows application that uses ffmpeg API to
record video. Previously I was using Zeranoe ffmpeg builds but now I
need to compile it myself. I have managed to do it using MinGW. But
the problem is that my build produces access violation at the
following code line:

av_opt_set(codecContex->priv_data, "crf", crfString, 0);

I have checked crfString, it is "20.000000". Also checked ffmpeg code
and found that the codecContex->priv_data should be X264Context
pointer, so I included x264 headers and checked priv_data. It seems to
be valid.

Also tried to set some other options with av_opt_set ("wpredp",
"preset"). They don't produce the error but also seems not to work as
the corresponding fields of priv_data aren't changed.

With Zeranoe build this code works, so the only suggestion I have is
that something is wrong in the way I configured and build ffmpeg or
libx264. This is my configure command I used for ffmpeg and libx264:

./configure --prefix=build --enable-shared --enable-avresample
--disable-stripping --enable-libx264 --enable-encoder=libx264
--enable-gpl --enable-muxer=ismv --extra-cflags="
-I/c/Temp/FFMpeg/x264" --extra-ldflags="-L/c/Temp/FFMpeg/x264"

./configure --disable-cli --enable-shared
--extra-ldflags=-Wl,--output-def=libx264.def

Unfortunately I have very few experience in C/C++ and
configuring/building ffmpeg and don't know even the typical ways to
debug this kind of problems. So even general suggestions about a
direction at which I should investigate further could help.

Thanks,
Aleksey


More information about the Libav-user mailing list