Carlos,
many thanks for your help.
I tested your example pipeline.
gst-launch-1.0 --gst-debug=3 udpsrc buffer-size=1000000 port=5006 caps="image/jpeg" ! queue !  imxvpudec ! imxvpuenc_h264 bitrate=4096 ! h264parse ! matroskamux name=mux ! filesink location=test.mkv

Got some errors..

Setting pipeline to PAUSED ...
[INFO]  Product Info: i.MX6Q/D/S
[INFO]  Product Info: i.MX6Q/D/S
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[INFO]  bitstreamMode 1, chromaInterleave 0, mapType 0, tiled2LinearEnable 0
[WARN]  pic was forced to be done

** (gst-launch-1.0:884): CRITICAL **: gst_video_decoder_negotiate_default: assertion 'GST_VIDEO_INFO_WIDTH (&state->info) != 0' failed
0:00:00.772866983   884   0x9e5d80 ERROR           videodecoder gstvideodecoder.c:3534:gst_video_decoder_allocate_output_buffer:<imxvpudec0> Failed to allocate the buffer..

(gst-launch-1.0:884): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed
0:00:00.774069049   884   0x9e5db0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:00.774414068   884   0x9e5db0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason error (-5)
0:00:00.775037436   884   0x9e5db0 WARN                   queue gstqueue.c:860:gst_queue_handle_sink_event:<queue0> error: Internal data flow error.
0:00:00.775624802   884   0x9e5db0 WARN                   queue gstqueue.c:860:gst_queue_handle_sink_event:<queue0> error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason error (-5)
Execution ended after 0:00:00.607922880
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
 
Am 28.12.2014 um 17:22 schrieb Carlos Rafael Giani:
On 2014-12-28 17:08, Carlos Rafael Giani wrote:
On 2014-12-28 14:31, Peter Hafner wrote:
Hi,
I want to trans code 2 different types of streams to h264 codec, on a i.mx6 Dual.
First  stream is from a STK1160 video device
and I'm using this gstreamer commands.

gst-launch-1.0 --gst-debug=3 v4l2src device=/dev/video0 ! videoconvert ! imxvpuenc_h264 bitrate=4096 ! "video/x-h264,stream-format=byte-stream,profile="" ! h264parse ! matroskamux name=mux ! filesink location=output.FIFO -v

This is working !

The second stream, is a raw jpeg stream via udp.
This is the commands, I currently thought it is the best one:
gst-launch-1.0 --gst-debug=3 udpsrc buffer-size=1000000 port=5006 ! queue !  jpegdec ! videoconvert ! imxvpuenc_h264 bitrate=4096 ! "video/x-h264,stream-format=byte-stream,profile="" ! h264parse ! matroskamux name=mux ! autovideosink

I got always the error "reason not-negotited (-4). Of course tested a lot.

This is working with video test src:
#gst-launch-1.0 videotestsrc !  videoconvert ! imxvpuenc_h264 bitrate=4096 ! "video/x-h264,stream-format=byte-stream,profile="" ! h264parse ! matroskamux name=mux ! filesink location=output.FIFO -v &
 
Thanks Peter
 
 

With udpsrc, you need to define the caps for the output data explicitely. Check out the "caps" property of udpsrc.

Furthermore, you can replace jpegdec with imxvpudec (it can decode motion JPEG). Once you do that, you can remove videoconvert from the pipeline, since imxvpudec outputs I420-formatted pixels, which imxvpuenc_h264 can use directly.

Also, as a general advice, always try to use one of the transform elements instead of videoconvert. The imx(g2d,ipu,pxp)videotransform elements use hardware accelerated conversions, while videoconvert does conversions with the CPU (and by default also does dithering, which is even slower).
 
 

I just noticed another problem: the "video/x-h264,stream-format=byte-stream,profile="" caps filter. You cannot use that, since the VPU encoder only supports the baseline profile. If that is ok, then simply remove this capsfilter.

Example pipeline:

gst-launch-1.0 --gst-debug=3 udpsrc buffer-size=1000000 port=5006 caps="image/jpeg" ! queue !  imxvpudec ! imxvpuenc_h264 bitrate=4096 ! h264parse ! matroskamux name=mux ! autovideosink
 
 

 
-- 
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to