pipeless-ai / pipeless

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

Issue with RTMP input #154

Open arunbpf opened 2 months ago

arunbpf commented 2 months ago

I am trying to use RTMP input with Pipeless. I am able to play the RTMP input stream on VLC and ffplay. But facing error in Pipeless.

pipeless add stream --input-uri "rtmp://x.x.x.x:1935/live/test" --output-uri "file:///app/rtmp_out.mp4" --frame-path "yolo"
[2024-08-19T11:59:14Z INFO  pipeless_ai::config::adapters::rest] REST adapter running
[2024-08-19T11:59:14Z INFO  warp::server] Server::run; addr=0.0.0.0:3030
[2024-08-19T11:59:14Z INFO  warp::server] listening on http://0.0.0.0:3030
[2024-08-19T12:01:51Z WARN  pipeless_ai::config::adapters::rest] Restart policy not specified for stream, defaulting to 'never'
[2024-08-19T12:01:51Z INFO  pipeless_ai::dispatcher] New stream entry detected, creating pipeline
[2024-08-19T12:01:51Z ERROR pipeless_ai::input::pipeline] Error in input gst pipeline from element rtmp2src0.
                    Pipeline id: 82091e35-69b8-43f8-bfe4-92f5b7ed62eb. Error: Failed to connect
[2024-08-19T12:01:51Z ERROR pipeless_ai::pipeline] Stopping stream for pipeline: 82091e35-69b8-43f8-bfe4-92f5b7ed62eb due to input stream error: Failed to connect
[2024-08-19T12:01:51Z INFO  pipeless_ai::events] Stream loop stopped
[2024-08-19T12:01:51Z WARN  pipeless_ai::events] Error sending input stream error event: channel closed
[2024-08-19T12:01:51Z ERROR pipeless_ai::input::pipeline] Error in input gst pipeline from element flvdemux0.
                    Pipeline id: 82091e35-69b8-43f8-bfe4-92f5b7ed62eb. Error: Internal data stream error.
[2024-08-19T12:01:51Z INFO  pipeless_ai::dispatcher] Stream config entry removed. Stopping associated pipeline

Any idea why this might happen ?

miguelaeh commented 2 months ago

Add GST_DEBUG=4 to try gathering more information about the gstreamer pipeline

arunbpf commented 2 months ago

I am able process the RTMP source after removing audio from the stream. Now the issue occurs in output RTSP stream. Pipeless is publishing the RTSP stream to the mediamtx server. But I am not able to play it in VLC or ffplay.

pipeless add stream --input-uri "rtmp://x.x.x.x/myapp/mystream_noaudio" --output-uri "rtsp://localhost:8554/output" --frame-path "yolo"
[2024-08-22T11:33:22Z WARN  pipeless_ai::output::pipeline] Warning in output gst pipeline from element element appsink0.
                    Pipeline id: 0344289c-a057-4945-bc8c-b2531754827d. Warning: Pipeline construction is invalid, please add queues.

Why do we see this warning message ?

miguelaeh commented 2 months ago

mmm that should not happen, rtmp and rtsp have been tested to work. It seems to complain about the output gstreamer pipeline for rtsp not having queues. I think it can be fixed by adding a queue compoment here: https://github.com/pipeless-ai/pipeless/blob/a23652b75e380a782ad9e5ee4ab876bde3ec9bde/pipeless/src/output/pipeline.rs#L162