Capture from UVC and convert to h264 on RPi

Damien Picard picard.damien at gmail.com
Wed Mar 15 20:07:49 UTC 2017


Hi !

After having set up gstreamer 1.10.4 on a Debian Stretch / RPi / armhf, I'm
trying to use
OpenMax to encode a MJPEG video from a UVC webcam.

I try using this command :
gst-launch-1.0 -vv -e v4l2src device=/dev/video0  !
"image/jpeg,width=640,height=480" ! queue ! jpegdec ! videoconvert !
omxh264enc ! matroskamux ! filesink location=videotestsrc.mkv

And I get this error :
Définition du pipeline à PAUSED...
Le pipeline est actif et n’a pas besoin de phase PREROLL…
Passage du pipeline à la phase PLAYING…
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:sink: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:src: caps = video/x-raw,
format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps =
video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink:
caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps =
video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src:
caps = video/x-h264, stream-format=(string)byte-stream,
alignment=(string)au, profile=(string)high, level=(string)4,
width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)61612/513
ERREUR : de l’élément
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0 :
Internal data stream error.
Information de débogage supplémentaire :
gstomxvideoenc.c(843): gst_omx_video_enc_loop ():
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
stream stopped, reason not-negotiated
EOS à la fermeture est activé -- attente d’EOS après erreur
Attente d’EOS.
/GstPipeline:pipeline0/GstMatroskaMux:matroskamux0.GstPad:src: caps =
video/x-matroska
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps =
video/x-matroska
^[[A^Chandling interrupt.
Interruption : arrêt du pipeline…
Interruption lors de l’attende d’EOS - arrêt du pipeline…
Execution ended after 0:00:50.361774870
Définition du pipeline à PAUSED...
Définition du pipeline à READY (prêt)…
Définition du pipeline à NULL…
Libération du pipeline…


But, when I use x264enc, it works :

Définition du pipeline à PAUSED...
Le pipeline est actif et n’a pas besoin de phase PREROLL…
Passage du pipeline à la phase PLAYING…
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:sink: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = image/jpeg,
width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)61612/513,
pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:7:1
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:src: caps = video/x-raw,
format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps =
video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink:
caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps =
video/x-raw, format=(string)I420, width=(int)640, height=(int)480,
interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0,
framerate=(fraction)61612/513
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:src:
caps = video/x-h264, stream-format=(string)byte-stream,
alignment=(string)au, profile=(string)high, level=(string)4,
width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)61612/513
ERREUR : de l’élément
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0 :
Internal data stream error.
Information de débogage supplémentaire :
gstomxvideoenc.c(843): gst_omx_video_enc_loop ():
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
stream stopped, reason not-negotiated
EOS à la fermeture est activé -- attente d’EOS après erreur
Attente d’EOS.
/GstPipeline:pipeline0/GstMatroskaMux:matroskamux0.GstPad:src: caps =
video/x-matroska
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps =
video/x-matroska
^[[A^Chandling interrupt.
Interruption : arrêt du pipeline…
Interruption lors de l’attende d’EOS - arrêt du pipeline…
Execution ended after 0:00:50.361774870
Définition du pipeline à PAUSED...
Définition du pipeline à READY (prêt)…
Définition du pipeline à NULL…
Libération du pipeline…


So I think there is something wrong in the way I use omxh264enc, but I
can't find what. FYI, I build gst-omx from source code (
https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.10.4.tar.xz)

Thank you in advance.
-- 
Damien Picard
Expert GWT
<http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html>
Mob : 06 11 51 47 78
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170315/48c30d55/attachment-0001.html>


More information about the gstreamer-devel mailing list