<div dir="ltr"><div>Hi guyz,</div><div><br></div><div>I made a encoder application using ffmpeg libs and it worked. 
<br><br>I used the same application and plug it into my gstreamer encoder plugin. 
<br><br>I linked the required libs inside my gstreamer source under <b>src/Makefile.am</b> as below
<br><br>libgstmyencoder_la_CFLAGS = $(GST_CFLAGS) <b>-I/usr/local/include </b><br>libgstmyencoder_la_LIBADD = $(GST_LIBS) <b>-lm -L/usr/local/lib/ -lavdevice -lavformat -lavfilter -lavcodec -lswresample -lswscale -lavutil</b><br><br>Am getting error in the below code inside my gstreamer plugin...
<br><br>   codec = avcodec_find_encoder(AV_CODEC_ID_H264);
<br>    if (!codec) {
<br>        <b>g_print("H264 Codec not found\n");</b><br>        return 1;
<br>    }
<br><br>Error:
<br><br>$ 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
<br>gst_myencoder_class_init....................
<br>gst_myencoder_init....................
<br>gst_myencoder_set_property....................
<br>Setting pipeline to PAUSED ...
<br>libva info: VA-API version 0.35.0
<br>libva info: va_getDriverName() returns 0
<br>libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
<br>libva info: va_openDriver() returns -1
<br>libva info: VA-API version 0.35.0
<br>libva info: va_getDriverName() returns 0
<br>libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
<br>libva info: va_openDriver() returns -1
<br>libva info: VA-API version 0.35.0
<br>libva info: va_getDriverName() returns 0
<br>libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
<br>libva info: va_openDriver() returns -1
<br>gst_myencoder_open....................
<br><b>H264 Codec not found</b><br>ERROR: Pipeline doesn't want to pause.
<br>ERROR: from element /GstPipeline:pipeline0/GstMyEncoder:myencoder0: Could not initialize supporting library.
<br>Additional debug info:
<br>gstvideoencoder.c(1428): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstMyEncoder:myencoder0:
<br>Failed to open encoder
<br>Setting pipeline to NULL ...
<br>Freeing pipeline ...
<br><br>------------------------------------------------------------------------------------------------------------------
<br><br>I found out the avcodec_find_encoder is a function and is available with following <b>SO</b>s
<br>$ grep -nrw "AV_CODEC_ID_H264" . --include=*.so.*
<br>Binary file ./libavcodec/libavcodec.so.57 matches
<br>Binary file ./libavdevice/libavdevice.so.57 matches
<br>Binary file ./libavformat/libavformat.so.57 matches
<br>Binary file ./libavfilter/libavfilter.so.6 matches
<br><br>Can anyone please suggest what am missing ? Am not getting what I missed<br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Sunny Shukla<br></div></div>
</div></div>