[Libav-user] Not able to compile the same code when used with gstreamer

Sunny Shukla ssshukla26 at gmail.com
Wed Jan 27 16:40:58 CET 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 my gstreamer source under
*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


-- 
Sunny Shukla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160127/bfab2371/attachment.html>


More information about the Libav-user mailing list