This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM365 Gstreamer h264编码不成功

您好:

    本人对Gstreamer了解的不多,现在要用它完成一个TVP5150->encode->file的功能,不能实现。望专家帮忙解答。先谢谢了!

编经过测试,loopback的功能正常。

gst-launch -v v4l2src always-copy=FALSE input-src=composite ! video/x-raw-yuv, format=\(fourcc\)UYVY, framerate=25/1,width=720, height=576 ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite contiguousInputFrame=TRUE sync=false

采用如下gst脚本:

gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=720,height=576 !  queue ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_D1.h264

结果报错如下:

@0x001c2d46:[T:0x41299490] ti.sdo.dmai - [Venc1] Failed to open video encode algorithm: h264enc (0x0)

ERROR: from element /GstPipeline:pipeline0/GstTIVidenc1:tividenc10: failed to create video encoder: h264enc

可能是h264enc不支持UYVY模式。利用resize功能试试:

gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! 'video/x-raw-yuv,width=640,height=480,format=(fourcc)UYVY,framerate=(fraction)25/1' ! TIVidResize contiguousInputFrame=TRUE ! 'video/x-raw-yuv,width=320,height=240,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_D1.h264

结果还是报错:

@0x0019d523:[T:0x4145b490] ti.sdo.dmai - [Resize] Failed to open /dev/davinci_resizer

ERROR: from element /GstPipeline:pipeline0/GstTIVidResize:tividresize0: failed to create resize handle  

尝试ffmpegcolorspace

gst-launch -v v4l2src always-copy=FALSE num-buffers=800 input-src=composite ! video/x-raw-yuv,format=\(fourcc\)UYVY,width=320,height=240 !  queue ! ffmpegcolorspace ! 'video/x-raw-yuv,width=320,height=240,format=(fourcc)NV12' ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE ! filesink location=output_cap_D1.h264

gstreamer没有报错,文件生成,但是用暴风影音播放,完全是闪动花屏。

请问问题在哪里??

谢谢!

tomas Yang