[Libav-user] FFMpeg codec not found

yag at aber.ac.uk yag at aber.ac.uk
Mon Apr 16 16:57:44 CEST 2012


(I am french, sorry if there are mistakes in my sentences)

Hello,

I met troubles and I need help.
I develop a program in C++ using some libraries like OpenGL and ODE, and I
want to export a video from an animation created with OpenGL. To do that I
tried to use ffmpeg. After several problems of link of libraries (I have
to work with Fedora 16 and I used to develop programs with Visual Studio
before, so I am quite a noob with location of libraries etc.), I can
compile and execute some code using ffmpeg. To test this library, I used
this example (http://drv.nu/ffmpeg/doxygen/api-example_8c-source.html),
maybe a newer version but it's almost the same.

I get this error when launching with any codec :
Video encoding
codec not found

I did research to solve this problem but I am stuck now.
I tried to install, remove and install again the x264 library, to use the
codec CODEC_ID_H264, then configure ffmpeg with --enable-libx264 and
make+make install it. It just added linking troubles to my program, and
when it executed again it displayed the same error "codec not found".
I tried to install libraries with gpk-application interface, yum and
compile them myself.

I followed steps described here :
http://maczulu.blogspot.co.uk/2011/11/ffmpeg-install-with-libx264-h264-on.html
I think that my program use libraries located in /usr/local/, such as
ffmpeg, avcodec and x264.

I installed common codecs and I can read a .mp4 video using h264 codec
with VLC.

If you have any idea how I can find the solution please help me.

Thanks
Yannis



Here is the CMakeLists file I use to link libraries :
cmake_minimum_required(VERSION 2.8)

SET ( EXECUTABLE pippo )

#This is for heterogenous groups
#add_definitions(-D_HETERO_)

# UNCOMMENT FOR GRAPHICS
add_definitions(-D_GRAPHICS_)

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTOPENGL TRUE )
SET(  QT_USE_QTXML TRUE )
INCLUDE( ${QT_USE_FILE} )

FILE ( GLOB SOURCES ./*.cpp ./MISC/*.cpp ./CONTROLLERS/*.cpp
./EVOL_ALGORITHM/*.cpp   ./TASK_ALLOC/*.cpp ./TASK_ALLOC/RENDERING/*.cpp)
 FILE ( GLOB HEADERS ./*.h ./MISC/*.h ./CONTROLLERS/*.h
./EVOL_ALGORITHM/*.h   ./TASK_ALLOC/*.h ./TASK_ALLOC/RENDERING/*.h )
 FILE ( GLOB UIS ./*.ui ./TASK_ALLOC/RENDERING/*.ui)

QT4_WRAP_CPP( SOURCES ${HEADERS} )
QT4_WRAP_UI( SOURCES  ${UIS} )
FIND_PACKAGE ( GLUT )
FIND_PACKAGE ( OpenGL )

INCLUDE_DIRECTORIES( ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
/usr/include/ode/ /usr/include/ /usr/local/qwt-6.0.2-svn/include/
${CMAKE_CURRENT_BINARY_DIR} ./TASK_ALLOC/RENDERING )
# UNCOMMENT FOR GRAPHICS


#  UNCOMMENT FOR NO GRAPHICS
#FILE ( GLOB SOURCES ./*.cpp ./MISC/*.cpp ./CONTROLLERS/*.cpp
./EVOL_ALGORITHM/*.cpp   ./TASK_ALLOC/*.cpp )
#FILE ( GLOB HEADERS ./*.h ./MISC/*.h ./CONTROLLERS/*.h
./EVOL_ALGORITHM/*.h   ./TASK_ALLOC/*.h )
#INCLUDE_DIRECTORIES( /usr/include/ode/ /usr/include/
${CMAKE_CURRENT_BINARY_DIR} )
#  UNCOMMENT FOR NO GRAPHICS

ADD_EXECUTABLE( ${EXECUTABLE} ${SOURCES})

# UNCOMMENT FOR GRAPHICS
TARGET_LINK_LIBRARIES( ${EXECUTABLE} QGLViewer ${OPENGL_glu_LIBRARY}
${GLUT_LIBRARIES} -lGL ode avcodec avutil avformat -lz ${QT_LIBRARIES} )
TARGET_LINK_LIBRARIES( ${EXECUTABLE} "-L/sw/lib -lgsl -lgslcblas -lm
-L/usr/local/qwt-6.0.2-svn/lib -lqwt" )
# UNCOMMENT FOR GRAPHICS

#  UNCOMMENT FOR NO GRAPHICS
#TARGET_LINK_LIBRARIES( ${EXECUTABLE} ode )
#TARGET_LINK_LIBRARIES( ${EXECUTABLE} "-L/sw/lib -lgsl -lgslcblas -lm" )
#  UNCOMMENT FOR NO GRAPHICS



More information about the Libav-user mailing list