When using the below commands everything works perfectly.
sudo apt-get install gstreamer1.0-plugins-v4l2
gst-launch-1.0 -v -e --gst-debug=v4l2enc:0 videotestsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,profile=high,level\=\(string\)"5" ! v4l2enc ! queue ! filesink location=/home/linaro/enc.h264
gst-launch-1.0 -v -e --gst-debug=v4l2enc:0 videotestsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,profile=high,level\=\(string\)"5" ! v4l2enc ! h264parse ! mp4mux ! queue ! filesink location=/home/linaro/enc.mp4
I am getting an encoded video file which is playable.
But before doing the above steps I tried to compile the v4l2plugins from the source as below on the DB410C board itself.
mkdir transcoder
git clone https://git.linaro.org/landing-teams/working/qualcomm/pkg/gst-plugins-v4l2.git trasncoder/
cd transcoder
./autogen.sh
make
make install
sudo chown linaro:linaro -R /usr/local/lib/gstreamer-1.0
sudo chmod 777 -R /usr/local/lib/gstreamer-1.0
ls -l /usr/local/lib/gstreamer-1.0
-rwxrwxrwx 1 linaro linaro 1066 Feb 21 07:25 libgstv4l2dec.la
-rwxrwxrwx 1 linaro linaro 169520 Feb 21 07:25 libgstv4l2dec.so
-rwxrwxrwx 1 linaro linaro 1066 Feb 21 07:25 libgstv4l2enc.la
-rwxrwxrwx 1 linaro linaro 176792 Feb 21 07:25 libgstv4l2enc.so
-rwxrwxrwx 1 linaro linaro 1078 Feb 21 07:25 libgstv4l2trans.la
-rwxrwxrwx 1 linaro linaro 220192 Feb 21 07:25 libgstv4l2trans.so
export GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0
gst-inspect-1.0 | grep "v4l2"
v4l2dec: v4l2dec: V4L2 decoder
v4l2enc: v4l2enc: V4L2 encoder
v4l2trans: v4l2trans: V4L2 transform
video4linux2: v4l2src: Video (video4linux2) Source
video4linux2: v4l2sink: Video (video4linux2) Sink
video4linux2: v4l2radio: Radio (video4linux2) Tuner
video4linux2: v4l2deviceprovider (GstDeviceProviderFactory)
video4linux2: v4l2video32dec: V4L2 Video Decoder
Now when I use the compiled v4l2enc plugin It was giving me the following error. Please help me to identify what went wrong with my compilation.
$ gst-launch-1.0 -v -e --gst-debug=v4l2enc:0 videotestsrc ! video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,profile=high,level\=\(string\)"5" ! v4l2enc ! queue ! filesink location=/home/linaro/enc.h264
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ profile\=\(string\)high\,\ level\=\(string\)5\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ profile\=\(string\)high\,\ level\=\(string\)5\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ profile\=\(string\)high\,\ level\=\(string\)5\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ framerate\=\(fraction\)30/1\,\ profile\=\(string\)high\,\ level\=\(string\)5\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0.GstPad:src: caps = "video/x-h264\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
ERROR: from element /GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0: GStreamer error: negotiation problem.
Additional debug info:
gstvideoencoder.c(1463): gst_video_encoder_chain (): /GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0:
encoder not initialized
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstV4L2Enc:v4l2enc0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "NULL"
Freeing pipeline ...
Regards,
Sunny.