Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I stream appsrc to RTMP server (Wowza)? #40

Open
dfarrowUnity opened this issue Jul 26, 2022 · 2 comments
Open

How can I stream appsrc to RTMP server (Wowza)? #40

dfarrowUnity opened this issue Jul 26, 2022 · 2 comments

Comments

@dfarrowUnity
Copy link

dfarrowUnity commented Jul 26, 2022

I am trying to stream RTMP using Test4 scene. I made this update in the CustomVideoStreamer "Pipeline" field:

videoconvert ! video/x-raw,format=I420 ! x264enc name=videoEnc bitrate=5000 tune=zerolatency pass=qual ! video/x-h264 ! queue ! flvmux name=mux ! rtmpsink location=rtmp://192.123.1.45:1935/live_test/myStream

I see my stream appear in Wowza, but I cannot play it back. A very similar commands works for me on the command line:

gst-launch-1.0 gdiscreencapsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc name=videoEnc bitrate=5000 tune=zerolatency pass=qual ! video/x-h264 ! queue ! flvmux name=mux ! rtmpsink location=rtmp://192.168.1.33:1935/live_test/myStream

Can you provide any insight into streaming using RTMP? (Please note, I do have "Run in Background" set on Player settings)

@dfarrowUnity
Copy link
Author

dfarrowUnity commented Jul 27, 2022

I did some further testing and it seems that it is only failing to play when I use the "appsrc", when I alter the plugin so the pipeline is exactly the same except "appsrc" is replaced with "videotestsrc" like this:

videotestsrc name=src do-timestamp=true is-live=true block=true ! video/x-raw,format=RGB,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc name=videoEnc bitrate=5000 tune=zerolatency pass=qual byte-stream=true threads=4 ! video/x-h264 ! queue ! flvmux streamable=true name=mux ! rtmpsink location=rtmp://192.168.1.33:1935/live_test/unityStream

everything plays as expected. It seems something about the way the appsrc is sending data to Wowza is not working, however Wowza doesn't show any errors in the logs, there is just no playback (the playlist loads but not the chunklists). Do you know how I might get the appsrc working with RTMP?

@dfarrowUnity
Copy link
Author

dfarrowUnity commented Jul 28, 2022

Interestingly, I found if I set the "Fps" to 5 or below on the "CustomVideoStreamer.cs" script, I can actually see a frame of video when I go to play the HLS stream. After a single frame displays the video stops. If I hit play again, I will see another single frame and then it stops. It seems that this gstreamer pipeline is starving the encoder, however Wowza seems to report an acceptable bitrate coming in (~1.930 Mbits/s). Any clue on how to send the data correctly via RTMP? My Pipeline string:

appsrc name=src do-timestamp=true is-live=true block=true ! video/x-raw,format=RGB,width=360,height=240,framerate=4/1 ! videoconvert ! video/x-raw,format=I420 ! x264enc name=videoEnc bitrate=1000 tune=zerolatency pass=qual byte-stream=true threads=4 ! video/x-h264 ! queue ! flvmux streamable=true name=mux ! rtmpsink location=rtmp://127.0.0.1:1935/live_test/myStream

@dfarrowUnity dfarrowUnity changed the title How can I stream RTMP? How can I stream appsrc to RTMP server (Wowza)? Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant