簡體   English   中英

GStreamer - 我的環境肯定被污染了

[英]GStreamer - my environment must be fouled

最終,我正在嘗試使用 AWS Kinesis Video Streams。 我按照說明,成功構建了 cpp producer 插件,但是基本的 gstreamer 功能似乎無法正常工作。 我當然有可能在 KVS 設置期間搞砸了環境。 試圖調試這個,我的環境似乎在某個地方被污染了。 簡單的 GST 事情不起作用。

這是一個非常簡單的 Ubuntu 18.04 平台。

echo $GST_DEBUG
4

我連接了 Logictech C920 網絡攝像頭。 (而且,在測試 w/ffplay 時它工作正常。)

v4l2-ctl --list-devices
HD Pro Webcam C920 (usb-0000:00:14.0-13):
    /dev/video0
    /dev/video1

設備監視器似乎不起作用

gst-device-monitor-1.0
0:00:00.000022374 20439 0x55eccd947000 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.0
0:00:00.000052028 20439 0x55eccd947000 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /home/train/anaconda3/lib
0:00:00.000057359 20439 0x55eccd947000 INFO                GST_INIT gst.c:607:init_pre: Linux xps8930 5.4.0-77-generic #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021 x86_64
0:00:00.000210792 20439 0x55eccd947000 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.000459675 20439 0x55eccd947000 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.000658674 20439 0x55eccd947000 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000737628 20439 0x55eccd947000 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000742642 20439 0x55eccd947000 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000766492 20439 0x55eccd947000 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.001704356 20439 0x55eccd947000 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /home/train/.cache/gstreamer-1.0/registry.x86_64.bin in 0.000917 seconds
0:00:00.001722697 20439 0x55eccd947000 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.001991025 20439 0x55eccd947000 INFO            GST_REGISTRY gstregistry.c:1685:scan_and_update_registry: Registry cache has not changed
0:00:00.001996780 20439 0x55eccd947000 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.002000383 20439 0x55eccd947000 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.63.1
0:00:00.002004369 20439 0x55eccd947000 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.1
0:00:00.002007594 20439 0x55eccd947000 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
Probing devices...

0:00:00.002051832 20439 0x55eccd947000 WARN                 default gstdevicemonitor.c:458:gst_device_monitor_start:<devicemonitor0> No filters have been set, will expose all devices found
0:00:00.002063611 20439 0x55eccd947000 WARN                 default gstdevicemonitor.c:465:gst_device_monitor_start:<devicemonitor0> No providers match the current filters
Failed to start device monitor!

測試來自連接的 USB 網絡攝像頭的流不起作用

gst-launch-1.0 v4l2src ! xvimagesink
0:00:00.000026878 19950 0x557e65356400 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.0
0:00:00.000042060 19950 0x557e65356400 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /home/train/anaconda3/lib
0:00:00.000064166 19950 0x557e65356400 INFO                GST_INIT gst.c:607:init_pre: Linux xps8930 5.4.0-77-generic #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021 x86_64
0:00:00.000174203 19950 0x557e65356400 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.000400110 19950 0x557e65356400 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.000548873 19950 0x557e65356400 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000603380 19950 0x557e65356400 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000622411 19950 0x557e65356400 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000649669 19950 0x557e65356400 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.001560214 19950 0x557e65356400 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /home/train/.cache/gstreamer-1.0/registry.x86_64.bin in 0.000901 seconds
0:00:00.001598756 19950 0x557e65356400 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.001806632 19950 0x557e65356400 INFO            GST_REGISTRY gstregistry.c:1685:scan_and_update_registry: Registry cache has not changed
0:00:00.001812424 19950 0x557e65356400 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.001817608 19950 0x557e65356400 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.63.1
0:00:00.001838279 19950 0x557e65356400 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.1
0:00:00.001843281 19950 0x557e65356400 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.001855168 19950 0x557e65356400 INFO            GST_PIPELINE gstparse.c:337:gst_parse_launch_full: parsing pipeline description 'v4l2src ! xvimagesink '
0:00:00.001863268 19950 0x557e65356400 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "v4l2src"!
0:00:00.001871121 19950 0x557e65356400 ERROR           GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "v4l2src"
0:00:00.001879687 19950 0x557e65356400 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "xvimagesink"!
0:00:00.001884772 19950 0x557e65356400 ERROR           GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "xvimagesink"
0:00:00.001890918 19950 0x557e65356400 ERROR           GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=@(nil)]
ERROR: pipeline could not be constructed: no element "v4l2src".

奇怪的是,AWS 插件似乎就位

export GST_PLUGIN_PATH=`pwd`/build
gst-inspect-1.0 kvssink

... the output is exactly what AWS says to expect
gst-launch-1.0 -v rtspsrc location=rtsp://<username>:<mypassword>@X.X.X.X:554//h264Preview_01_main short-header=TRUE ! rtph264depay ! video/x-h264, format=avc,alignment=au ! h264parse ! kvssink stream-name=sec-cam00 storage-size=128
0:00:00.000022068 20861 0x558719b40400 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.14.0
0:00:00.000041120 20861 0x558719b40400 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /home/train/anaconda3/lib
0:00:00.000060355 20861 0x558719b40400 INFO                GST_INIT gst.c:607:init_pre: Linux xps8930 5.4.0-77-generic #86~18.04.1-Ubuntu SMP Fri Jun 18 01:23:22 UTC 2021 x86_64
0:00:00.000224186 20861 0x558719b40400 INFO                GST_INIT gstmessage.c:127:_priv_gst_message_initialize: init messages
0:00:00.000481683 20861 0x558719b40400 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.000643144 20861 0x558719b40400 INFO      GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000679781 20861 0x558719b40400 INFO      GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000685079 20861 0x558719b40400 INFO      GST_PLUGIN_LOADING gstplugin.c:227:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000696647 20861 0x558719b40400 INFO            GST_REGISTRY gstregistry.c:1727:ensure_current_registry: reading registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.001644394 20861 0x558719b40400 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /home/train/.cache/gstreamer-1.0/registry.x86_64.bin in 0.000939 seconds
0:00:00.001662943 20861 0x558719b40400 INFO            GST_REGISTRY gstregistry.c:1583:scan_and_update_registry: Validating plugins from registry cache: /home/train/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.002679163 20861 0x558719b40400 INFO            GST_REGISTRY gstregistry.c:1685:scan_and_update_registry: Registry cache has not changed
0:00:00.002685537 20861 0x558719b40400 INFO            GST_REGISTRY gstregistry.c:1762:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.002689246 20861 0x558719b40400 INFO                GST_INIT gst.c:807:init_post: GLib runtime version: 2.63.1
0:00:00.002693062 20861 0x558719b40400 INFO                GST_INIT gst.c:809:init_post: GLib headers version: 2.56.1
0:00:00.002696296 20861 0x558719b40400 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.002707295 20861 0x558719b40400 INFO            GST_PIPELINE gstparse.c:337:gst_parse_launch_full: parsing pipeline description 'rtspsrc location=rtsp://admin:eAgleEyE5437@10.0.0.3:554//h264Preview_01_main short-header=TRUE ! rtph264depay ! video/x-h264, format=avc,alignment=au ! h264parse ! kvssink stream-name=sec-cam00 storage-size=128 '
0:00:00.002715675 20861 0x558719b40400 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "rtspsrc"!
0:00:00.002722336 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "rtspsrc"
0:00:00.002729448 20861 0x558719b40400 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "rtph264depay"!
0:00:00.002733774 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "rtph264depay"
0:00:00.002738443 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=@(nil)]
0:00:00.002751141 20861 0x558719b40400 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "h264parse"!
0:00:00.002756032 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "h264parse"
0:00:00.002760080 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=@(nil)]
0:00:00.007178292 20861 0x558719b40400 INFO      GST_PLUGIN_LOADING gstplugin.c:901:_priv_gst_plugin_load_file_for_registry: plugin "/home/train/projects/amazon-kinesis-video-streams-producer-sdk-cpp/build/libgstkvssink.so" loaded
0:00:00.007189020 20861 0x558719b40400 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "kvssink"
0:00:00.007301650 20861 0x558719b40400 ERROR           GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=@0x558719bdc0a0]
WARNING: erroneous pipeline: no element "rtspsrc"

康達停用

所有這些問題都是由基本 conda 環境激活引起的。 停用 conda 就好了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM