KallDrexx / rust-media-libs

Rust based libraries for misc media functionality
Apache License 2.0
229 stars 58 forks source link

Help to execute code #2

Closed carlosb1 closed 5 years ago

carlosb1 commented 5 years ago

Hi, I am trying to use your project (the mio server) but It seems it is not working or I don't understand how... I execute your server, and It works... Also, I execute ffmpeg to send it a video and it seems that it is working well:

ffmpeg -re -i video.mkv -c:v libx264 -preset veryfast -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmp://localhost:1935 But If when I use the VLC player, It seems It connects but I can not display anything... (my vlc connect to the rtmp://localhost:1935) Do you have some extradescription to use it...

KallDrexx commented 5 years ago

Hi there!

RTMP requires specifying both an application name and a stream key you want to transmit on. So giving it rtmp://localhost:1935 is not enough information for ffmpeg to publish the stream to, and thus the server doesn't know who or how to relay it.

If you change rtmp://locahost:1935/live/test for both ffmpeg and vlc it should work. That's saying you want to publish the stream on the live application via the test stream key. Since this is a test server it accepts any application and stream key, but generally most RTMP servers are set up so they have different functionality based on what application is provided (transcode vs recording vs playback), as well as allowing protection over what stream keys are allowed.

I tested with that same ffmpeg command and it works with a valid application/stream key, so feel free to reopen if you are still having trouble.