praxis-live / support

Documentation and issue tracking
9 stars 2 forks source link

Can't capture RTSP stream: Internal data stream error. #86

Closed y8 closed 6 years ago

y8 commented 6 years ago

Hello.

I'm trying to capture a stream from my iPhone using Periscope HD rtsp streamer.

I have validated that stream can be captured:

./gst-launch-1.0 rtspsrc location=rtsp://iPhone.local:8554/live.sdp ! decodebin ! autovideosink

It shows the video stream in the separate window.

When I'm adding thertspsrc location=rtsp://iPhone.local:8554/live.sdp ! decodebin pipeline in "device" property I'm getting an error in IDE Log:

INFO [net.neilcsmith.praxis.video.pgl.PGLPlayer]: Starting experimental PGL renderer.
WARNING [net.neilcsmith.praxis.video.gst1.components.AbstractGstDelegate]: BaseSrc: [udpsrc10] : Internal data stream error.

I've tried to select the stream by sending select-stream=0 or select-stream=1 signals (rtspsrc location=rtsp://iPhone.local:8554/live.sdp select-stream=1 ! decodebin), but it still throws and exception.

Product Version: Praxis LIVE 3.5.0 Java: 1.8.0_73; Java HotSpot(TM) 64-Bit Server VM 25.73-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_73-b02 System: Mac OS X version 10.13.4 running on x86_64; UTF-8; en_US (praxis_live)

gstreamer-1.0-1.14.0-x86_64

I'm a total gstreamer newbie, so maybe I'm doing something wrong.

Anyways, thanks for an amazing app!

P.S. I've tested this in 4.0-rc1, and result is the same:

ERROR : /video/capture-1
Internal data stream error.
neilcsmith-net commented 6 years ago

Hi! Thanks for the feedback - glad you're liking Praxis LIVE! :smile:

OK, welcome to the fun of GStreamer! The problem is that the way video:capture works is by creating a GStreamer bin (sub-graph) with your elements in it. This automatically creates output ports if there are any - but the problem is that decodebin doesn't have any outputs until later when it's decoded the stream. I may need to rethink using bin here, as I can't think of an easy workaround, however -

Your best option might be to use a video:player component instead and try setting the video location to the rtsp uri rather than a file - this should hopefully work - let me know how you get on.

Best wishes, Neil

y8 commented 6 years ago

Thanks for such a quick reply!

I've tried setting rtsp uri to video:player (just rtsp://iPhone.local:8554/live.sdp), but it fails:

ERROR : /video/player-1
Could not open resource for reading and writing.

Maybe, as temporary workaround I can use some custom processing2/3 code to interface with gstreamer?

Thanks!

neilcsmith-net commented 6 years ago

OK, I'll have a further look at this tomorrow. Do try on the CLI with gst-launch playbin uri= ... and check that works. Also make sure to try in the v4 rc as there is more up-to-date and re-codeable GStreamer support there.

I plan on opening up the GStreamer access a bit more, but there's nothing you can do with Processing here - Praxis LIVE has its own GStreamer integration which is more up-to-date than Processing's (I'm also the maintainer of the Java bindings for GStreamer).

y8 commented 6 years ago

Yes, setting rtsp:// uri in video:player did work! Seems like last time I haven't restart the Hub or made a typo.

Yay! 🤘

Thanks a million!

neilcsmith-net commented 6 years ago

Great! :smile:

A hub restart should never be required for this, but the player does need triggering again on uri changes - not sure if that was it - connecting ready to play can be useful if you haven't already.

Look forward to seeing what you make - blog, tweet, etc. and let us know. I'll close this now.

Thanks, Neil

neilcsmith-net commented 6 years ago

@y8 out of interest, I don't know how much you've been using Praxis LIVE so far? I'm doing a talk at Libre Graphics Meeting next week, and would love to show some examples / documentation of things people have been making with it. If you've anything you'd be interested in sharing, there's an email address on the website. Thanks!

y8 commented 6 years ago

Hey!

Nothing secret, so I’ll post it here.

Praxis Live is awesome!

I never done any video stuff before, but this Friday I will do visual background for my friends performance. I hope there will be a recording, or maybe even stream.

Anyways, In couple of days I’ve managed to build very basic GUI for video mixing. I made two “video channels” where you can change video samples and add effects with shaders. Each channel got its own preview. Then video is sent to the mixer (thanks to the new send/receive syphon components, they are lifesavers) where I can blend them together, again using different shaders.

I’m using slightly modified gl-filter-base, where fragment is actually an Input. I have a special component called “video-shader-bank” where you have multiple “fragments” (each in separate editor) and you can select which one you want to output. It’s easier than putting everything in one shader.

I’ve tested the ability to capture RTSP stream, and it works. I have planned to use the stream from the camera walking in the crowd to make a quick loops to play them on background. But I have failed to build a sample recorder. I tried to create an array of PGraphic instances and use it as an offscreen frame buffer, but I have failed to properly initialize array so any attempt to copy PImage fails due null pointer exception. I never ever used Java (and I have little experience with statically typed languages) before, so if you have any suggestions on how I can temporary record about 10 seconds of video, it would be awesome.

Overall, speed of development with Praxis is stunning. Real-time coding FTW!

However, there a few annoying issues. Biggest one is that I don’t know how to save a project without either restarting hub or closing it. I’ve lost some work few times and I would love to know how to quickly save all open files.

Second one is video:player performance. When I’m starting one player with 720p video, it uses around 70% of CPU. Per player :( I’ve down scaled videos, but it cut just 10-15% of cpu usage. Adding multiple shaders along the line does not affect performance much, so I’m wondering why player uses so much CPU and is there a way to do improve it, dunno, by offloading something to GPU?

NB: I’m working on MacBook Air 2013 (mobile i7) with Intel 5000 graphics, so maybe I just need modern hardware. :) But to be honest, I’ve tried trial of Resolume Arena 6 and it just hang up on playing just one sample. So Praxis Live seems to be more preformant than Resoulme.

I’m going to release project sources a bit later.

By the way, rc1 sigfaulted couple times. What info you need in this case? I’m a bit shy on opening new issues :)