Not able to link ffmpeg libs with gstreamer encoder plugin ?

ssshukla26 ssshukla26 at gmail.com
Wed Jan 27 05:42:11 PST 2016


Hi guyz,

I made a encoder application using ffmpeg libs and it worked. 

I used the same application and plug it into my gstreamer encoder plugin. 

I linked the required libs inside *src/Makefile.am* as below

libgstmyencoder_la_CFLAGS = $(GST_CFLAGS) *-I/usr/local/include *
libgstmyencoder_la_LIBADD = $(GST_LIBS) *-lm -L/usr/local/lib/ -lavdevice
-lavformat -lavfilter -lavcodec -lswresample -lswscale -lavutil*

Am getting error in the below code inside my gstreamer plugin...

   codec = avcodec_find_encoder(AV_CODEC_ID_H264);
    if (!codec) {
        *g_print("H264 Codec not found\n");*
        return 1;
    }

Error:

$ gst-launch-1.0 -e filesrc location=/home/sunny/Videos/rawvideo_yuv420.yuv
blocksize=460800 !
video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! myh264encoder
silent=true  ! videoparse width=640 height=480 framerate=30/1 ! 
autovideoconvert ! autovideosink
gst_myencoder_class_init....................
gst_myencoder_init....................
gst_myencoder_set_property....................
Setting pipeline to PAUSED ...
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
gst_myencoder_open....................
*H264 Codec not found*
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstMyEncoder:myencoder0: Could
not initialize supporting library.
Additional debug info:
gstvideoencoder.c(1428): gst_video_encoder_change_state ():
/GstPipeline:pipeline0/GstMyEncoder:myencoder0:
Failed to open encoder
Setting pipeline to NULL ...
Freeing pipeline ...

------------------------------------------------------------------------------------------------------------------

I found out the avcodec_find_encoder is a function and is available with
following *SO*s
$ grep -nrw "AV_CODEC_ID_H264" . --include=*.so.*
Binary file ./libavcodec/libavcodec.so.57 matches
Binary file ./libavdevice/libavdevice.so.57 matches
Binary file ./libavformat/libavformat.so.57 matches
Binary file ./libavfilter/libavfilter.so.6 matches

Can anyone please suggest what am missing ? Am not getting what I missed 





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Not-able-to-link-ffmpeg-libs-with-gstreamer-encoder-plugin-tp4675503.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list