linux – gstreamer和带音频的mp4或avi输出

linux – gstreamer和带音频的mp4或avi输出,第1张

概述我有下面的语法,将在屏幕上显示我的网络摄像头的视频,并将视频编码为ogv文件. 我想做的是在屏幕上显示视频,但是将其从ogv文件更改为mp4和/或带有录制音频的AVI文件,有人可以帮助我. 感谢以下代码适用于ogv文件 我正在使用ubuntu 10.04 64位Linux和罗技c600网络摄像头 以下代码单独使用: gst-launch-0.10 v4l2src ! 'video/x-raw-yu 我有下面的语法,将在屏幕上显示我的网络摄像头的视频,并将视频编码为ogv文件.
我想做的是在屏幕上显示视频,但是将其从ogv文件更改为mp4和/或带有录制音频的AVI文件,有人可以帮助我.

感谢以下代码适用于ogv文件
我正在使用ubuntu 10.04 64位Linux和罗技c600网络摄像头

以下代码单独使用:

gst-launch-0.10 v4l2src ! 'vIDeo/x-raw-yuv,wIDth=640,height=480,framerate=30/1' ! \timeoverlay halignment=right valignment=bottom shaded-background=true ! \clockoverlay halignment=left valignment=bottom text="M/D/Y:" shaded-background=true time-format="%m/%d/%Y %H:%M:%s" ! \tee name=t_vID ! queue ! xvimagesink sync=false t_vID. ! queue ! vIDeorate ! \'vIDeo/x-raw-yuv,framerate=30/1' ! theoraenc ! queue ! oggmux ! \filesink location=testogg.ogv

我尝试将两个不同的代码工作部分组合起来,看看它是否可行.顶部代码和底部代码

以下代码单独使用;

gst-launch-0.10 vIDeotestsrc num-buffers=250 \! 'vIDeo/x-raw-yuv,format=(fourcc)I420,wIDth=320,height=240,framerate=25/1' \! xvIDenc ! queue ! mux. \audiotestsrc num-buffers=440 ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=2' \! lame ! queue ! mux. \avimux name=mux ! filesink location=test.avi

我拼凑在一起

合并的代码不起作用:

gst-launch-0.10 v4l2src ! 'vIDeo/x-raw-yuv,framerate=25/1' ! \timeoverlay halignment=right valignment=bottom shaded-background=true ! \clockoverlay halignment=left valignment=bottom text="M/D/Y:" shaded-background=true time-format="%m/%d/%Y %H:%M:%s" ! \tee name=t_vID ! queue ! xvimagesink sync=false t_vID. ! queue ! vIDeorate ! \'vIDeo/x-raw-yuv,framerate=25/1' ! xvIDenc ! queue ! mux. ! \avimux name=mux ! filesink location=testavirt.avi

但是我收到一条错误消息
“警告:错误的管道:没有源元素的链接”

我试图使用这个编解码器的原因是让它在kdenlive中工作,这对于它将导入哪些编解码器非常特殊

好吧我按照下面的代码建议在调试模式下启动gstreamer

gst-launch-0.10 -v --gst-deBUG-level=3 ! v4l2src ! 'vIDeo/x-raw-yuv,framerate=25/1' ! xvIDenc ! queue ! mux. ! \avimux name=mux ! filesink location=testavirt.avi

它带回了这个调试信息

0:00:00.000783199 16068       0xade080 INFO                GST_INIT gstquery.c:107:_gst_query_initialize: init querIEs0:00:00.001852610 16068       0xade080 INFO                GST_INIT gstmessage.c:73:_gst_message_initialize: init messages0:00:00.002272948 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:350:_gst_plugin_initialize: registering 0 static plugins0:00:00.002463561 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:255:gst_plugin_register_static: registered static plugin "staticelements"0:00:00.002486054 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:257:gst_plugin_register_static: added static plugin "staticelements",result: 10:00:00.003105961 16068       0xade080 INFO            GST_REGISTRY gstregistry.c:1611:ensure_current_registry: reading registry cache: /home/rat/.gstreamer-0.10/registry.x86_64.bin0:00:00.019757535 16068       0xade080 INFO            GST_REGISTRY gstregistrybinary.c:614:gst_registry_binary_read_cache: loaded /home/rat/.gstreamer-0.10/registry.x86_64.bin in 0.016615 seconds0:00:00.019860736 16068       0xade080 INFO            GST_REGISTRY gstregistry.c:1471:scan_and_update_registry: ValIDating plugins from registry cache: /home/rat/.gstreamer-0.10/registry.x86_64.bin0:00:00.021184812 16068       0xade080 INFO            GST_REGISTRY gstregistry.c:1573:scan_and_update_registry: Registry cache has not changed0:00:00.021194999 16068       0xade080 INFO            GST_REGISTRY gstregistry.c:1640:ensure_current_registry: registry reading and updating done,result = 10:00:00.021201052 16068       0xade080 INFO                GST_INIT gst.c:797:init_post: Glib runtime version: 2.24.10:00:00.021208042 16068       0xade080 INFO                GST_INIT gst.c:799:init_post: Glib headers version: 2.24.10:00:00.021241674 16068       0xade080 INFO            GST_PIPEliNE gstparse.c:335:gst_parse_launch_full: parsing pipeline description '! v4l2src ! vIDeo/x-raw-yuv,framerate=25/1 ! timeoverlay halignment=right valignment=bottom shaded-background=true ! clockoverlay halignment=left valignment=bottom text=M/D/Y: shaded-background=true time-format=%m/%d/%Y\ %H:%M:%s ! tee name=t_vID ! queue ! xvimagesink sync=false t_vID. ! queue ! vIDeorate ! vIDeo/x-raw-yuv,framerate=25/1 ! xvIDenc ! queue ! mux. ! avimux name=mux ! filesink location=testavirt.avi '0:00:00.022709253 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstvideo4linux2.so" loaded0:00:00.022725847 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "v4l2src"0:00:00.023022609 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBaseSrc@0xd28030> adding pad 'src'0:00:00.024528033 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstpango.so" loaded0:00:00.024541435 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "timeoverlay"0:00:00.024983829 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstTextOverlay@0xd42040> adding pad 'vIDeo_sink'0:00:00.025034224 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstTextOverlay@0xd42040> adding pad 'src'0:00:00.025085769 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "clockoverlay"0:00:00.025208997 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstTextOverlay@0xd4c0f0> adding pad 'vIDeo_sink'0:00:00.025256228 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstTextOverlay@0xd4c0f0> adding pad 'src'0:00:00.025569620 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstcoreelements.so" loaded0:00:00.025583335 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "tee"0:00:00.025655142 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstTee@0xc23760> adding pad 'sink'0:00:00.025678269 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "queue"0:00:00.025770942 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd581c0> adding pad 'sink'0:00:00.025795370 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd581c0> adding pad 'src'0:00:00.026000635 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstxvimagesink.so" loaded0:00:00.026012901 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "xvimagesink"0:00:00.026142535 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBaseSink@0xd26610> adding pad 'sink'0:00:00.026172194 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "queue"0:00:00.026202526 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd58440> adding pad 'sink'0:00:00.026225449 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd58440> adding pad 'src'0:00:00.027723125 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstvIDeorate.so" loaded0:00:00.027735129 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "vIDeorate"0:00:00.027808311 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstVIDeoRate@0xd5f000> adding pad 'sink'0:00:00.027834798 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstVIDeoRate@0xd5f000> adding pad 'src'0:00:00.028089942 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstxvID.so" loaded0:00:00.028101728 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "xvIDenc"0:00:00.028370479 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstXvIDEnc@0xd5f1e0> adding pad 'sink'0:00:00.028400842 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstXvIDEnc@0xd5f1e0> adding pad 'src'0:00:00.028481732 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "queue"0:00:00.028508557 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd586c0> adding pad 'sink'0:00:00.028536913 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstQueue@0xd586c0> adding pad 'src'0:00:00.029064786 16068       0xade080 INFO      GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstavi.so" loaded0:00:00.029077092 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "avimux"0:00:00.029284486 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstAviMux@0xd73000> adding pad 'src'0:00:00.029326884 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "filesink"0:00:00.029378045 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBaseSink@0xd75370> adding pad 'sink'0:00:00.029412649 16068       0xade080 INFO                filesink gstfilesink.c:306:gst_file_sink_set_location: filename : testavirt.avi0:00:00.029420428 16068       0xade080 INFO                filesink gstfilesink.c:307:gst_file_sink_set_location: uri      : file:///home/rat/testavirt.avi0:00:00.029433307 16068       0xade080 ERROR           GST_PIPEliNE ./grammar.y:799:_gst_parse_yyparse: link without source element0:00:00.029446312 16068       0xade080 ERROR           GST_PIPEliNE ./grammar.y:862:_gst_parse_yyparse: link without source element0:00:00.029456839 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "pipeline"0:00:00.029535187 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking v4l2src0:(any) to timeoverlay0:(any) (0/0) with caps "vIDeo/x-raw-yuv,wIDth=(int)640,height=(int)480,framerate=(fraction)25/1"0:00:00.029561950 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "capsfilter"0:00:00.029628904 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBasetransform@0xd78150> adding pad 'sink'0:00:00.029654353 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBasetransform@0xd78150> adding pad 'src'0:00:00.029668706 16068       0xade080 INFO              GST_STATES gstbin.c:1767:gst_bin_get_state_func:<pipeline0> getting state0:00:00.029686262 16068       0xade080 INFO              GST_STATES gstelement.c:2408:gst_element_continue_state:<capsfilter0> completed state change to NulL0:00:00.029703721 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element v4l2src0:(any) to element capsfilter0:sink0:00:00.029712366 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:969:gst_element_get_static_pad: found pad capsfilter0:sink0:00:00.029720912 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: v4l2src0 and capsfilter0 in same bin,no need for ghost pads0:00:00.029744719 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link v4l2src0:src and capsfilter0:sink0:00:00.049689595 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked v4l2src0:src and capsfilter0:sink,successful0:00:00.049761719 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element capsfilter0:src to element timeoverlay0:(any)0:00:00.049782927 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:969:gst_element_get_static_pad: found pad capsfilter0:src0:00:00.049801288 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link capsfilter0:src and timeoverlay0:vIDeo_sink0:00:00.050467449 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: capsfilter0 and timeoverlay0 in same bin,no need for ghost pads0:00:00.050498205 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link capsfilter0:src and timeoverlay0:vIDeo_sink0:00:00.051365172 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked capsfilter0:src and timeoverlay0:vIDeo_sink,successful0:00:00.051410274 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking timeoverlay0:(any) to clockoverlay0:(any) (0/0) with caps "(NulL)"0:00:00.051435266 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element timeoverlay0:(any) to element clockoverlay0:(any)0:00:00.051452770 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link timeoverlay0:src and clockoverlay0:vIDeo_sink0:00:00.052124174 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: timeoverlay0 and clockoverlay0 in same bin,no need for ghost pads0:00:00.052152481 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link timeoverlay0:src and clockoverlay0:vIDeo_sink0:00:00.052819379 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked timeoverlay0:src and clockoverlay0:vIDeo_sink,successful0:00:00.052851632 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking clockoverlay0:(any) to t_vID:(any) (0/0) with caps "(NulL)"0:00:00.052872037 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element clockoverlay0:(any) to element t_vID:(any)0:00:00.052888711 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link clockoverlay0:src and t_vID:sink0:00:00.053539972 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: clockoverlay0 and t_vID in same bin,no need for ghost pads0:00:00.053567822 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link clockoverlay0:src and t_vID:sink0:00:00.054209057 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked clockoverlay0:src and t_vID:sink,successful0:00:00.054240988 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking t_vID:(any) to queue0:(any) (0/0) with caps "(NulL)"0:00:00.054261353 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element t_vID:(any) to element queue0:(any)0:00:00.054357775 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<t_vID> adding pad 'src0'0:00:00.054391930 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: t_vID and queue0 in same bin,no need for ghost pads0:00:00.054416401 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link t_vID:src0 and queue0:sink0:00:00.055097197 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked t_vID:src0 and queue0:sink,successful0:00:00.055131050 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking queue0:(any) to xvimagesink0:(any) (0/0) with caps "(NulL)"0:00:00.055151268 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element queue0:(any) to element xvimagesink0:(any)0:00:00.055167783 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link queue0:src and xvimagesink0:sink0:00:00.055842243 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: queue0 and xvimagesink0 in same bin,no need for ghost pads0:00:00.055870005 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link queue0:src and xvimagesink0:sink0:00:00.056567773 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked queue0:src and xvimagesink0:sink,successful0:00:00.056606717 16068       0xade080 INFO           GST_PARENTAGE gstbin.c:3707:gst_bin_get_by_name: [pipeline0]: looking up child element t_vID0:00:00.056632626 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking t_vID:t_vID to queue1:(any) (0/0) with caps "(NulL)"0:00:00.056651644 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element t_vID:(any) to element queue1:(any)0:00:00.056719250 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<t_vID> adding pad 'src1'0:00:00.056741754 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: t_vID and queue1 in same bin,no need for ghost pads0:00:00.056764926 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link t_vID:src1 and queue1:sink0:00:00.057431047 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked t_vID:src1 and queue1:sink,successful0:00:00.057462976 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking queue1:(any) to vIDeorate0:(any) (0/0) with caps "(NulL)"0:00:00.057520574 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element queue1:(any) to element vIDeorate0:(any)0:00:00.057541803 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link queue1:src and vIDeorate0:sink0:00:00.058218898 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: queue1 and vIDeorate0 in same bin,no need for ghost pads0:00:00.058247509 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link queue1:src and vIDeorate0:sink0:00:00.058913420 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked queue1:src and vIDeorate0:sink,successful0:00:00.058945216 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking vIDeorate0:(any) to xvIDenc0:(any) (0/0) with caps "vIDeo/x-raw-yuv,framerate=(fraction)25/1"0:00:00.058980252 16068       0xade080 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "capsfilter"0:00:00.059030050 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBasetransform@0xd78410> adding pad 'sink'0:00:00.059070176 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<GstBasetransform@0xd78410> adding pad 'src'0:00:00.059099030 16068       0xade080 INFO              GST_STATES gstbin.c:1767:gst_bin_get_state_func:<pipeline0> getting state0:00:00.059133982 16068       0xade080 INFO              GST_STATES gstelement.c:2408:gst_element_continue_state:<capsfilter1> completed state change to NulL0:00:00.059161447 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element vIDeorate0:(any) to element capsfilter1:sink0:00:00.059178858 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:969:gst_element_get_static_pad: found pad capsfilter1:sink0:00:00.059192810 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: vIDeorate0 and capsfilter1 in same bin,no need for ghost pads0:00:00.059215498 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link vIDeorate0:src and capsfilter1:sink0:00:00.059916866 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked vIDeorate0:src and capsfilter1:sink,successful0:00:00.059949637 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element capsfilter1:src to element xvIDenc0:(any)0:00:00.059966690 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:969:gst_element_get_static_pad: found pad capsfilter1:src0:00:00.059982820 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link capsfilter1:src and xvIDenc0:sink0:00:00.060795894 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: capsfilter1 and xvIDenc0 in same bin,no need for ghost pads0:00:00.060824501 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link capsfilter1:src and xvIDenc0:sink0:00:00.061632768 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked capsfilter1:src and xvIDenc0:sink,successful0:00:00.083857679 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking xvIDenc0:(any) to queue2:(any) (0/0) with caps "(NulL)"0:00:00.083881589 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element xvIDenc0:(any) to element queue2:(any)0:00:00.083891480 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link xvIDenc0:src and queue2:sink0:00:00.083904166 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: xvIDenc0 and queue2 in same bin,no need for ghost pads0:00:00.083914692 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link xvIDenc0:src and queue2:sink0:00:00.083925117 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked xvIDenc0:src and queue2:sink,successful0:00:00.083937094 16068       0xade080 INFO           GST_PARENTAGE gstbin.c:3707:gst_bin_get_by_name: [pipeline0]: looking up child element mux0:00:00.083947729 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking queue2:(any) to mux:mux (0/0) with caps "(NulL)"0:00:00.083955323 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element queue2:(any) to element mux:(any)0:00:00.084035330 16068       0xade080 INFO        GST_ELEMENT_PADS gstelement.c:722:gst_element_add_pad:<mux> adding pad 'vIDeo_00'0:00:00.084049981 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: queue2 and mux in same bin,no need for ghost pads0:00:00.084060734 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link queue2:src and mux:vIDeo_000:00:00.084075560 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked queue2:src and mux:vIDeo_00,successful0:00:00.084087455 16068       0xade080 INFO            GST_PIPEliNE ./grammar.y:568:gst_parse_perform_link: linking mux:(any) to filesink0:(any) (0/0) with caps "(NulL)"0:00:00.084095861 16068       0xade080 INFO        GST_ELEMENT_PADS gstutils.c:1694:gst_element_link_pads_full: trying to link element mux:(any) to element filesink0:(any)0:00:00.084103574 16068       0xade080 INFO                GST_PADS gstutils.c:1028:gst_pad_check_link: trying to link mux:src and filesink0:sink0:00:00.084114625 16068       0xade080 INFO                GST_PADS gstutils.c:1592:prepare_link_maybe_ghosting: mux and filesink0 in same bin,no need for ghost pads0:00:00.084124013 16068       0xade080 INFO                GST_PADS gstpad.c:1956:gst_pad_link_prepare: trying to link mux:src and filesink0:sink0:00:00.084131937 16068       0xade080 INFO                GST_PADS gstpad.c:2139:gst_pad_link_full: linked mux:src and filesink0:sink,successfulWARNING: erroneous pipeline: link without source elementrat@ubu64:~$
解决方法 如果要使用mp4或avi,则需要使用不同的编码器.我推荐h264或mp4v. h264enc在丑陋的插件包中.

如果你想要使用mp4路线,可以使用mp4v作为视频,使用mp4a作为音频.我目前没有我的linux盒子,所以这可能不完美.

gst-launch v4l2src ! your caps ! other elements ! tee name=t_vID ! \  xvimagesink sync=false t_vID. ! queue ! caps adjustment if you need it ! \  x264enc ! queue ! avi_mux.  \  alsasrc ! caps ! faac (or whatever will go with avi) ! avimux name=avi_mux ! \  filesink location=testavi.avi

这是avi版本.显然,您可以将编码器调整为适用于容器的任何格式.如果你使用mp4mux它非常相似,只需用mp4mux换掉我的avimux东西.

您可能需要调整alsamixer以确保管道从您的网络摄像头捕获而不是您的某个麦克风插孔.

此外,您可能需要使队列缓冲区无限制以减少延迟.

总结

以上是内存溢出为你收集整理的linux – gstreamer和带音频的mp4或avi输出全部内容,希望文章能够帮你解决linux – gstreamer和带音频的mp4或avi输出所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1021927.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存