我想使用Gstreamer使用以下命令播放视频。顺便说一句,源FlickAnimation.avi中没有音频信息。
gst-launch filesrc location=FlickAnimation.avi !avidemux name=demux demux.video_00 ! queue ! ffdec_mpeg4 !ffmpegcolorspace !playsink
BUt it failed,这是错误信息,
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstAviDemux:demux: Internal data stream error.
Additional debug info:
gstavidemux.c(5212): gst_avi_demux_loop (): /GstPipeline:pipeline0/GstAviDemux:demux:
streaming stopped, reason not-linked
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
然后我使用Gstreamer调试,infor如下,
gst-launch --gst-debug-level=3 !filesrc location=FlickAnimation.avi !avidemux
0:00:00.001558790 598 0x11e4008 INFO GST_INIT gstquery.c:107:_gst_query_initialize: init queries
0:00:00.009293535 598 0x11e4008 INFO GST_INIT gstmessage.c:73:_gst_message_initialize: init messages
0:00:00.010303629 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:350:_gst_plugin_initialize: registering 0 static plugins
0:00:00.012185007 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:255:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.012481987 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:257:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.013571080 598 0x11e4008 INFO GST_REGISTRY gstregistry.c:1648:ensure_current_registry: reading registry cache: /root/.gstreamer-0.10/registry.arm.bin
0:00:00.124909893 598 0x11e4008 INFO GST_REGISTRY gstregistrybinary.c:614:gst_registry_binary_read_cache: loaded /root/.gstreamer-0.10/registry.arm.bin in 0.110985 seconds
0:00:00.125468355 598 0x11e4008 INFO GST_REGISTRY gstregistry.c:1518:scan_and_update_registry: Validating plugins from registry cache: /root/.gstreamer-0.10/registry.arm.bin
0:00:00.136105174 598 0x11e4008 INFO GST_REGISTRY gstregistry.c:1610:scan_and_update_registry: Registry cache has not changed
0:00:00.136400760 598 0x11e4008 INFO GST_REGISTRY gstregistry.c:1683:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.136654364 598 0x11e4008 INFO GST_INIT gst.c:805:init_post: GLib runtime version: 2.30.3
0:00:00.136933696 598 0x11e4008 INFO GST_INIT gst.c:807:init_post: GLib headers version: 2.30.3
0:00:00.137347040 598 0x11e4008 INFO GST_PIPELINE gstparse.c:334:gst_parse_launch_full: parsing pipeline description '!filesrc location=FlickAnimation.avi !avidemux name=demux demux.video_00 ! queue ! ffdec_mpeg4 !ffmpegcolorspace !playsink '
0:00:00.183772341 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstcoreelements.so" loaded
0:00:00.184138701 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "filesrc"
0:00:00.185647227 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstBaseSrc@0x1272000> adding pad 'src'
0:00:00.186236055 598 0x11e4008 INFO filesrc gstfilesrc.c:374:gst_file_src_set_location: filename : FlickAnimation.avi
0:00:00.186512309 598 0x11e4008 INFO filesrc gstfilesrc.c:375:gst_file_src_set_location: uri : file:///pos_demo/video/FlickAnimation.avi
0:00:00.259798194 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstavi.so" loaded
0:00:00.260089584 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "avidemux"
0:00:00.268652741 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstAviDemux@0x1282298> adding pad 'sink'
0:00:00.269410547 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "queue"
0:00:00.270858485 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstQueue@0x1284080> adding pad 'sink'
0:00:00.271484935 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstQueue@0x1284080> adding pad 'src'
0:00:00.383902563 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_avs
0:00:00.384653295 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_daud
0:00:00.385330617 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_ea
0:00:00.385952639 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_ffm
0:00:00.386635737 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_4xm
0:00:00.387258279 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_gxf
0:00:00.387892749 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_idcin
0:00:00.388501919 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_ipmovie
0:00:00.389184857 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_mm
0:00:00.389816667 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_mmf
0:00:00.390735371 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_nsv
0:00:00.391378727 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_nut
0:00:00.392173103 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_RoQ
0:00:00.392852209 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_film_cpk
0:00:00.393555368 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_smk
0:00:00.394246352 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_sol
0:00:00.394905460 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_psxstr
0:00:00.395748130 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_vmd
0:00:00.396487456 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_wc3movie
0:00:00.397108598 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_wsaud
0:00:00.728328134 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_wsvqa
0:00:00.728991314 598 0x11e4008 INFO GST_TYPEFIND gsttypefind.c:83:gst_type_find_register: registering typefind function for fftype_yuv4mpegpipe
0:00:00.734212168 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstffmpeg.so" loaded
0:00:00.734503370 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "ffdec_mpeg4"
0:00:00.736008414 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<ffdec_mpeg4@0x129c358> adding pad 'sink'
0:00:00.736558490 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<ffdec_mpeg4@0x129c358> adding pad 'src'
0:00:00.777471444 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstffmpegcolorspace.so" loaded
0:00:00.777795742 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "ffmpegcolorspace"
0:00:00.784120077 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstBaseTransform@0x12ac078> adding pad 'sink'
0:00:00.784654633 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstBaseTransform@0x12ac078> adding pad 'src'
0:00:00.833664552 598 0x11e4008 INFO GST_PLUGIN_LOADING gstplugin.c:859:gst_plugin_load_file: plugin "/usr/lib/gstreamer-0.10/libgstplaybin.so" loaded
0:00:00.833959286 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "playsink"
0:00:00.836653094 598 0x11e4008 ERROR GST_PIPELINE ./grammar.y:862:priv_gst_parse_yyparse: link without source element
0:00:00.836982596 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:376:gst_element_factory_create: creating element "pipeline"
0:00:00.838180042 598 0x11e4008 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking filesrc0:(any) to demux:(any) (0/0) with caps "(nil)"
0:00:00.838590184 598 0x11e4008 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element filesrc0:(any) to element demux:(any)
0:00:00.838912830 598 0x11e4008 INFO GST_PADS gstutils.c:1032:gst_pad_check_link: trying to link filesrc0:src and demux:sink
0:00:00.839262212 598 0x11e4008 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: filesrc0 and demux in same bin, no need for ghost pads
0:00:00.839683184 598 0x11e4008 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link filesrc0:src and demux:sink
0:00:00.840044478 598 0x11e4008 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked filesrc0:src and demux:sink, successful
0:00:00.840450532 598 0x11e4008 INFO GST_PARENTAGE gstbin.c:3762:gst_bin_get_by_name: [pipeline0]: looking up child element demux
0:00:00.840771938 598 0x11e4008 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking demux:demux to queue0:(any) (1/0) with caps "(nil)"
0:00:00.841082304 598 0x11e4008 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element demux:video_00 to element queue0:(any)
0:00:00.841390362 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:972:gst_element_get_static_pad: no such pad 'video_00' in element "demux"
0:00:00.841664658 598 0x11e4008 INFO default gstutils.c:2037:gst_element_link_pads_filtered: Could not link pads: demux:video_00 - queue0:(null)
0:00:00.841987814 598 0x11e4008 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking queue0:(any) to ffdec_mpeg40:(any) (0/0) with caps "(nil)"
0:00:00.842302988 598 0x11e4008 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element queue0:(any) to element ffdec_mpeg40:(any)
0:00:01.173214247 598 0x11e4008 INFO GST_PADS gstutils.c:1032:gst_pad_check_link: trying to link queue0:src and ffdec_mpeg40:sink
0:00:01.173704507 598 0x11e4008 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: queue0 and ffdec_mpeg40 in same bin, no need for ghost pads
0:00:01.174091201 598 0x11e4008 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link queue0:src and ffdec_mpeg40:sink
0:00:01.174450731 598 0x11e4008 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked queue0:src and ffdec_mpeg40:sink, successful
0:00:01.174860127 598 0x11e4008 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking ffdec_mpeg40:(any) to ffmpegcsp0:(any) (0/0) with caps "(nil)"
0:00:01.175184191 598 0x11e4008 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element ffdec_mpeg40:(any) to element ffmpegcsp0:(any)
0:00:01.175478117 598 0x11e4008 INFO GST_PADS gstutils.c:1032:gst_pad_check_link: trying to link ffdec_mpeg40:src and ffmpegcsp0:sink
0:00:01.209021014 598 0x11e4008 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: ffdec_mpeg40 and ffmpegcsp0 in same bin, no need for ghost pads
0:00:01.209427680 598 0x11e4008 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link ffdec_mpeg40:src and ffmpegcsp0:sink
0:00:01.242462005 598 0x11e4008 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked ffdec_mpeg40:src and ffmpegcsp0:sink, successful
0:00:01.242912317 598 0x11e4008 INFO GST_PIPELINE ./grammar.y:568:gst_parse_perform_link: linking ffmpegcsp0:(any) to playsink0:(any) (0/0) with caps "(nil)"
0:00:01.243237831 598 0x11e4008 INFO GST_ELEMENT_PADS gstutils.c:1698:gst_element_link_pads_full: trying to link element ffmpegcsp0:(any) to element playsink0:(any)
0:00:01.273302364 598 0x11e4008 INFO GST_ELEMENT_FACTORY gstelementfactory.c:374:gst_element_factory_create: creating element "tee" named "audiotee"
0:00:01.274630233 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<GstTee@0x12ba000> adding pad 'sink'
0:00:01.275024699 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:975:gst_element_get_static_pad: found pad audiotee:sink
0:00:01.275450581 598 0x11e4008 INFO GST_STATES gstelement.c:2435:gst_element_continue_state:<audiotee> committing state from NULL to READY, pending PAUSED, next PAUSED
0:00:01.275772761 598 0x11e4008 INFO GST_STATES gstelement.c:2365:_priv_gst_element_state_changed:<audiotee> notifying about state-changed NULL to READY (PAUSED pending)
0:00:01.276194935 598 0x11e4008 INFO GST_STATES gstelement.c:2442:gst_element_continue_state:<audiotee> continue state change READY to PAUSED, final PAUSED
0:00:01.276590041 598 0x11e4008 INFO GST_STATES gstelement.c:2460:gst_element_continue_state:<audiotee> completed state change to PAUSED
0:00:01.276917951 598 0x11e4008 INFO GST_STATES gstelement.c:2365:_priv_gst_element_state_changed:<audiotee> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:01.278029391 598 0x11e4008 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link audio_sink:proxypad0 and audiotee:sink
0:00:01.278387647 598 0x11e4008 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked audio_sink:proxypad0 and audiotee:sink, successful
0:00:01.278770135 598 0x11e4008 INFO GST_ELEMENT_PADS gstelement.c:728:gst_element_add_pad:<playsink0> adding pad 'audio_sink'
0:00:01.279207105 598 0x11e4008 INFO GST_PADS gstutils.c:1596:prepare_link_maybe_ghosting: ffmpegcsp0 and playsink0 in same bin, no need for ghost pads
0:00:01.611396842 598 0x11e4008 INFO GST_PADS gstpad.c:1978:gst_pad_link_prepare: trying to link ffmpegcsp0:src and playsink0:audio_sink
0:00:01.611822588 598 0x11e4008 INFO GST_PADS gstpad.c:2161:gst_pad_link_full: linked ffmpegcsp0:src and playsink0:audio_sink, successful
警告:错误的管道:没有源元素的链接 #
答案 0 :(得分:0)
试试这个管道:
gst-launch filesrc location=FlickAnimation.avi ! decodebin ! ffmpegcolorspace ! xvimagesink