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 MP4影音编码问题

Other Parts Discussed in Thread: TVP5146

我想用DM365通过视频、音频同压到同一个文件里面,该文件可以用通用的播放器播放,从processors.wiki.ti.com/.../Example_GStreamer_Pipelines 看到,通过Gstreamer可以生成MP4文件:

gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 input-src=composite ! ‘video/x-raw-yuv,format=(fourcc)NV12,width=736,height=576’ ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! qtmux ! filesink location=output_cap_.mp4

试了一下,可以,但我希望音频也加进去,输入以下代码:

gst-launch -v v4l2src always-copy=FALSE num-buffers=2000 input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=736,height=576' ! TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! queue ! qtmux name = mux ! filesink location=output_cap_.mp4 alsasrc num-buffers=1000 ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! queue ! mux.

可以运行,但是没有数据输出,ctrl+c后output_cap_.mp4只有221字节。运行信息:

root@dm365-evm:/usr/share/ti/dvsdk-demos# gst-launch -v v4l2src always-copy=FALS

E num-buffers=2000 input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,wi

dth=736,height=576' ! TIVidenc1 codecName=h264enc engineName=codecServer byteStr

eam=FALSE ! queue ! qtmux name = mux ! filesink location=output_cap_.mp4 alsasrc

num-buffers=1000 ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! queue

! mux.          

Setting pipeline to PAUSED ...

davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124

davinci_previewer davinci_previewer.2: ipipe_set_preview_config

vpfe-capture vpfe-capture: IPIPE Chained

vpfe-capture vpfe-capture: Resizer present

tvp514x 1-005d: invalid control id -2147483648

EVM: switch to tvp5146 SD video input

tvp514x 1-005d: tvp5146 (Version - 0x08) found at 0xba (DaVinci I2C adapter)

tvp514x 1-005d: invalid control id 9963780

tvp514x 1-005d: invalid control id 9963781

tvp514x 1-005d: invalid control id 9963782

tvp514x 1-005d: invalid control id 9963783

tvp514x 1-005d: invalid control id 9963784

tvp514x 1-005d: invalid control id 9963785

tvp514x 1-005d: invalid control id 9963786

tvp514x 1-005d: invalid control id 9963787

tvp514x 1-005d: invalid control id 9963788

tvp514x 1-005d: invalid control id 9963789

tvp514x 1-005d: invalid control id 9963790

tvp514x 1-005d: invalid control id 9963791

tvp514x 1-005d: invalid control id 9963792

tvp514x 1-005d: invalid control id 9963793

tvp514x 1-005d: invalid control id 9963795

tvp514x 1-005d: invalid control id 9963796

tvp514x 1-005d: invalid control id 9963797

tvp514x 1-005d: invalid control id 9963798

tvp514x 1-005d: invalid control id 9963799

tvp514x 1-005d: invalid control id 9963800

tvp514x 1-005d: invalid control id 9963801

tvp514x 1-005d: invalid control id 9963802

tvp514x 1-005d: invalid control id 9963803

tvp514x 1-005d: invalid control id 9963804

tvp514x 1-005d: invalid control id 9963805

tvp514x 1-005d: invalid control id 9963806

tvp514x 1-005d: invalid control id 9963807

tvp514x 1-005d: invalid control id 9963808

tvp514x 1-005d: invalid control id 9963809

/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 200000

/GstPipeline:pipeline0/vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2

GstAlsaSrc:alsasrc0: actual-latevpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

ncy-time = 10000

/GstPipeline:pvpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2

ipeline0/GstAlsavpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

Src:alsasrc0.GstPad:src: caps = vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 1

audio/x-raw-int,vpfe-capture vpfe-capture: adjusted width = 32, height = 2, bpp = 1, bytesperline = 32, sizeimage = 96

endianness=(int)1234, signed=(bvpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 1

oolean)true, widvpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 1, bytesperline = 2176, sizeimage = 5013504

th=(int)16, depth=(int)16, rate=vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2

(int)44100, chanvpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

nels=(int)2

vpfe-capture vpfe-capture: width = 8, height = 2, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 32775, height = 32769, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 8, height = 2, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 32775, height = 32769, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 8, height = 2, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 32775, height = 32769, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 8, height = 2, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64

vpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 32775, height = 32769, bpp = 2

vpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672

vpfe-capture vpfe-capture: width = 736, height = 576, bpp = 1

vpfe-capture vpfe-capture: adjusted width = 736, height = 576, bpp = 1, bytesperline = 736, sizeimage = 635904

vpfe-capture vpfe-capture: width = 736, height = 576, bpp = 1

vpfe-capture vpfe-capture: adjusted width = 736, height = 576, bpp = 1, bytesperline = 736, sizeimage = 635904

/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: queue-size = 3

/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, framerate=(fraction)30000/1001, width=(int)736, height=(int)576

Pipeline is live and does not need PREROLL ...

WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set input 0 on device /dev/video0.

Additional debug info:

v4l2_calls.c(975): gst_v4l2_set_input (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

system error: Invalid argument

WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.

Additional debug info:

v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

system error: Invalid argument

Setting pipeline to PLAYING ...

New clock: GstAudioSrcClock

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, framerate=(fraction)30000/1001, width=(int)736, height=(int)576

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)NV12, framerate=(fraction)30000/1001, width=(int)736, height=(int)576

/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2

/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2

/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(int)64000

/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(int)64000

/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(int)64000

/GstPipeline:pipeline0/GstQTMux:mux.GstPad:audio_00: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(int)64000

/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:src: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)736, height=(int)576, codec_data=(buffer)01640028ffe1005a67640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b1510

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)736, height=(int)576, codec_data=(buffer)01640028ffe1005a67640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8a0

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)736, height=(int)576, codec_data=(buffer)01640028ffe1005a67640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8ac0

/GstPipeline:pipeline0/GstQTMux:mux.GstPad:video_00: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)736, height=(int)576, codec_data=(buffer)01640028ffe1005a67640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a80

/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/quicktime, variant=(string)apple

程序停在这里,然后ctrl+c 结束它

Caught interrupt -- handling interrupt.

Interrupt: Stopping pipeline ...

Execution ended after 12751410419 ns.

Setting pipeline to PAUSED ...

Setting pipeline to READY ...

/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstQTMux:mux.GstPad:video_00: caps = NULL

/GstPipeline:pipeline0/GstQTMux:mux.GstPad:audio_00: caps = NULL

/GstPipeline:pipeline0/GstQTMux:mux.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = NULL

/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = NULL

libv4l2: error turning off stream: Invalid argument

(gst-launvpfe-capture vpfe-capture: device started

ch-0.10:2296): GStreamer-CRITICAL **: Failed to deactivate pad v4l2src0:src, very bad

Setting pipeline to NULL ...

libv4l2: error turning off stream: Invalid argument

(gst-launch-0.10:2296): GStreamer-CRITICAL **: Failed to deactivate pad v4l2src0:src, very bad

Freeing pipeline ...

如何解决这个问题,是不是我的输入命令有错?