pipeless-ai / pipeless

An open-source computer vision framework to build and deploy apps in minutes
https://pipeless.ai
Apache License 2.0
688 stars 31 forks source link

[Getting Start] ERROR - OUTPUT - Unable to set the pipeline to the playing state. #96

Closed chanwitkepha closed 7 months ago

chanwitkepha commented 7 months ago

According to Document in https://www.pipeless.ai/docs/docs/v0/getting-started

When I use command pipeless run it showsERROR - OUTPUT - Unable to set the pipeline to the playing state.

Please suggest. How to solve this error. Thank you.

Detail is i the Text below

Operating System: Ubuntu 22.04.3 LTS

Python 3.10.12
pip 23.3.1 from /usr/local/lib/python3.10/dist-packages/pip (python 3.10)

pip install pipeless-ai pipeless-ai-cli

pipeless-ai            0.1.19
pipeless-ai-cli        0.1.16

Install Dependencies (GStreamer)

apt-get install -y pkg-config libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
    libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools \
    gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 \
    gstreamer1.0-qt5 gstreamer1.0-pulseaudio libcairo2-dev libgirepository1.0-dev

My config.yaml

input:
  address:
    host: localhost
    port: 1234
  video:
    enable: true
    uri: http://192.168.10.31:800/Gate1-Camera4-2023-11-24_0855_0930_REC.mp4
log_level: INFO
output:
  address:
    host: localhost
    port: 1237
  video:
    enable: true
    uri: file:///home/devteam/my_first_project/output/output.mp4
plugins:
  order: ''
worker:
  n_workers: 1
model:
    uri: ""

Output whenpipeless run

running project...
Loading config.yaml...
Config file config.yaml detected
17:15:29 INFO     - INPUT - Reading video from http://192.168.10.31:800/Gate1-Camera4-2023-11-24_0855_0930_REC.mp4                                input.py:290
         INFO     - INPUT - Waiting first worker to be available                                                                                  input.py:305
17:15:30 INFO     - WORKER - Worker ready! Notifying input                                                                                       worker.py:179
17:15:30 INFO     - INPUT - First worker ready                                                                                                    input.py:307
         INFO     - INPUT - Starting input pipeline                                                                                               input.py:216
         INFO     - INPUT - Linking uridecodebin pad to videoconvert pad                                                                          input.py:149
17:15:31 INFO     - INPUT - Tags parsed: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en,                       input.py:276
                  bitrate=(uint)23889190;
         INFO     - INPUT - Tags parsed: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\ output",         input.py:276
                  container-format=(string)"ISO\ MP4/M4A";
17:15:31 INFO     - OUTPUT - Output tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en,          output.py:324
                  bitrate=(uint)23889190;
         INFO     - OUTPUT - Output tags updated to: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\     output.py:324
                  output", container-format=(string)"ISO\ MP4/M4A", video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en,
                  bitrate=(uint)23889190;
         INFO     - INPUT - dynamic source pad "video_0" with caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160,           input.py:76
                  interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1,
                  framerate=(fraction)25/1
         INFO     - OUTPUT - Creating new pipeline for caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160,                output.py:370
                  interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1,
                  framerate=(fraction)25/1
         ERROR    - OUTPUT - Unable to set the pipeline to the playing state.      

When I change log_level to DEBUG

Loading config.yaml...
Config file config.yaml detected
17:16:34 DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read                                                            connection.py:60
         DEBUG    - OUTPUT - No data to read, try again on: InputOutputSocket-Read
..................................

My Nginx Web Server Access Log

192.168.11.236 - - [03/Dec/2023:00:16:37 +0700] "GET /Gate1-Camera4-2023-11-24_0855_0930_REC.mp4 HTTP/1.1" 200 21669061 "-" "GStreamer souphttpsrc 1.20.3 libsoup/2.74.2

miguelaeh commented 7 months ago

Hi @chanwitkepha ,

Could you upgrade to version 1? (https://www.pipeless.ai/docs/v1/getting-started), it is more stable than version 0. You can find the installation details at: https://www.pipeless.ai/docs/docs/v1/getting-started/installation

chanwitkepha commented 7 months ago

Hi @miguelaeh

Now I upgrade to version 1.2 and test again according to https://www.pipeless.ai/docs/v1/getting-started

pipeless init my_first_project --template scaffold
cd my_first_project

pipeless start --stages-dir . Then I SSH to another terminal and run command

pipeless add stream --input-uri "http://192.168.10.31:800/Gate1-Camera4-2023-11-24_0855_0930_REC.mp4" --output-uri "file:///home/devteam/output/output.mp4" --frame-path "my-stage"

It seems work well.

devteam@test-11236:~/my_first_project$ pipeless start --stages-dir .
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser] ⚙️  Loading stages from .
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser] ⏳ Loading stage 'my_stage' from ./my-stage
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/pre-process.py
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-pre_process
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/process.py
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-process
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/post-process.py
[2023-12-02T23:47:31Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-post_process
[2023-12-02T23:47:31Z INFO  pipeless_ai::config::adapters::rest] REST adapter running
[2023-12-02T23:47:31Z INFO  warp::server] Server::run; addr=127.0.0.1:3030
[2023-12-02T23:47:31Z INFO  warp::server] listening on http://127.0.0.1:3030
[2023-12-02T23:47:53Z INFO  pipeless_ai::dispatcher] New stream entry detected, creating pipeline
[2023-12-02T23:47:53Z ERROR pipeless_ai::gst::utils] Failed to create component nvvidconv of type nvvidconv
[2023-12-02T23:47:56Z INFO  pipeless_ai::input::pipeline] Using SystemMemory
[2023-12-02T23:47:56Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id 99c3fe0b-e00e-4ef1-aab6-88172e4be02c. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190;
[2023-12-02T23:47:56Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id 99c3fe0b-e00e-4ef1-aab6-88172e4be02c. Tags: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\ output", container-format=(string)"ISO\ MP4/M4A";
[2023-12-02T23:47:56Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190;
[2023-12-02T23:47:56Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\ output", container-format=(string)"ISO\ MP4/M4A";
[2023-12-02T23:47:56Z INFO  pipeless_ai::input::pipeline] Dynamic source pad video_0 caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1, framerate=(fraction)25/1
[2023-12-02T23:47:56Z INFO  pipeless_ai::pipeline] New input caps. Creating output pipeline for caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1, framerate=(fraction)25/1
.............................................................
devteam@test-11236:~/my_first_project$ ls -l /home/devteam/output/
total 348
-rw-rw-r-- 1 devteam devteam 353810 Dec  2 23:48 output.mp4
devteam@test-11236:~/my_first_project$

However if change --output-uri to screen (same as getting start) it have error.

pipeless add stream --input-uri "http://192.168.10.31:800/Gate1-Camera4-2023-11-24_0855_0930_REC.mp4" --output-uri "screen" --frame-path "my-stage"

devteam@test-11236:~/my_first_project$ pipeless start --stages-dir .
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser] ⚙️  Loading stages from .
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser] ⏳ Loading stage 'my_stage' from ./my-stage
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/pre-process.py
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-pre_process
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/process.py
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-process
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]        Loading hook from ./my-stage/post-process.py
[2023-12-02T23:58:23Z INFO  pipeless_ai::stages::parser]                Creating stateless hook for my_stage-post_process
[2023-12-02T23:58:23Z INFO  pipeless_ai::config::adapters::rest] REST adapter running
[2023-12-02T23:58:23Z INFO  warp::server] Server::run; addr=127.0.0.1:3030
[2023-12-02T23:58:23Z INFO  warp::server] listening on http://127.0.0.1:3030
[2023-12-02T23:59:26Z INFO  pipeless_ai::dispatcher] New stream entry detected, creating pipeline
[2023-12-02T23:59:26Z ERROR pipeless_ai::gst::utils] Failed to create component nvvidconv of type nvvidconv
[2023-12-02T23:59:29Z INFO  pipeless_ai::input::pipeline] Using SystemMemory
[2023-12-02T23:59:30Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190;
[2023-12-02T23:59:30Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\ output", container-format=(string)"ISO\ MP4/M4A";
[2023-12-02T23:59:30Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190;
[2023-12-02T23:59:30Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, datetime=(datetime)2023-11-24T02:33:41Z, encoder=(string)"vlc\ 3.0.20\ stream\ output", container-format=(string)"ISO\ MP4/M4A";
[2023-12-02T23:59:30Z INFO  pipeless_ai::input::pipeline] Dynamic source pad video_0 caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1, framerate=(fraction)25/1
[2023-12-02T23:59:30Z INFO  pipeless_ai::pipeline] New input caps. Creating output pipeline for caps: video/x-raw, format=(string)I420, width=(int)3840, height=(int)2160, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2, colorimetry=(string)1:3:5:1, framerate=(fraction)25/1
[2023-12-02T23:59:30Z WARN  pipeless_ai::output::pipeline] Taginject element not found in the pipeline
[2023-12-02T23:59:30Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)36450989, maximum-bitrate=(uint)36450989;
[2023-12-02T23:59:30Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)36450989;
[2023-12-02T23:59:31Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)41582578;
[2023-12-02T23:59:32Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)62044676;
[2023-12-02T23:59:32Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)63859182;
[2023-12-02T23:59:34Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)36450989, maximum-bitrate=(uint)36450989;
[2023-12-02T23:59:34Z WARN  pipeless_ai::output::pipeline] Taginject element not found, skipping tags update.
[2023-12-02T23:59:34Z WARN  pipeless_ai::output::pipeline] Taginject element not found in the pipeline
[2023-12-02T23:59:34Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)36450989;
[2023-12-02T23:59:34Z WARN  pipeless_ai::output::pipeline] Taginject element not found, skipping tags update.
[2023-12-02T23:59:34Z WARN  pipeless_ai::output::pipeline] Taginject element not found in the pipeline
[2023-12-02T23:59:35Z INFO  pipeless_ai::pipeline] Tags updated to: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)15214705, maximum-bitrate=(uint)41582578;
[2023-12-02T23:59:35Z WARN  pipeless_ai::output::pipeline] Taginject element not found, skipping tags update.
[2023-12-02T23:59:35Z WARN  pipeless_ai::output::pipeline] Taginject element not found in the pipeline
[2023-12-02T23:59:35Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)10318561, maximum-bitrate=(uint)63859182;
[2023-12-02T23:59:35Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)10318561, maximum-bitrate=(uint)162271172;
[2023-12-02T23:59:35Z INFO  pipeless_ai::input::pipeline] New tags for input gst pipeline with id abca9c74-644d-4594-8850-cba64840be53. Tags: taglist, video-codec=(string)"H.264\ \(High\ Profile\)", language-code=(string)en, bitrate=(uint)23889190, minimum-bitrate=(uint)6316243, maximum-bitrate=(uint)162271172;
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
pipeless: ../../src/xcb_io.c:175: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted (core dumped)
miguelaeh commented 7 months ago

Hi @chanwitkepha ,

Thanks or the detailed information. I am not able to reproduce it on my environment, which is also Ubuntu 22.04. However, it seems to be a problem related to X11 multithreading, since using files it works, I would say it is related to the Gstreamer autovideosink plugin.

Could you try to stop Pipeless, export the following variable, and start it again?

export GST_GL_XINITTHREADS=1

In case that doesn't work, could share the output of the following commands?:

sudo X -version

xvinfo | grep version
chanwitkepha commented 7 months ago

Hi @chanwitkepha ,

Thanks or the detailed information. I am not able to reproduce it on my environment, which is also Ubuntu 22.04. However, it seems to be a problem related to X11 multithreading, since using files it works, I would say it is related to the Gstreamer autovideosink plugin.

Could you try to stop Pipeless, export the following variable, and start it again?

export GST_GL_XINITTHREADS=1

In case that doesn't work, could share the output of the following commands?:

sudo X -version

xvinfo | grep version

Thank you for your help. I will try it again.

miguelaeh commented 7 months ago

Hi @chanwitkepha ,

I see you closed the issue, did the above work? Please let me know so we can improve documentation or add it by default.